[corsix-th] 03/04: backport editor_drag_performance.patch for usability

Phil Morrell emorrp1-guest at moszumanska.debian.org
Wed Jun 22 22:19:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

emorrp1-guest pushed a commit to branch master
in repository corsix-th.

commit 4323f0bb23a745b9f931884473fbfcdc637006d3
Author: Phil Morrell <debian at emorrp1.name>
Date:   Wed Jun 22 22:48:57 2016 +0100

    backport editor_drag_performance.patch for usability
    
    * new Map Editor is otherwise practically unusable (on radeon) due to
    graphical artifacts like duplicate arrows, static snow, lag
---
 debian/patches/editor_drag_performance.patch | 52 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 2 files changed, 53 insertions(+)

diff --git a/debian/patches/editor_drag_performance.patch b/debian/patches/editor_drag_performance.patch
new file mode 100644
index 0000000..e3d6c03
--- /dev/null
+++ b/debian/patches/editor_drag_performance.patch
@@ -0,0 +1,52 @@
+Subject: [PATCH] Fix performance issue with drag draw in mapper
+From: "Stephen E. Baker" <baker.stephen.e at gmail.com>
+Bug: https://github.com/CorsixTH/CorsixTH/issues/1084
+Origin: upstream, commit:da8b5d76
+Reviewed-by: Phil Morrell <debian at emorrp1.name>
+Last-Update: 2016-06-22
+
+Scale once for the entire drag area instead of once per tile. Greatly
+improves performance.
+---
+ CorsixTH/Lua/dialogs/resizables/map_editor.lua | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CorsixTH/Lua/dialogs/resizables/map_editor.lua b/CorsixTH/Lua/dialogs/resizables/map_editor.lua
+index 6e52248..1a18a7a 100644
+--- a/CorsixTH/Lua/dialogs/resizables/map_editor.lua
++++ b/CorsixTH/Lua/dialogs/resizables/map_editor.lua
+@@ -850,8 +850,7 @@ end
+ --!param ysize (int) Vertical size in tiles.
+ function UIMapEditor:fillCursorArea(canvas, xpos, ypos, xsize, ysize)
+   local ui = self.ui
+-  local zoom = self.ui.zoom_factor
+-  local scaled = canvas:scale(zoom)
++  local zoom = ui.zoom_factor
+ 
+   for x = 0, xsize - 1 do
+     for y = 0, ysize - 1 do
+@@ -859,9 +858,6 @@ function UIMapEditor:fillCursorArea(canvas, xpos, ypos, xsize, ysize)
+       self.cell_outline:draw(canvas, 2, math.floor(xcoord / zoom) - 32, math.floor(ycoord / zoom))
+     end
+   end
+-  if scaled then
+-    canvas:scale(1)
+-  end
+ end
+ 
+ --! Draw the display (map editor window, and main world display)
+@@ -886,10 +882,14 @@ function UIMapEditor:draw(canvas, ...)
+       xsize, ysize = self.cursor.sprite.xsize, self.cursor.sprite.ysize
+     end
+     -- Draw cursors.
++    local scaled = canvas:scale(ui.zoom_factor)
+     for _, coord in ipairs(coords) do
+       local xpos, ypos = coord.xpos, coord.ypos
+       self:fillCursorArea(canvas, xpos, ypos, xsize, ysize)
+     end
++    if scaled then
++      canvas:scale(1)
++    end
+   end
+ 
+   UIResizable.draw(self, canvas, ...)
diff --git a/debian/patches/series b/debian/patches/series
index dcf22f2..0c4d27a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 default_config.patch
 include_campaigns.patch
+editor_drag_performance.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/corsix-th.git



More information about the Pkg-games-commits mailing list