pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src hotspot.cxx,1.3,1.4 pingu.cxx,1.21,1.


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src hotspot.cxx,1.3,1.4 pingu.cxx,1.21,1.22 pingu.hxx,1.12,1.13 pingu_action.hxx,1.13,1.14 pingu_holder.cxx,1.5,1.6 pingu_holder.hxx,1.3,1.4
Date: 4 Sep 2002 20:30:31 -0000

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

Modified Files:
        hotspot.cxx pingu.cxx pingu.hxx pingu_action.hxx 
        pingu_holder.cxx pingu_holder.hxx 
Log Message:
some more GC stuff -> s/draw_offset/draw(GraphicContext&)/

Index: hotspot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hotspot.cxx 4 Sep 2002 19:40:19 -0000       1.3
+++ hotspot.cxx 4 Sep 2002 20:30:28 -0000       1.4
@@ -44,6 +44,7 @@
 void 
 Hotspot::draw (GraphicContext& gc)
 {
+  // FIXME: para support doesnn't work correctly
   gc.draw (surface, pos * para, static_cast<int>(count));
   ++count;
 }

Index: pingu.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- pingu.cxx   4 Sep 2002 14:55:11 -0000       1.21
+++ pingu.cxx   4 Sep 2002 20:30:28 -0000       1.22
@@ -319,12 +319,11 @@
 
 // Draws the pingu on the screen with the given offset
 void
-Pingu::draw_offset (int x, int y, float s)
+Pingu::draw (GraphicContext& gc)
 {
   char str[16];
-  y += 2;
 
-  action->draw_offset(x, y,s);
+  action->draw (gc);
   
   if (action_time != -1) 
     {
@@ -333,21 +332,9 @@
       // FIXME: in ticks, should probally be in seconds]
       snprintf(str, 16, "%d", action_time);
       
-      if (s == 1.0) 
-       {
-         font->print_center(static_cast<int>(pos_x + x), 
static_cast<int>(pos_y - 45) + y, str);
-       } 
-      else if (s > 1.0) 
-       {
-         font->print_left(static_cast<int>((pos_x + x) * s),
-                          static_cast<int>((pos_y - 45 + y) * s) - 
(static_cast<int>(font->get_text_width(str) * s) / 2),
-                          static_cast<int>(s), static_cast<int>(s),
-                          str);
-       }
-      else 
-       {
-         // Don't draw the font if the zoom is smaller than default (1.0)
-       }
+      font->print_center(static_cast<int>(pos_x), 
+                        static_cast<int>(pos_y - 45) + 2, 
+                        str);
     }
 }
 

Index: pingu.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pingu.hxx   4 Sep 2002 14:55:11 -0000       1.12
+++ pingu.hxx   4 Sep 2002 20:30:28 -0000       1.13
@@ -20,6 +20,7 @@
 #ifndef HEADER_PINGUS_PINGU_HXX
 #define HEADER_PINGUS_PINGU_HXX
 
+#include "graphic_context.hxx"
 #include "direction.hxx"
 #include "pingu_enums.hxx"
 
@@ -174,7 +175,7 @@
   /** Returns true if the pingu needs to catch another pingu */
   bool need_catch ();
   
-  void draw_offset (int x, int y, float s = 1.0);
+  void draw (GraphicContext& gc);
   void apply_force (CL_Vector);
   
   void update (float delta);

Index: pingu_action.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.hxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- pingu_action.hxx    4 Sep 2002 14:55:11 -0000       1.13
+++ pingu_action.hxx    4 Sep 2002 20:30:28 -0000       1.14
@@ -20,6 +20,7 @@
 #ifndef HEADER_PINGUS_PINGU_ACTION_HXX
 #define HEADER_PINGUS_PINGU_ACTION_HXX
 
+#include "graphic_context.hxx"
 #include "pingu_enums.hxx"
 
 class Pingu;
@@ -74,9 +75,8 @@
   /// The "AI" of the pingu.
   virtual void update (float delta) = 0;
 
-  /** Draws the surfaced defined by the action, can be overwritten if
-      the action needs a more complicated way of drawing. */
-  virtual void draw_offset (int x, int y, float s) =0;
+  /** Draws the action */
+  virtual void draw (GraphicContext& gc) =0;
 
   /// Returns the activation mode
   virtual ActionType get_activation_mode (void) const;

Index: pingu_holder.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_holder.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pingu_holder.cxx    4 Sep 2002 14:55:11 -0000       1.5
+++ pingu_holder.cxx    4 Sep 2002 20:30:28 -0000       1.6
@@ -62,7 +62,7 @@
 }
 
 void
-PinguHolder::draw_offset(int x_of, int y_of, float s)
+PinguHolder::draw (GraphicContext& gc)
 {
   PinguIter pingu = pingus.begin();
   
@@ -85,7 +85,7 @@
          // We don't draw the actions here, since we want them above
          // all other pingus, for better visibility
          if (!(*pingu)->get_action())
-           (*pingu)->draw_offset(x_of, y_of, s);
+           (*pingu)->draw (gc);
          
          // move to the next Pingu
          pingu++;
@@ -96,7 +96,7 @@
   for(pingu = pingus.begin(); pingu != pingus.end(); pingu++)
     {
       if ((*pingu)->get_action()) 
-       (*pingu)->draw_offset(x_of, y_of, s);
+       (*pingu)->draw (gc);
     }
 }
 

Index: pingu_holder.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_holder.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pingu_holder.hxx    23 Aug 2002 15:49:49 -0000      1.3
+++ pingu_holder.hxx    4 Sep 2002 20:30:28 -0000       1.4
@@ -52,7 +52,7 @@
   PinguHolder();
   ~PinguHolder();
 
-  void draw_offset(int, int, float s = 1.0);
+  void draw (GraphicContext& gc);
   int  total_size();
   int  get_saved() { return saved_pingus; }
   





reply via email to

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