From: Tobias Gläßer Date: Wed, 5 May 2004 20:05:09 +0000 (+0000) Subject: Fixed Objects drag+drop bug. LevelEditor cursor tuning. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ee097c40be45f8f126bcd5cb146fa1bfd70060d1;p=supertux.git Fixed Objects drag+drop bug. LevelEditor cursor tuning. SVN-Revision: 999 --- diff --git a/src/button.cpp b/src/button.cpp index b58e63ef4..91ce1de07 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -86,7 +86,7 @@ void Button::draw() if(game_object != NULL) { - game_object->draw_on_screen(); + game_object->draw_on_screen(rect.x,rect.y); } if(show_info) diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index c413505bb..e864c8404 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -560,6 +560,8 @@ void le_init_menus() int le_init() { + + level_subsets = dsubdirs("/levels", "info"); le_level_subset = new LevelSubset; @@ -798,7 +800,10 @@ void le_drawinterface() } if(le_selection_mode == CURSOR) - le_selection->draw( cursor_x - scroll_x, cursor_y); + if(le_current.IsTile()) + le_selection->draw( cursor_x - pos_x, cursor_y); + else + le_selection->draw( cursor_x, cursor_y); else if(le_selection_mode == SQUARE) { int w, h; @@ -825,11 +830,9 @@ void le_drawinterface() if(le_current.IsObject()) { le_current.obj->draw_on_screen(19 * 32, 14 * 32); + le_current.obj->draw_on_screen(cursor_x,cursor_y); } - //if(le_current.IsObject()) - //printf(""); - if(le_current_level != NULL) { le_save_level_bt->draw(); @@ -892,9 +895,9 @@ void le_drawlevel() if(le_current.IsTile()) { - Tile::draw(cursor_x, cursor_y,le_current.tile,128); + Tile::draw(cursor_x-pos_x, cursor_y,le_current.tile,128); if(!TileManager::instance()->get(le_current.tile)->images.empty()) - fillrect(cursor_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); + fillrect(cursor_x-pos_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); } if(le_current.IsObject()) { @@ -1282,8 +1285,6 @@ void le_checkevents() { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Tile(pbutton->get_tag()); } } @@ -1294,8 +1295,6 @@ void le_checkevents() { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Object(pbutton->get_game_object()); } }