pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src layer_manager.cxx,1.3,1.4 layer_manag


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src layer_manager.cxx,1.3,1.4 layer_manager.hxx,1.6,1.7 menu_background.cxx,1.5,1.6 menu_background.hxx,1.6,1.7 menu_button.cxx,1.1,1.2 pingus_menu_manager.cxx,1.20,1.21
Date: 24 Mar 2003 11:18:55 -0000

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

Modified Files:
        layer_manager.cxx layer_manager.hxx menu_background.cxx 
        menu_background.hxx menu_button.cxx pingus_menu_manager.cxx 
Log Message:
changed a few functions to use GraphicContext instead of plain ClanLib

Index: layer_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/layer_manager.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- layer_manager.cxx   18 Feb 2003 00:13:13 -0000      1.3
+++ layer_manager.cxx   24 Mar 2003 11:18:53 -0000      1.4
@@ -42,11 +42,11 @@
 }
 
 void
-LayerManager::draw ()
+LayerManager::draw (GraphicContext& gc)
 {
   for (std::vector<Layer>::iterator i = layers.begin (); 
        i != layers.end (); ++i)
-    i->draw ();
+    i->draw (gc);
 }
 
 void 

Index: layer_manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/layer_manager.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- layer_manager.hxx   27 Sep 2002 11:26:43 -0000      1.6
+++ layer_manager.hxx   24 Mar 2003 11:18:53 -0000      1.7
@@ -23,6 +23,7 @@
 #include "pingus.hxx"
 #include <cmath>
 #include <ClanLib/Display/Display/surface.h>
