Update of /cvsroot/super-tux/supertux/src/object
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28962/src/object
Modified Files:
tilemap.cpp
Log Message:
Fixed crash on level editor by making a pos test.
Index: tilemap.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/object/tilemap.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tilemap.cpp 28 Nov 2004 14:56:52 -0000 1.2
+++ tilemap.cpp 19 Dec 2004 16:53:23 -0000 1.3
@@ -144,7 +144,9 @@
/** if we don't round here, we'll have a 1 pixel gap on screen sometimes.
* I have no idea why */
float start_x = roundf(context.get_translation().x);
+ if(start_x < 0) start_x = 0;
float start_y = roundf(context.get_translation().y);
+ if(start_y < 0) start_y = 0;
float end_x = std::min(start_x + screen->w, float(width * 32));
float end_y = std::min(start_y + screen->h, float(height * 32));
start_x -= int(start_x) % 32;
|