From: Ricardo Cruz Date: Thu, 3 Jun 2004 16:30:35 +0000 (+0000) Subject: Fixed scrolling. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=32bcc311fc070b6deb5c254c49e105c6513c73fa;p=supertux.git Fixed scrolling. The GUI is full of problems, I guess the best solution is to rewrite button.* stuff. The level editor also needs a redesign. I will take care of this, can take awhile. SVN-Revision: 1402 --- diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 7d7d6ae86..cd7337e8f 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "leveleditor.h" @@ -82,6 +83,8 @@ LevelEditor::LevelEditor() le_show_grid = true; show_selections = true; + pos_x = pos_y = 0; + done = 0; le_frame = 0; /* support for frames in some tiles, like waves and bad guys */ le_level_changed = false; @@ -234,12 +237,14 @@ int LevelEditor::run(char* filename) /* making events results to be in order */ /* draw the level */ + context.set_translation(Vector(pos_x, pos_y)); drawlevel(context); } else fillrect(0, 0, screen->w, screen->h, 0, 0, 0); /* draw editor interface */ + context.set_translation(Vector(0, 0)); drawinterface(context); Menu* menu = Menu::current(); @@ -845,7 +850,7 @@ void LevelEditor::drawlevel(DrawingContext& context) if(le_current.IsTile()) { -le_level->get_sector("main")->solids->draw(context); +//le_level->get_sector("main")->solids->draw(context); /* Tile::draw(cursor_x-pos_x, cursor_y-pos_y,le_current.tile,128); if(!TileManager::instance()->get(le_current.tile)->images.empty()) @@ -860,7 +865,6 @@ le_level->get_sector("main")->solids->draw(context); /* clearscreen(current_level.bkgd_red, current_level.bkgd_green, current_level.bkgd_blue); */ - le_level->get_sector("main")->solids->draw(context); // FIXME: make tiles to be drawn semi-transparent when not selected @@ -1529,8 +1533,6 @@ void LevelEditor::checkevents() pos_y = (le_level->get_sector("main")->solids->get_height() * 32) - screen->h; if(pos_y < 0) pos_y = 0; - - le_level->get_sector("main")->camera->set_scrolling(pos_x, pos_y); } }