X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftitle.hpp;h=39d0abf089960d612df005a1e42d2520447ba10f;hb=605c7560d07e785a9a86c5f0eedb270e6a78f7bb;hp=ce841b1441013de6ae45edbafc0af9a6aa5d4912;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/title.hpp b/src/title.hpp index ce841b144..39d0abf08 100644 --- a/src/title.hpp +++ b/src/title.hpp @@ -1,8 +1,8 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2000 Bill Kendrick // Copyright (C) 2004 Tobias Glaesser +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -13,7 +13,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -21,16 +21,49 @@ #ifndef SUPERTUX_TITLE_H #define SUPERTUX_TITLE_H -enum MainMenuIDs { - MNID_STARTGAME, - MNID_LEVELS_CONTRIB, - MNID_OPTIONMENU, - MNID_LEVELEDITOR, - MNID_CREDITS, - MNID_QUITMAINMENU - }; - -void title(); +#include +#include +#include "screen.hpp" +#include "game_session.hpp" + +class Menu; +class World; +class CodeController; + +class TitleScreen : public Screen +{ +public: + TitleScreen(); + virtual ~TitleScreen(); + + virtual void setup(); + virtual void leave(); + + virtual void draw(DrawingContext& context); + + virtual void update(float elapsed_time); + +private: + std::string get_slotinfo(int slot); + std::string get_level_name(const std::string& levelfile); + bool process_load_game_menu(); + void make_tux_jump(); + void update_load_game_menu(); + void generate_contrib_menu(); + void check_levels_contrib_menu(); + void check_contrib_world_menu(); + void free_contrib_menu(); + + std::auto_ptr main_menu; + std::auto_ptr load_game_menu; + std::auto_ptr contrib_menu; + std::auto_ptr contrib_world_menu; + std::auto_ptr main_world; + std::vector contrib_worlds; + World* current_world; -#endif //SUPERTUX_TITLE_H + std::auto_ptr controller; + std::auto_ptr titlesession; +}; +#endif