From 48a8fed65234a322853b48d6c76ece4a082f5264 Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Sun, 24 Oct 2004 23:29:06 +0000 Subject: [PATCH] committed patches from Richard Smith SVN-Revision: 2058 --- src/title.cpp | 32 ++++++++++++++++---------------- src/worldmap.cpp | 3 +++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/title.cpp b/src/title.cpp index 224a34795..d156c0d1d 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -80,6 +80,20 @@ static std::set worldmap_list; static FrameRate frame_rate(100); +/* If the demo was stopped - because game started, level + editor was excuted, etc - call this when you get back + to the title code. + */ +void resume_demo() +{ + // FIXME: shouldn't be needed if GameSession + // didn't relay on global variables + titlesession->get_current_sector()->activate(); + titlesession->set_current(); + + frame_rate.update(); +} + void update_load_save_game_menu(Menu* pmenu) { for(int i = 2; i < 7; ++i) @@ -181,6 +195,7 @@ void check_levels_contrib_menu() worldmap.display(); // run the map Menu::set_current(main_menu); + resume_demo(); } else if (index < (int)contrib_subsets.size() + first_level_index) { @@ -239,26 +254,11 @@ void check_contrib_subset_menu() session.run(); player_status.reset(); Menu::set_current(main_menu); - titlesession->get_current_sector()->activate(); - titlesession->set_current(); + resume_demo(); } } } -/* If the demo was stopped - because game started, level - editor was excuted, etc - call this when you get back - to the title code. - */ -void resume_demo() -{ - // FIXME: shouldn't be needed if GameSession - // didn't relay on global variables - titlesession->get_current_sector()->activate(); - titlesession->set_current(); - - frame_rate.update(); -} - void draw_demo(double frame_ratio) { Sector* world = titlesession->get_current_sector(); diff --git a/src/worldmap.cpp b/src/worldmap.cpp index 22372c117..370109952 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -631,6 +631,9 @@ WorldMap::load_map() } lisp_free(root_obj); + + delete tux; + tux = new Tux(this); } void WorldMap::get_level_title(Level& level) -- 2.11.0