pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/gui Makefile.am, 1.5, 1.6 display_gra


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/gui Makefile.am, 1.5, 1.6 display_graphic_context.cxx, 1.5, 1.6 display_graphic_context.hxx, 1.4, 1.5 graphic_context.hxx, 1.4, 1.5 screen_manager.cxx, 1.9, 1.10 screen_manager.hxx, 1.4, 1.5
Date: 16 Aug 2003 20:51:30 -0000

Update of /var/lib/cvs/Games/Pingus/src/gui
In directory dark:/tmp/cvs-serv15910/gui

Modified Files:
        Makefile.am display_graphic_context.cxx 
        display_graphic_context.hxx graphic_context.hxx 
        screen_manager.cxx screen_manager.hxx 
Log Message:
- added level preview render code

Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.am 19 Feb 2003 17:17:00 -0000      1.5
+++ Makefile.am 16 Aug 2003 20:51:28 -0000      1.6
@@ -18,6 +18,8 @@
 noinst_LIBRARIES = libpingus_gui.a
 
 libpingus_gui_a_SOURCES = \
+        buffer_graphic_context.hxx \
+        buffer_graphic_context.cxx \
        cursor.cxx \
        cursor.hxx \
        display.cxx \
@@ -41,6 +43,7 @@
        screen_ptr.hxx \
         component.hxx \
         graphic_context.hxx \
+        graphic_context.cxx \
         surface_button.cxx \
         surface_button.hxx
 

Index: display_graphic_context.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display_graphic_context.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- display_graphic_context.cxx 19 Apr 2003 10:23:18 -0000      1.5
+++ display_graphic_context.cxx 16 Aug 2003 20:51:28 -0000      1.6
@@ -158,44 +158,6 @@
 }
 
 void
-DisplayGraphicContext::draw (Sprite& sprite, const Vector& pos)
-{
-  sprite.put_screen(pos + offset + center);
-}
-
-void
-DisplayGraphicContext::draw (Sprite& sprite, const Vector& pos, int frame)
-{
-  CL_Surface sur (sprite.get_surface ());
-  draw (sur,
-       w2s_x(pos.x + sprite.get_x_align ()),
-       w2s_y(pos.y + sprite.get_y_align ()),
-       frame);
-}
-
-void
-DisplayGraphicContext::draw (CL_Surface& sur, const Vector& pos)
-{
-  if (offset.z == 1.0)
-    {
-      sur.put_screen (w2s_x(pos.x), w2s_y(pos.y));
-    }
-  else
-    {
-      sur.put_screen (w2s_x(pos.x), w2s_y(pos.y),
-                     offset.z, offset.z);
-    }
-  //CL_Display::draw_line (x1, y1, x2, y2, 1.0, 1.0, 0.0);
-  //CL_Display::draw_line (x1, y2, x2, y1, 1.0, 1.0, 0.0);
-}
-
-void
-DisplayGraphicContext::draw (CL_Surface& sur, const Vector& pos, int frame)
-{
-  draw (sur, int(pos.x), int(pos.y), frame);
-}
-
-void
 DisplayGraphicContext::draw (CL_Surface& sur, int x_pos, int y_pos)
 {
   if (offset.z == 1.0)

Index: display_graphic_context.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display_graphic_context.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- display_graphic_context.hxx 19 Apr 2003 10:23:18 -0000      1.4
+++ display_graphic_context.hxx 16 Aug 2003 20:51:28 -0000      1.5
@@ -90,11 +90,6 @@
 
   void clear (float r, float g, float b);
 
-  void draw (Sprite& sprite, const Vector& pos);
-  void draw (Sprite& sprite, const Vector& pos, int frame);
-  void draw (CL_Surface& sur, const Vector& pos);
-  void draw (CL_Surface& sur, const Vector& pos, int frame);
-
   void draw (CL_Surface& sur, int x_pos, int y_pos);
   void draw (CL_Surface& sur, int x_pos, int y_pos, int frame);
 

Index: graphic_context.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/graphic_context.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- graphic_context.hxx 19 Apr 2003 10:23:18 -0000      1.4
+++ graphic_context.hxx 16 Aug 2003 20:51:28 -0000      1.5
@@ -65,10 +65,11 @@
 
   virtual void clear (float r, float g, float b) =0;
 
-  virtual void draw (Sprite& sprite, const Vector& pos) =0;
-  virtual void draw (Sprite& sprite, const Vector& pos, int frame) =0;
-  virtual void draw (CL_Surface& sur, const Vector& pos) =0;
-  virtual void draw (CL_Surface& sur, const Vector& pos, int frame) =0;
+  virtual void draw (Sprite& sprite, const Vector& pos);
+  virtual void draw (Sprite& sprite, const Vector& pos, int frame);
+
+  virtual void draw (CL_Surface& sur, const Vector& pos);
+  virtual void draw (CL_Surface& sur, const Vector& pos, int frame);
 
   virtual void draw (CL_Surface& sur, int x_pos, int y_pos) =0;
   virtual void draw (CL_Surface& sur, int x_pos, int y_pos, int frame) =0;

Index: screen_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- screen_manager.cxx  19 Apr 2003 10:23:18 -0000      1.9
+++ screen_manager.cxx  16 Aug 2003 20:51:28 -0000      1.10
@@ -24,6 +24,8 @@
 #include "../globals.hxx"
 #include "cursor.hxx"
 #include "display.hxx"
+#include "display_graphic_context.hxx"
+#include "buffer_graphic_context.hxx"
 #include "screen_manager.hxx"
 #include "../fade_out.hxx"
 #include "../path_manager.hxx"
@@ -32,8 +34,12 @@
 ScreenManager* ScreenManager::instance_ = 0;
 
 ScreenManager::ScreenManager ()
-  : display_gc (0, 0, CL_Display::get_width (), CL_Display::get_height (), 0, 
0)
 {
+  if (render_preview)
+    display_gc = new BufferGraphicContext(800, 600);
+  else
+    display_gc = new DisplayGraphicContext(0, 0, CL_Display::get_width (), 
CL_Display::get_height (), 0, 0);
+
   cached_action = CA_NONE;
 }
 
@@ -124,7 +130,7 @@
       // skip draw if the screen changed to avoid glitches
       if (last_screen == get_current_screen())
        {
-         if (get_current_screen()->draw (display_gc))
+         if (get_current_screen()->draw (*display_gc))
            Display::flip_display ();
        }
       else
@@ -249,12 +255,12 @@
       int border_x = int((CL_Display::get_width ()/2) * (1.0f - progress));
       int border_y = int((CL_Display::get_height ()/2) * (1.0f - progress));
 
-      old_screen->draw (display_gc);
+      old_screen->draw(*display_gc);
       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));
-      new_screen->draw (display_gc);
+      new_screen->draw(*display_gc);
 
       //GameDelta delta (time_delta, CL_System::get_time(), events);
       // FIXME: Animation looks nifty but doesn't work all that good

Index: screen_manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- screen_manager.hxx  19 Apr 2003 10:23:18 -0000      1.4
+++ screen_manager.hxx  16 Aug 2003 20:51:28 -0000      1.5
@@ -24,8 +24,8 @@
 #include <vector>
 
 #include "screen_ptr.hxx"
-#include "display_graphic_context.hxx"
 
+class GraphicContext;
 class Screen;
 
 class ScreenManager
@@ -33,7 +33,7 @@
 private:
   static ScreenManager* instance_;
 
-  DisplayGraphicContext display_gc;
+  GraphicContext* display_gc;
 
   /** Screen stack (first is the screen, second is delete_screen,
       which tells if the screen should be deleted onces it got poped





reply via email to

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