[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src screen_manager.cxx,1.10,1.11 screen_m
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src screen_manager.cxx,1.10,1.11 screen_manager.hxx,1.7,1.8 |
Date: |
17 Aug 2002 00:30:55 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv8691
Modified Files:
screen_manager.cxx screen_manager.hxx
Log Message:
- added fade in/out capabilities (still very experimental)
Index: screen_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screen_manager.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- screen_manager.cxx 16 Aug 2002 17:15:31 -0000 1.10
+++ screen_manager.cxx 17 Aug 2002 00:30:53 -0000 1.11
@@ -18,6 +18,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
+#include <ClanLib/Display/Display/display.h>
#include "globals.hxx"
#include "input/controller.hxx"
#include "delta_manager.hxx"
@@ -113,7 +114,7 @@
ScreenManager::push_screen (Screen* screen, bool delete_screen)
{
std::cout << "XXXXXXXX ScreenManager::push_screen" << std::endl;
-
+
if (!screens.empty())
{
std::cout << "ScreenManager::push_screen" << std::endl;
@@ -169,6 +170,36 @@
if (!screens.empty ())
{
screens.back ().first->on_startup ();
+ }
+}
+
+void
+ScreenManager::fade_over (Screen* old_screen, Screen* new_screen)
+{
+ DeltaManager delta_manager;
+ float passed_time = 0;
+
+ while (passed_time < 1.0f)
+ {
+ float time_delta = delta_manager.getset ();
+ passed_time += time_delta;
+
+ int border_x = int((CL_Display::get_width ()/2) * passed_time);
+ int border_y = int((CL_Display::get_height ()/2) * passed_time);
+
+ std::cout << "FadeOver: " << border_x << " " << border_y << std::endl;
+
+ new_screen->draw ();
+
+ CL_Display::push_clip_rect(CL_ClipRect (0 + border_x,
+ 0 + border_y,
+ CL_Display::get_width () -
border_x,
+ CL_Display::get_height () -
border_y));
+ old_screen->draw ();
+ CL_Display::pop_clip_rect ();
+
+ Display::flip_display ();
+ CL_System::keep_alive ();
}
}
Index: screen_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screen_manager.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- screen_manager.hxx 16 Aug 2002 13:03:35 -0000 1.7
+++ screen_manager.hxx 17 Aug 2002 00:30:53 -0000 1.8
@@ -65,6 +65,8 @@
/** Remove the current screen and fall back to the last one */
void real_pop_screen ();
+ /** FadeOver test*/
+ void fade_over (Screen* old_screen, Screen* new_screen);
public:
static ScreenManager* instance ();
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src screen_manager.cxx,1.10,1.11 screen_manager.hxx,1.7,1.8,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src playfield.cxx,1.15,1.16
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src story.cxx,1.4,1.5 story.hxx,1.4,1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src playfield.cxx,1.15,1.16
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src story.cxx,1.4,1.5 story.hxx,1.4,1.5
- Index(es):