[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/gui screen_manager.cxx,1.4,1.5 screen
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/gui screen_manager.cxx,1.4,1.5 screen_manager.hxx,1.2,1.3 surface_button.hxx,1.6,1.7 |
Date: |
3 Apr 2003 17:03:26 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/gui
In directory dark:/tmp/cvs-serv30816/gui
Modified Files:
screen_manager.cxx screen_manager.hxx surface_button.hxx
Log Message:
- fixed close button
- added some more soundeffects to the GUI
- some more stuff for the result screen
Index: screen_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- screen_manager.cxx 28 Mar 2003 12:06:32 -0000 1.4
+++ screen_manager.cxx 3 Apr 2003 17:03:24 -0000 1.5
@@ -32,7 +32,7 @@
ScreenManager::ScreenManager ()
: display_gc (0, 0, CL_Display::get_width (), CL_Display::get_height (), 0,
0)
{
- cached_action = none;
+ cached_action = CA_NONE;
}
ScreenManager::~ScreenManager ()
@@ -77,24 +77,25 @@
if (screens.empty ())
continue;
- if (cached_action == pop)
- {
- real_pop_screen ();
- cached_action = none;
- }
- else if (cached_action == replace)
- {
- real_replace_screen (replace_screen_arg);
- cached_action = none;
- }
- else
+ switch (cached_action)
{
- cached_action = none;
+ case CA_POP:
+ real_pop_screen ();
+ break;
+ case CA_REPLACE:
+ real_replace_screen (replace_screen_arg);
+ break;
+ case CA_CLEAR:
+ real_clear();
+ break;
+ default:
+ break;
}
+ cached_action = CA_NONE;
// FIXME: is there a more gentel way to do that instead of spreading the
checks all around here?
// Last screen has poped, so we are going to end here
- if (screens.empty ())
+ if (screens.empty())
continue;
// skip draw if the screen changed to avoid glitches
@@ -145,15 +146,15 @@
void
ScreenManager::pop_screen ()
{
- assert (cached_action == none);
- cached_action = pop;
+ assert (cached_action == CA_NONE);
+ cached_action = CA_POP;
}
void
ScreenManager::replace_screen (Screen* screen, bool delete_screen)
{
- assert (cached_action == none);
- cached_action = replace;
+ assert (cached_action == CA_NONE);
+ cached_action = CA_REPLACE;
replace_screen_arg = ScreenPtr(screen, delete_screen);
}
@@ -176,6 +177,18 @@
{
screens.back ()->on_startup ();
}
+}
+
+void
+ScreenManager::clear()
+{
+ cached_action = CA_CLEAR;
+}
+
+void
+ScreenManager::real_clear()
+{
+ screens.clear();
}
void
Index: screen_manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- screen_manager.hxx 22 Mar 2003 23:28:51 -0000 1.2
+++ screen_manager.hxx 3 Apr 2003 17:03:24 -0000 1.3
@@ -43,7 +43,7 @@
/** the screen that was used in the last update() */
ScreenPtr last_screen;
- enum { none, pop, replace } cached_action;
+ enum { CA_NONE, CA_POP, CA_REPLACE, CA_CLEAR } cached_action;
ScreenPtr replace_screen_arg;
protected:
@@ -67,7 +67,11 @@
/** Fade the screen out, this call blocks till the screen is black */
void fade_out();
+ /** Remove all screens from the stack */
+ void clear();
private:
+ void real_clear();
+
/** Replace the current screen */
void real_replace_screen (const ScreenPtr&);
Index: surface_button.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/surface_button.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- surface_button.hxx 1 Apr 2003 13:21:20 -0000 1.6
+++ surface_button.hxx 3 Apr 2003 17:03:24 -0000 1.7
@@ -54,8 +54,8 @@
void on_primary_button_release (int x, int y);
void on_primary_button_click (int x, int y);
- void on_pointer_enter ();
- void on_pointer_leave ();
+ virtual void on_pointer_enter ();
+ virtual void on_pointer_leave ();
virtual void on_click() =0;
private:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/gui screen_manager.cxx,1.4,1.5 screen_manager.hxx,1.2,1.3 surface_button.hxx,1.6,1.7,
grumbel <=