Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13283/src
Modified Files:
tilemap.cpp gameloop.cpp
Log Message:
- added debug grid. type 'grid' in-game to toggle
Index: tilemap.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- tilemap.cpp 22 Nov 2004 21:35:04 -0000 1.22
+++ tilemap.cpp 24 Nov 2004 18:22:22 -0000 1.23
@@ -160,6 +160,21 @@
}
}
+ if (debug_grid)
+ {
+ for (pos.x = start_x; pos.x < end_x; pos.x += 32)
+ {
+ context.draw_filled_rect(Vector (pos.x, start_y), Vector(1, fabsf(start_y - end_y)),
+ Color(225, 225, 225), LAYER_GUI-50);
+ }
+
+ for (pos.y = start_y; pos.y < end_y; pos.y += 32)
+ {
+ context.draw_filled_rect(Vector (start_x, pos.y), Vector(fabsf(start_x - end_x), 1),
+ Color(225, 225, 225), LAYER_GUI-50);
+ }
+ }
+
context.pop_transform();
}
Index: gameloop.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- gameloop.cpp 24 Nov 2004 14:10:25 -0000 1.199
+++ gameloop.cpp 24 Nov 2004 18:22:22 -0000 1.200
@@ -463,6 +463,10 @@
tux.kill(tux.KILL);
last_keys.clear();
}
+ if(compare_last(last_keys, "grid"))
+ { // toggle debug grid
+ debug_grid = !debug_grid;
+ }
if(compare_last(last_keys, "hover"))
{ // toggle hover ability on/off
tux.enable_hover = !tux.enable_hover;
|