+#include "gui/graphic_context.hxx"
 
 class LayerManager
 {
@@ -33,11 +34,11 @@
     Layer () : x_pos(0.0f), y_pos(0.0f) {
     }
     
-    void draw () {
-      sur.put_screen (int(x_pos + x_offset),
-                     int(y_pos + y_offset));
-      sur.put_screen (int(x_pos + x_offset - 800),
-                     int(y_pos + y_offset));
+    void draw (GraphicContext& gc) {
+      gc.draw(sur, int(x_pos + x_offset),
+              int(y_pos + y_offset));
+      gc.draw(sur, int(x_pos + x_offset - 800),
+              int(y_pos + y_offset));
     }
 
     void update (float delta) {
@@ -85,7 +86,7 @@
   ~LayerManager();
 
   void add_layer (const CL_Surface& sur, float x_o, float y_o, float x_u, 
float y_u);
-  void draw ();
+  void draw (GraphicContext& gc);
   void update (float delta);
   
 private:

Index: menu_background.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/menu_background.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- menu_background.cxx 18 Feb 2003 00:13:13 -0000      1.5
+++ menu_background.cxx 24 Mar 2003 11:18:53 -0000      1.6
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "gui/graphic_context.hxx"
 #include "menu_background.hxx"
 #include "pingus_resource.hxx"
 
@@ -34,9 +35,9 @@
 }
 
 void 
-MenuBackground::draw ()
+MenuBackground::draw (GraphicContext& gc)
 {
-  layer_manager.draw ();
+  layer_manager.draw (gc);
 }
 
 void 

Index: menu_background.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/menu_background.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- menu_background.hxx 27 Sep 2002 11:26:43 -0000      1.6
+++ menu_background.hxx 24 Mar 2003 11:18:53 -0000      1.7
@@ -22,6 +22,8 @@
 
 #include "layer_manager.hxx"
 
+class GraphicContext;
+
 class MenuBackground
 {
 private:
@@ -30,7 +32,7 @@
   MenuBackground ();
   ~MenuBackground ();
 
-  void draw ();
+  void draw (GraphicContext& gc);
   void update (float delta);
   
 private:

Index: menu_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/menu_button.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- menu_button.cxx     18 Mar 2003 17:24:55 -0000      1.1
+++ menu_button.cxx     24 Mar 2003 11:18:53 -0000      1.2
@@ -58,56 +58,61 @@
 {
   if (mouse_over && !pressed)
     {
-      font->print_center(CL_Display::get_width() / 2, 
-                        CL_Display::get_height() - 20, 
-                        desc.c_str());
+      gc.print_center(font, CL_Display::get_width() / 2, 
+                      CL_Display::get_height() - 20, 
+                      desc.c_str());
 
-      surface_p.put_screen(x_pos - surface_p.get_width()/2,
-                          y_pos - surface_p.get_height()/2);
+      gc.draw(surface_p, x_pos - surface_p.get_width()/2,
+              y_pos - surface_p.get_height()/2);
 
       if (line2.empty())
        {
-         font_large->print_center(x_pos + 32, 
-                                  y_pos - 32 - font_large->get_height()/2,
-                                  line1.c_str());
+         gc.print_center(font_large, x_pos + 32, 
+                          y_pos - 32 - font_large->get_height()/2,
+                          line1.c_str());
        }
       else
        {
-         font_large->print_center(x_pos + 32, y_pos - 32 - 
font_large->get_height(), 
-                                  line1.c_str());
-         font_large->print_center(x_pos + 32, y_pos - 32,
-                                  line2.c_str());
+         gc.print_center(font_large, x_pos + 32, y_pos - 32 - 
font_large->get_height(), 
+                          line1.c_str());
+         gc.print_center(font_large, x_pos + 32, y_pos - 32,
+                          line2.c_str());
        }
     }
   else if (mouse_over && pressed)
     {
       float shrink = 0.9f;
       
-      font->print_center(CL_Display::get_width() / 2, 
-                        CL_Display::get_height() - 20, 
-                        desc.c_str());
+      gc.print_center(font, CL_Display::get_width() / 2, 
+                      CL_Display::get_height() - 20, 
+                      desc.c_str());
+
+      gc.draw(surface_p, 
+              static_cast<int>(x_pos - surface_p.get_width()/2 * shrink),
+              static_cast<int>(y_pos - surface_p.get_height()/2 * shrink),
+              shrink, shrink, 0);
 
-      surface_p.put_screen(static_cast<int>(x_pos - surface_p.get_width()/2 * 
shrink),
-                          static_cast<int>(y_pos - surface_p.get_height()/2 * 
shrink),
-                          shrink, shrink);
       if (line2.empty())
        {
-         font_large->print_center(x_pos + 32, 
-                                  y_pos - 32 - font_large->get_height()/2,
-                                  line1.c_str());
+         gc.print_center(font_large,
+                          x_pos + 32, 
+                          y_pos - 32 - font_large->get_height()/2,
+                          line1.c_str());
        }
       else
        {
-         font_large->print_center(x_pos + 32, y_pos - 32 - 
font_large->get_height(), 
-                                  line1.c_str());
-         font_large->print_center(x_pos + 32, y_pos - 32,
-                                  line2.c_str());
+         gc.print_center(font_large, 
+                          x_pos + 32, y_pos - 32 - font_large->get_height(), 
+                          line1.c_str());
+         gc.print_center(font_large, x_pos + 32, y_pos - 32,
+                          line2.c_str());
        }
     } 
   else 
     {
-      surface_p.put_screen(x_pos - surface_p.get_width()/2,
-                          y_pos - surface_p.get_height()/2);
+      gc.draw(surface_p, 
+              x_pos - surface_p.get_width()/2,
+              y_pos - surface_p.get_height()/2);
     }
   UNUSED_ARG(gc);
 }

Index: pingus_menu_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_menu_manager.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- pingus_menu_manager.cxx     19 Feb 2003 11:33:00 -0000      1.20
+++ pingus_menu_manager.cxx     24 Mar 2003 11:18:53 -0000      1.21
@@ -47,13 +47,13 @@
 bool
 PingusMenuManager::draw (GraphicContext& gc)
 {
-  background.draw ();
+  background.draw (gc);
   
   gc.draw (unplayable, Vector(CL_Display::get_width ()/2, 30));
 
-  CL_Display::fill_rect(0, CL_Display::get_height () - 22,
-                       CL_Display::get_width (), CL_Display::get_height (),
-                       0, 0, 0, 1.0f);
+  gc.draw_fillrect(0, CL_Display::get_height () - 22,
+                   CL_Display::get_width (), CL_Display::get_height (),
+                   0, 0, 0, 1.0f);
 
   for (MenuStackIter i = menu_stack.begin (); i != menu_stack.end (); ++i)
     (*i)->draw (gc);





reply via email to

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