[Super-tux-commit] supertux/src leveleditor.cpp,1.118,1.119
Brought to you by:
wkendrick
From: Ryan F. <sik...@us...> - 2004-05-15 11:01:00
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22128 Modified Files: leveleditor.cpp Log Message: - fixed level editor crash - some other resolution fixes in level editor - fixed level editor not scrolling all the way to end of level (last two columns were hiding behind the panel). This is in 0.1.1, too. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- leveleditor.cpp 15 May 2004 09:59:02 -0000 1.118 +++ leveleditor.cpp 15 May 2004 11:00:32 -0000 1.119 @@ -812,10 +812,10 @@ /* draw a grid (if selected) */ if(le_show_grid) { - for(x = 0; x < 19; x++) + for(x = 0; x < VISIBLE_TILES_X; x++) fillrect(x*32 - ((int)pos_x % 32), 0, 1, screen->h, 225, 225, 225,255); - for(y = 0; y < 16; y++) - fillrect(0, y*32 - ((int)pos_y % 32), screen->w - 32, 1, 225, 225, 225,255); + for(y = 0; y < VISIBLE_TILES_Y; y++) + fillrect(0, y*32 - ((int)pos_y % 32), screen->w, 1, 225, 225, 225,255); } } @@ -849,13 +849,13 @@ if(le_current.IsTile()) { - Tile::draw(19 * 32, 14 * 32, le_current.tile); + Tile::draw(screen->w - 32, screen->h - 32, le_current.tile); if(TileManager::instance()->get(le_current.tile)->editor_images.size() > 0) - TileManager::instance()->get(le_current.tile)->editor_images[0]->draw( 19 * 32, 14 * 32); + TileManager::instance()->get(le_current.tile)->editor_images[0]->draw( screen->w - 32, screen->h - 32); } if(le_current.IsObject() && MouseCursor::current() != mouse_select_object) { - le_current.obj->draw_on_screen(19 * 32, 14 * 32); + le_current.obj->draw_on_screen(screen->w - 32, screen->h - 32); le_current.obj->draw_on_screen(cursor_x,cursor_y); } @@ -953,7 +953,7 @@ /* clearscreen(current_level.bkgd_red, current_level.bkgd_green, current_level.bkgd_blue); */ for (y = 0; y < VISIBLE_TILES_Y && y < (unsigned)le_world->get_level()->height; ++y) - for (x = 0; x < (unsigned)VISIBLE_TILES_X-80; ++x) + for (x = 0; x < (unsigned)VISIBLE_TILES_X - 2; ++x) { if(active_tm == TM_BG) @@ -1579,8 +1579,8 @@ } /* checking if pos_x and pos_y is within the limits... */ - if(pos_x > (le_world->get_level()->width * 32) - screen->w) - pos_x = (le_world->get_level()->width * 32) - screen->w; + if(pos_x > (le_world->get_level()->width * 32 + 32*2) - screen->w) + pos_x = (le_world->get_level()->width * 32 + 32*2) - screen->w; if(pos_x < 0) pos_x = 0; |