wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src unit_display.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src unit_display.cpp
Date: Sat, 18 Sep 2004 07:33:26 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/09/18 11:13:08

Modified files:
        src            : unit_display.cpp 

Log message:
        No need to recompute the tiles adjacent to the source tile at each step 
of the move.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_display.cpp.diff?tr1=1.32&tr2=1.33&r1=text&r2=text

Patches:
Index: wesnoth/src/unit_display.cpp
diff -u wesnoth/src/unit_display.cpp:1.32 wesnoth/src/unit_display.cpp:1.33
--- wesnoth/src/unit_display.cpp:1.32   Sat Sep 18 10:40:29 2004
+++ wesnoth/src/unit_display.cpp        Sat Sep 18 11:13:07 2004
@@ -75,6 +75,9 @@
                halo_effect.assign(halo::add(0,0,halo));
        }
 
+       gamemap::location src_adjacent[6];
+       get_adjacent_tiles(a, src_adjacent);
+
        for(int i = 0; i < nsteps; ++i) {
                events::pump();
 
@@ -113,11 +116,9 @@
 
                //invalidate the source tile and all adjacent tiles,
                //since the unit can partially overlap adjacent tiles
-               gamemap::location adjacent[6];
-               get_adjacent_tiles(a,adjacent);
                disp.draw_tile(a.x,a.y);
                for(int tile = 0; tile != 6; ++tile) {
-                       disp.draw_tile(adjacent[tile].x,adjacent[tile].y);
+                       disp.draw_tile(src_adjacent[tile].x, 
src_adjacent[tile].y);
                }
 
                const int height_adjust = src_height_adjust + 
(dst_height_adjust-src_height_adjust)*(i/nsteps);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]