pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.15,1.16 display_graphic


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.15,1.16 display_graphic_context.cxx,1.5,1.6 pingus_main.cxx,1.18,1.19 screen_manager.cxx,1.16,1.17 screen_manager.hxx,1.12,1.13
Date: 28 Sep 2002 22:24:26 -0000

Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv27825

Modified Files:
        blitter.cxx display_graphic_context.cxx pingus_main.cxx 
        screen_manager.cxx screen_manager.hxx 
Log Message:
- win32 fixes
- added fadeouts

Index: blitter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/blitter.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- blitter.cxx 14 Sep 2002 19:06:33 -0000      1.15
+++ blitter.cxx 28 Sep 2002 22:24:24 -0000      1.16
@@ -33,6 +33,8 @@
 #include <config.h>
 #include "my_gettext.hxx"
 
+#define COMPILE_WITH_MEMORY_HOLE 0
+
 void
 Blitter::put_surface(CL_Canvas* canvas, const CL_Surface& sur,
                     int x, int y)
@@ -164,9 +166,12 @@
        }
     }
 
-  // FIXME: Memory hole
-  //sprovider->unlock();
-  //provider->unlock();  
+#if COMPILE_WITH_MEMORY_HOLE
+#warning "FIXME: Blitter::put_surface_8bit(CL_Canvas* provider, 
CL_SurfaceProvider* sprovider, int x, int y) contains memory hole"
+#else 
+  sprovider->unlock();
+  provider->unlock();  
+#endif
 }
 
 void
@@ -217,9 +222,12 @@
       
     }
 
-  // FIXME: Memory hole
-  //provider->unlock();
-  //canvas->unlock();
+#if COMPILE_WITH_MEMORY_HOLE
+#warning "FIXME: Blitter::put_surface_32bit(CL_Canvas* canvas, 
CL_SurfaceProvider* provider, const int x_pos, const int y_pos) contains memory 
hole"
+#else
+  provider->unlock();
+  canvas->unlock();
+#endif
 }
 
 void
@@ -244,9 +252,13 @@
   //  assert(sprovider->get_depth() == 8);
   if (sprovider->get_depth() != 8)
     {
-      // FIXME: Memory hole
-      //sprovider->unlock ();
-      //provider->unlock ();
+      // FIXME: memory hole
+#if COMPILE_WITH_MEMORY_HOLE
+#warning "FIXME: Blitter::put_alpha_surface(CL_Canvas* provider, 
CL_SurfaceProvider* sprovider, int x, int y) contains memory hole"
+#else
+      sprovider->unlock ();
+      provider->unlock ();
+#endif
       PingusError::raise("Image has wrong color depth: " + 
to_string(sprovider->get_depth()));
     }
   //  assert(provider->get_pixel_format() == RGBA8888);
@@ -286,9 +298,12 @@
     }
   }
 
-  // FIXME: Memory hole
-  //sprovider->unlock();
-  //provider->unlock();  
+#if COMPILE_WITH_MEMORY_HOLE
+#warning "FIXME: Blitter::put_alpha_surface(CL_Canvas* provider, 
CL_SurfaceProvider* sprovider, int x, int y) contains memory hole"
+#else
+  sprovider->unlock();
+  provider->unlock();  
+#endif
 }
 
 CL_Canvas*
@@ -300,7 +315,7 @@
   canvas->lock();
   buffer = static_cast<unsigned char*>(canvas->get_data());
   memset(buffer, 0, sizeof(unsigned char) * canvas->get_pitch() * 
canvas->get_height());
-  // FIXME: Memory hole
+  // FIXME: memory hole
   //canvas->unlock();
 
   return canvas;
@@ -339,7 +354,7 @@
            tbuffer[ti + 3] = sbuffer[si + 2];
          }
          
-       // -FIXME: Memory hole
+       // -FIXME: memory hole
        prov->unlock();
        canvas->unlock();
       }
@@ -468,9 +483,12 @@
        }
     }
 
-  // FIXME: Memory hole
-  //canvas->unlock ();
-  //provider->unlock ();
+#if COMPILE_WITH_MEMORY_HOLE
+#warning "FIXME: Blitter::scale_surface_to_canvas (const CL_Surface& sur, int 
width, int height) contains memory leak"
+#else
+  canvas->unlock ();
+  provider->unlock ();
+#endif
 
   return canvas;
 }

