[Super-tux-commit] supertux/src leveleditor.cpp,1.117,1.118 world.cpp,1.89,1.90
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-05-15 09:59:11
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10659/src Modified Files: leveleditor.cpp world.cpp Log Message: Cleanup. Also applied the same fix to leveleditor. Unfortanely, still crashes, aparentelly in the same point. Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- world.cpp 14 May 2004 21:49:30 -0000 1.89 +++ world.cpp 15 May 2004 09:59:02 -0000 1.90 @@ -327,16 +327,10 @@ scroll_y = tux_pos_y - Y_SPACE; // this code prevent the screen to scroll before the start or after the level's end - if(scroll_y < 0) - scroll_y = 0; - else if(scroll_y > level->height * 32 - screen->h) + if(scroll_y > level->height * 32 - screen->h) scroll_y = level->height * 32 - screen->h; - - if (scroll_y < 0) - { - //std::cerr << "Level too short!!" << std::endl; + if(scroll_y < 0) scroll_y = 0; - } /* X-axis scrolling */ @@ -389,10 +383,10 @@ } // this code prevent the screen to scroll before the start or after the level's end + if(scroll_x > level->width * 32 - screen->w) + scroll_x = level->width * 32 - screen->w; if(scroll_x < 0) scroll_x = 0; - else if(scroll_x > level->width * 32 - screen->w) - scroll_x = level->width * 32 - screen->w; } void Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- leveleditor.cpp 14 May 2004 16:02:40 -0000 1.117 +++ leveleditor.cpp 15 May 2004 09:59:02 -0000 1.118 @@ -1579,15 +1579,15 @@ } /* checking if pos_x and pos_y is within the limits... */ - if(pos_x < 0) - pos_x = 0; if(pos_x > (le_world->get_level()->width * 32) - screen->w) pos_x = (le_world->get_level()->width * 32) - screen->w; + if(pos_x < 0) + pos_x = 0; - if(pos_y < 0) - pos_y = 0; if(pos_y > (le_world->get_level()->height * 32) - screen->h) pos_y = (le_world->get_level()->height * 32) - screen->h; + if(pos_y < 0) + pos_y = 0; } |