[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3626 - trunk/pingus/src
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3626 - trunk/pingus/src |
Date: |
Wed, 2 Jul 2008 22:13:12 +0200 |
Author: grumbel
Date: 2008-07-02 22:13:11 +0200 (Wed, 02 Jul 2008)
New Revision: 3626
Modified:
trunk/pingus/src/exit_menu.cpp
trunk/pingus/src/exit_menu.hpp
trunk/pingus/src/pingus_menu.cpp
trunk/pingus/src/pingus_menu.hpp
trunk/pingus/src/pingus_menu_manager.cpp
trunk/pingus/src/pingus_sub_menu.hpp
Log:
Some old junk removed
Modified: trunk/pingus/src/exit_menu.cpp
===================================================================
--- trunk/pingus/src/exit_menu.cpp 2008-07-02 19:35:47 UTC (rev 3625)
+++ trunk/pingus/src/exit_menu.cpp 2008-07-02 20:13:11 UTC (rev 3626)
@@ -108,6 +108,8 @@
{
gui_manager->add(new ExitMenuYesButton(manager), true);
gui_manager->add(new ExitMenuNoButton(manager), true);
+
+ sur = Resource::load_sprite("core/menu/exit_menu");
}
ExitMenu::~ExitMenu()
@@ -126,11 +128,4 @@
return true;
}
-void
-ExitMenu::preload()
-{
- sur = Resource::load_sprite("core/menu/exit_menu");
-}
-
-
/* EOF */
Modified: trunk/pingus/src/exit_menu.hpp
===================================================================
--- trunk/pingus/src/exit_menu.hpp 2008-07-02 19:35:47 UTC (rev 3625)
+++ trunk/pingus/src/exit_menu.hpp 2008-07-02 20:13:11 UTC (rev 3626)
@@ -35,7 +35,6 @@
~ExitMenu ();
bool draw (DrawingContext& gc);
- void preload ();
private:
ExitMenu (const ExitMenu&);
Modified: trunk/pingus/src/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus_menu.cpp 2008-07-02 19:35:47 UTC (rev 3625)
+++ trunk/pingus/src/pingus_menu.cpp 2008-07-02 20:13:11 UTC (rev 3626)
@@ -66,53 +66,15 @@
_("Levelsets"),
_("..:: Play User Built levels ::.."));
-#ifdef NEW_MENU
- story_button = new MenuButton(this, Vector2i(Display::get_width() * 400 /
default_screen_width,
- Display::get_height() * 340 /
default_screen_height),
- _("Story"),
- _("..:: Start the story ::.."));
-
- multiplayer_button = new MenuButton(this, Vector2i(Display::get_width() *
150 / default_screen_width,
- Display::get_height() *
340 / default_screen_height),
-
Resource::load_sprite("core/menu/multi_on"),
- _("Multiplayer"),
- _("..:: Multiplayer Match ::.."));
-#endif
-
- help = _("..:: Ctrl-g: mouse grab :: F10: fps counter :: F11:
fullscreen :: F12: screenshot ::..");
-}
-
-void
-PingusMenu::setup_main_menu()
-{
-#ifdef NEW_MENU
- gui_manager->remove(contrib_button);
- gui_manager->remove(story_button);
- gui_manager->remove(multiplayer_button);
- gui_manager->remove(editor_button);
-#endif
-
- gui_manager->add(quit_button, false);
+ gui_manager->add(quit_button, false);
gui_manager->add(contrib_button, false);
- gui_manager->add(start_button, false);
- gui_manager->add(editor_button, false);
-}
+ gui_manager->add(start_button, false);
+ gui_manager->add(editor_button, false);
-#ifdef NEW_MENU
-void
-PingusMenu::setup_game_menu()
-{
- gui_manager->remove(start_button);
+ logo = Resource::load_sprite("core/misc/logo");
- gui_manager->add(contrib_button, false);
- gui_manager->add(story_button, false);
- gui_manager->add(editor_button, false);
- // FIXME: Re-enable this next line once multiplayer functionality
- // is actually available.
-
- //gui_manager->add(multiplayer_button, false);
+ help = _("..:: Ctrl-g: mouse grab :: F10: fps counter :: F11:
fullscreen :: F12: screenshot ::..");
}
-#endif
void
PingusMenu::show_credits()
@@ -120,52 +82,12 @@
ScreenManager::instance()->push_screen(new Credits(), true);
}
-void
-PingusMenu::setup_contrib_menu()
-{
-#if 0
- if (filedialog)
- delete filedialog;
- filedialog = new FileDialog(this, ".pingus",
- path_manager.complete("levels/"), true);
- manager->push_menu (filedialog);
-#endif
-}
-
-void
-PingusMenu::setup_worldmap_menu()
-{
-#if 0
- if (filedialog)
- delete filedialog;
- filedialog = new FileDialog(this, ".worldmap",
- path_manager.complete("worldmaps/"), true);
- manager->push_menu (filedialog);
-#endif
-}
-
-void
-PingusMenu::preload ()
-{
- if (!is_init)
- {
- is_init = true;
-
- background = Resource::load_sprite("core/misc/logo");
- setup_main_menu();
- }
-}
-
PingusMenu::~PingusMenu()
{
delete start_button;
delete quit_button;
delete editor_button;
delete contrib_button;
-#ifdef NEW_MENU
- delete story_button;
- delete multiplayer_button;
-#endif
}
void
@@ -213,7 +135,7 @@
void
PingusMenu::on_escape_press ()
{
- get_manager ()->show_exit_menu ();
+ get_manager()->show_exit_menu ();
}
void
@@ -221,14 +143,14 @@
{
if (gc.get_height() == 480)
{
- gc.draw(background,
- Vector2i((gc.get_width()/2) - (background.get_width()/2),
+ gc.draw(logo,
+ Vector2i((gc.get_width()/2) - (logo.get_width()/2),
20));
}
else
{
- gc.draw(background,
- Vector2i((gc.get_width()/2) - (background.get_width()/2),
+ gc.draw(logo,
+ Vector2i((gc.get_width()/2) - (logo.get_width()/2),
Display::get_height()/10));
}
@@ -245,7 +167,7 @@
Display::get_height() - Fonts::pingus_small.get_height(),
help);
- if (0)
+ if (0) // display hint
{
gc.print_center(Fonts::pingus_small, Display::get_width() / 2,
Display::get_height() - Fonts::pingus_small.get_height(),
@@ -276,11 +198,7 @@
{
if (button == start_button)
{
-#ifdef NEW_MENU
- setup_game_menu();
-#else
do_start("worldmaps/tutorial.worldmap");
-#endif
}
else if (button == quit_button)
{
@@ -294,16 +212,6 @@
{
ScreenManager::instance()->push_screen(new LevelMenu(), true);
}
-#ifdef NEW_MENU
- else if (button == story_button)
- {
- setup_worldmap_menu();
- }
- else if (button == multiplayer_button)
- {
- setup_main_menu();
- }
-#endif
}
void
Modified: trunk/pingus/src/pingus_menu.hpp
===================================================================
--- trunk/pingus/src/pingus_menu.hpp 2008-07-02 19:35:47 UTC (rev 3625)
+++ trunk/pingus/src/pingus_menu.hpp 2008-07-02 20:13:11 UTC (rev 3626)
@@ -41,38 +41,22 @@
std::string hint;
std::string help;
float text_scroll_offset;
+
private:
- Sprite background;
+ Sprite logo;
LayerManager layer_manager;
MenuButton* start_button;
MenuButton* quit_button;
MenuButton* editor_button;
MenuButton* contrib_button;
-
-#ifdef NEW_MENU
- MenuButton* story_button;
- MenuButton* multiplayer_button;
-#endif
void on_resize (int w, int h);
- // These functions setup the different menus
- void setup_main_menu();
-#ifdef NEW_MENU
- void setup_game_menu();
-#endif
void show_credits();
- /** Show the levels folder */
- void setup_contrib_menu();
- /** Show the worldmap folder */
- void setup_worldmap_menu();
- /** Quit the game */
void do_quit();
- /** Start the story/worldmap mode */
void do_start(const std::string &filename);
- /** Start the level editor */
void do_edit();
/** Use this to load the level or worldmap */
@@ -89,7 +73,6 @@
void set_hint(const std::string& str);
/// Load all images and other stuff for the menu
- void preload ();
void do_contrib(const std::string&);
void on_escape_press ();
Modified: trunk/pingus/src/pingus_menu_manager.cpp
===================================================================
--- trunk/pingus/src/pingus_menu_manager.cpp 2008-07-02 19:35:47 UTC (rev
3625)
+++ trunk/pingus/src/pingus_menu_manager.cpp 2008-07-02 20:13:11 UTC (rev
3626)
@@ -104,7 +104,6 @@
void
PingusMenuManager::push_menu (PingusSubMenu * menu)
{
- menu->preload ();
menu_stack.push_back (menu);
}
Modified: trunk/pingus/src/pingus_sub_menu.hpp
===================================================================
--- trunk/pingus/src/pingus_sub_menu.hpp 2008-07-02 19:35:47 UTC (rev
3625)
+++ trunk/pingus/src/pingus_sub_menu.hpp 2008-07-02 20:13:11 UTC (rev
3626)
@@ -34,9 +34,6 @@
PingusSubMenu (PingusMenuManager* m);
virtual ~PingusSubMenu ();
- /// load all the data which is needed for the menu
- virtual void preload () =0;
-
/// Return a handle to the parent menu manager
PingusMenuManager* get_manager () { return manager; }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3626 - trunk/pingus/src,
grumbel at BerliOS <=