Index: display_graphic_context.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/display_graphic_context.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- display_graphic_context.cxx 28 Sep 2002 11:52:21 -0000      1.5
+++ display_graphic_context.cxx 28 Sep 2002 22:24:24 -0000      1.6
@@ -20,6 +20,7 @@
 #include <iostream>
 #include <ClanLib/Display/Display/display.h>
 #include <ClanLib/Display/Font/font.h>
+#include <config.h>
 #include "math.hxx"
 #include "sprite.hxx"
 #include "display_graphic_context.hxx"

Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- pingus_main.cxx     24 Sep 2002 17:02:48 -0000      1.18
+++ pingus_main.cxx     28 Sep 2002 22:24:24 -0000      1.19
@@ -887,7 +887,7 @@
   //signal(SIGSEGV, signal_handler);
   //signal(SIGINT,  signal_handler);
 
-#ifdef WIN32
+#if 0 // used to be WIN32
   CL_ConsoleWindow cl_console(PACKAGE VERSION);
   cl_console.redirect_stdio();
 #endif

Index: screen_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screen_manager.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- screen_manager.cxx  14 Sep 2002 19:06:33 -0000      1.16
+++ screen_manager.cxx  28 Sep 2002 22:24:24 -0000      1.17
@@ -27,6 +27,7 @@
 #include "screen_manager.hxx"
 #include "path_manager.hxx"
 #include "input_debug_screen.hxx"
+#include "fade_out.hxx"
 
 ScreenManager* ScreenManager::instance_ = 0;
 
@@ -57,7 +58,6 @@
   // Main loop for the menu
   while (!screens.empty())
     {
-      Screen* current_screen = screens.back ().first;
       float time_delta = delta_manager.getset ();
       
       if (time_delta > 1.0)
@@ -76,16 +76,15 @@
       // Fill the delta with values
       GameDelta delta (time_delta, input_controller.get_events ());
 
-      last_screen = current_screen;
+      last_screen = get_current_screen();
 
       // Most likly the screen will get changed in this update call
-      current_screen->update (delta);    
+      get_current_screen()->update (delta);    
 
+      // Last screen has poped, so we are going to end here
       if (screens.empty ())
        continue;
 
-      current_screen = screens.back ().first;
-
       if (cached_action == pop)
        {
          real_pop_screen ();
@@ -97,15 +96,16 @@
          cached_action = none;
        }
       
-      // skip draw if the screen changed
-      if (last_screen == current_screen)
+      // skip draw if the screen changed to avoid glitches
+      if (last_screen == get_current_screen())
        {
-         current_screen->draw (display_gc);
+         get_current_screen()->draw (display_gc);
          Display::flip_display ();
        }
       else
        {
-         //fade_over (last_screen, current_screen);
+         std::cout << "ScreenManager: fading screens" << std::endl;
+         fade_over (last_screen, get_current_screen());
        }
 
       // Stupid hack to make this thing take less CPU
@@ -122,6 +122,12 @@
     } 
 }
 
+Screen*
+ScreenManager::get_current_screen()
+{
+  return screens.back ().first;
+}
+
 ScreenManager*
 ScreenManager::instance ()
 {
@@ -197,6 +203,9 @@
 void
 ScreenManager::fade_over (Screen* old_screen, Screen* new_screen)
 {
+  FadeOut::fade_to_black();
+
+#if 0
   DeltaManager delta_manager;
   float passed_time = 0;
 
@@ -229,6 +238,7 @@
       Display::flip_display ();
       CL_System::keep_alive ();
     }
+#endif 
 }
 
 /* EOF */

Index: screen_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screen_manager.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- screen_manager.hxx  27 Sep 2002 11:26:44 -0000      1.12
+++ screen_manager.hxx  28 Sep 2002 22:24:24 -0000      1.13
@@ -76,6 +76,10 @@
 
   /** FadeOver test*/
   void fade_over (Screen* old_screen, Screen* new_screen);
+
+  /** @return a pointer to the current Screen */
+  Screen* get_current_screen();
+
 public:  
   static ScreenManager* instance ();
   





reply via email to

[Prev in Thread] Current Thread [Next in Thread]