[Freeciv-Dev] (PR#9079) remove UNIT_TILE_HEIGHT special-case from gui_re
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#9079) remove UNIT_TILE_HEIGHT special-case from gui_rect_iterate |
From: |
"Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx> |
Date: |
Wed, 23 Jun 2004 08:03:07 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9079 >
Currently when you iterate over an area with gui_rect_iterate, any tiles
whose UNIT_TILE_HEIGHT overlap will be included in the iteration. This
is unnecessary for most users, however. Only the tile drawing layer
needs to access this extra height. For the rest it just slows things down.
So this patch removes that special-case. Now when iterating only tiles
whose main area overlap will be included. This means the special-case
must be put into the single caller that requires this behavior.
The result is no doubt faster than the current behavior, particularly
for things like goto mode.
Another alternative is to add a parameter to gui_rect_iterate
controlling whether the normal tile or the full tile is desired. The
only drawback of this is that it makes the interface more complicated.
jason
? gmon.out
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.131
diff -u -r1.131 mapview_common.c
--- client/mapview_common.c 23 Jun 2004 14:50:41 -0000 1.131
+++ client/mapview_common.c 23 Jun 2004 14:59:11 -0000
@@ -1406,7 +1406,8 @@
/* FIXME: we don't have to draw black (unknown) tiles since they're already
* cleared. */
if (is_isometric) {
- gui_rect_iterate(gui_x0, gui_y0, width, height, map_x, map_y) {
+ gui_rect_iterate(gui_x0, gui_y0, width, height + NORMAL_TILE_HEIGHT / 2,
+ map_x, map_y) {
put_tile_iso(map_x, map_y);
} gui_rect_iterate_end;
} else {
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.69
diff -u -r1.69 mapview_common.h
--- client/mapview_common.h 23 Jun 2004 14:50:41 -0000 1.69
+++ client/mapview_common.h 23 Jun 2004 14:59:11 -0000
@@ -93,8 +93,6 @@
int count; \
\
if (is_isometric) {
\
- /* Extra half-tile of UNIT_TILE_HEIGHT. */ \
- GRI_y1++;
\
/* Tiles to the left/above overlap with us. */ \
GRI_x0--;
\
GRI_y0--;
\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#9079) remove UNIT_TILE_HEIGHT special-case from gui_rect_iterate,
Jason Short <=
|
|