[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2826 - in branches/pingus_sdl: . src/gui src/input
From: |
jsalmon3 |
Subject: |
[Pingus-CVS] r2826 - in branches/pingus_sdl: . src/gui src/input |
Date: |
Wed, 8 Aug 2007 03:05:12 +0200 |
Author: jsalmon3
Date: 2007-08-08 03:05:03 +0200 (Wed, 08 Aug 2007)
New Revision: 2826
Modified:
branches/pingus_sdl/TODO
branches/pingus_sdl/src/gui/screen_manager.cpp
branches/pingus_sdl/src/gui/screen_manager.hpp
branches/pingus_sdl/src/input/controller.cpp
Log:
Clicking the window's X button exits the whole game (patch from Plouj)
Modified: branches/pingus_sdl/TODO
===================================================================
--- branches/pingus_sdl/TODO 2007-08-07 02:28:52 UTC (rev 2825)
+++ branches/pingus_sdl/TODO 2007-08-08 01:05:03 UTC (rev 2826)
@@ -25,6 +25,8 @@
- UTF8 support
+- split screen multiplayer
+
Roadmap for Pingus 0.7.0
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -34,8 +36,6 @@
- seperate gfx/colmap surfaces aren't used
-- split screen multiplayer
-
- remove unneeded/outdated fonts
- Latin1 clean (also Latin-2 and Latin-9, see:
@@ -50,8 +50,6 @@
- there is also a missing float->int cast somewhere, exits and maybe
other objects 'wooble' by one pixel while scrolling
-- clicking the x-button of the window currently acts as escape and exits a
level instead of the whole game
-
Older Stuff:
~~~~~~~~~~~~
Modified: branches/pingus_sdl/src/gui/screen_manager.cpp
===================================================================
--- branches/pingus_sdl/src/gui/screen_manager.cpp 2007-08-07 02:28:52 UTC
(rev 2825)
+++ branches/pingus_sdl/src/gui/screen_manager.cpp 2007-08-08 01:05:03 UTC
(rev 2826)
@@ -101,10 +101,13 @@
switch (cached_action)
{
case CA_POP:
- real_pop_screen ();
+ real_pop_screen();
break;
+ case CA_POP_ALL:
+ real_pop_all_screens();
+ break;
case CA_REPLACE:
- real_replace_screen (replace_screen_arg);
+ real_replace_screen(replace_screen_arg);
break;
case CA_CLEAR:
real_clear();
@@ -180,6 +183,13 @@
}
void
+ScreenManager::pop_all_screens()
+{
+ assert(cached_action == CA_NONE);
+ cached_action = CA_POP_ALL;
+}
+
+void
ScreenManager::replace_screen (Screen* screen, bool delete_screen)
{
assert (cached_action == CA_NONE);
@@ -211,6 +221,17 @@
}
void
+ScreenManager::real_pop_all_screens()
+{
+ cached_action = CA_NONE;
+ ScreenPtr back = screens.back();
+ screens.pop_back();
+ back->on_shutdown();
+
+ screens.clear();
+}
+
+void
ScreenManager::clear()
{
cached_action = CA_CLEAR;
Modified: branches/pingus_sdl/src/gui/screen_manager.hpp
===================================================================
--- branches/pingus_sdl/src/gui/screen_manager.hpp 2007-08-07 02:28:52 UTC
(rev 2825)
+++ branches/pingus_sdl/src/gui/screen_manager.hpp 2007-08-08 01:05:03 UTC
(rev 2826)
@@ -45,7 +45,7 @@
/** the screen that was used in the last update() */
ScreenPtr last_screen;
- enum { CA_NONE, CA_POP, CA_REPLACE, CA_CLEAR } cached_action;
+ enum { CA_NONE, CA_POP, CA_POP_ALL, CA_REPLACE, CA_CLEAR } cached_action;
ScreenPtr replace_screen_arg;
protected:
@@ -66,6 +66,9 @@
/** Remove the current screen and fall back to the last one */
void pop_screen ();
+ /** Remove all screens */
+ void pop_all_screens();
+
/** Remove all screens from the stack */
void clear();
private:
@@ -77,6 +80,9 @@
/** Remove the current screen and fall back to the last one */
void real_pop_screen ();
+ /** Remove all screens */
+ void real_pop_all_screens();
+
/** FadeOver test*/
void fade_over (ScreenPtr& old_screen, ScreenPtr& new_screen);
Modified: branches/pingus_sdl/src/input/controller.cpp
===================================================================
--- branches/pingus_sdl/src/input/controller.cpp 2007-08-07 02:28:52 UTC
(rev 2825)
+++ branches/pingus_sdl/src/input/controller.cpp 2007-08-08 01:05:03 UTC
(rev 2826)
@@ -234,7 +234,7 @@
switch(event.type)
{
case SDL_QUIT:
- ScreenManager::instance()->pop_screen();
+ ScreenManager::instance()->pop_all_screens();
break;
case SDL_MOUSEMOTION:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2826 - in branches/pingus_sdl: . src/gui src/input,
jsalmon3 <=