pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.93,1.94 client.cxx,1.18


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.93,1.94 client.cxx,1.18,1.19 col_map.cxx,1.6,1.7 col_map.hxx,1.5,1.6 entrance.cxx,1.4,1.5 entrance.hxx,1.3,1.4 exit.cxx,1.5,1.6 exit.hxx,1.3,1.4 hotspot.cxx,1.2,1.3 hotspot.hxx,1.3,1.4 liquid.cxx,1.3,1.4 liquid.hxx,1.3,1.4 pingu_map.cxx,1.1,1.2 pingu_map.hxx,1.3,1.4 playfield_view.cxx,1.1,1.2 playfield_view.hxx,1.4,1.5 spot_map.cxx,1.9,1.10 spot_map.hxx,1.4,1.5 view.cxx,1.8,1.9 view.hxx,1.7,1.8 world.cxx,1.20,1.21 world.hxx,1.9,1.10 worldobj.cxx,1.5,1.6 bmp_map.cxx,1.2,NONE bmp_map.hxx,1.3,NONE
Date: 4 Sep 2002 19:40:22 -0000

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

Modified Files:
        Makefile.am client.cxx col_map.cxx col_map.hxx entrance.cxx 
        entrance.hxx exit.cxx exit.hxx hotspot.cxx hotspot.hxx 
        liquid.cxx liquid.hxx pingu_map.cxx pingu_map.hxx 
        playfield_view.cxx playfield_view.hxx spot_map.cxx 
        spot_map.hxx view.cxx view.hxx world.cxx world.hxx 
        worldobj.cxx 
Removed Files:
        bmp_map.cxx bmp_map.hxx 
Log Message:
some more GC adds

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- Makefile.am 4 Sep 2002 17:49:48 -0000       1.93
+++ Makefile.am 4 Sep 2002 19:40:19 -0000       1.94
@@ -93,8 +93,6 @@
 audio.hxx \
 blitter.cxx \
 blitter.hxx \
-bmp_map.cxx \
-bmp_map.hxx \
 button_panel.cxx \
 button_panel.hxx \
 capture_rectangle.cxx \

Index: client.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/client.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- client.cxx  4 Sep 2002 14:55:11 -0000       1.18
+++ client.cxx  4 Sep 2002 19:40:19 -0000       1.19
@@ -91,11 +91,6 @@
   gui_manager->add (new ArmageddonButton(server, CL_Display::get_width() - 40, 
    CL_Display::get_height() - 62), true);
   gui_manager->add (new ForwardButton   (server, CL_Display::get_width() - 40 
* 2, CL_Display::get_height() - 62), true);
   gui_manager->add (new PauseButton     (server, CL_Display::get_width() - 40 
* 3, CL_Display::get_height() - 62), true);
-
-  /*playfield->set_clip_rect(0, 0, 
-                          CL_Display::get_width(),
-                          CL_Display::get_height());*/
-
   // Connect the button_panel with the playfield
   playfield->set_buttons(button_panel);
   playfield->set_server(server);

Index: col_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/col_map.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- col_map.cxx 16 Aug 2002 15:13:59 -0000      1.6
+++ col_map.cxx 4 Sep 2002 19:40:19 -0000       1.7
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <ClanLib/Display/SurfaceProviders/canvas.h>
+#include "graphic_context.hxx"
 #include "globals.hxx"
 #include "pingus_resource.hxx"
 #include "pingus_error.hxx"
@@ -323,7 +324,7 @@
 }
 
 void
-ColMap::draw(int x_of, int y_of, float /*s*/)
+ColMap::draw(GraphicContext& gc)
 {
   CL_Canvas* canvas = new CL_Canvas(width, height);
   CL_Surface sur;
@@ -371,7 +372,7 @@
 
   sur = CL_Surface(canvas, true);
 
-  sur.put_screen(x_of, y_of);
+  gc.draw(sur, 0, 0);
 }
 
 /* EOF */

Index: col_map.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/col_map.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- col_map.hxx 23 Aug 2002 15:49:48 -0000      1.5
+++ col_map.hxx 4 Sep 2002 19:40:19 -0000       1.6
@@ -22,6 +22,7 @@
 
 #include "groundpiece_data.hxx"
 
+class GraphicContext;
 class ResDescriptor;
 class PixelStatus;
 class CL_Surface;
@@ -61,10 +62,10 @@
       the colmap. */
   unsigned char* get_data();
 
-  /// Returns the height of the collision map.
+  /** Returns the height of the collision map. */
   int get_height();
 
-  /// Returns the height of the collision map.
+  /** Returns the height of the collision map. */
   int get_width();
 
   ///
@@ -85,7 +86,7 @@
   void remove(const CL_Surface&, int x, int y);
   void remove(CL_SurfaceProvider*, int x, int y);
 
-  void draw(int, int, float);
+  void draw(GraphicContext& gc);
   
 private:
   ColMap (const ColMap&);

Index: entrance.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/entrance.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- entrance.cxx        28 Jun 2002 09:51:46 -0000      1.4
+++ entrance.cxx        4 Sep 2002 19:40:19 -0000       1.5
@@ -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 "graphic_context.hxx"
 #include "world.hxx"
 #include "pingu_holder.hxx"
 #include "globals.hxx"
@@ -103,20 +104,16 @@
 }
 
 void
-Entrance::draw_offset(int x, int y, float s)
+Entrance::draw (GraphicContext& gc)
 {
-  if (!surface) return;
-  if (s == 1.0) 
-    {
-      // FIXME: Why do we still have these hardcoded offsets?!
-      surface.put_screen((int)pos.x - 32 + x, (int)pos.y - 16 + y);
-    } 
-  else 
+  if (!surface) 
     {
-      surface.put_screen((int)((pos.x-32 + x) * s),
-                        (int)((pos.y-16 + y) * s),
-                        s, s);
+      std::cout << "Entrance::draw (GraphicContext& gc): entrance without a 
surface?!" << std::endl;
+      return;
     }
+
+  // FIXME: Why do we still have these hardcoded offsets?!
+  gc.draw(surface, CL_Vector ((int)pos.x - 32, (int)pos.y - 16));
 }
 
 /* EOF */

Index: entrance.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/entrance.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- entrance.hxx        23 Aug 2002 15:49:48 -0000      1.3
+++ entrance.hxx        4 Sep 2002 19:40:19 -0000       1.4
@@ -43,7 +43,7 @@
   virtual bool   pingu_ready(void);
   virtual Pingu* get_pingu(void);
   virtual void   update(float delta);
-  virtual void   draw_offset(int x, int y, float s = 1.0);
+  virtual void   draw (GraphicContext& gc);
   
 private:
   Entrance (const Entrance&);

Index: exit.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/exit.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- exit.cxx    25 Aug 2002 09:08:48 -0000      1.5
+++ exit.cxx    4 Sep 2002 19:40:19 -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 "graphic_context.hxx"
 #include "col_map.hxx"
 #include "world.hxx"
 #include "globals.hxx"
@@ -63,15 +64,10 @@
 }
 
 void
-Exit::draw_offset(int x_of, int y_of, float s)
+Exit::draw (GraphicContext& gc)
 {
-  if (s == 1.0) {
-    sprite.put_screen(int(pos.x) + x_of, int(pos.y) + y_of);
-    flag.put_screen (int(pos.x) + 40 + x_of, int(pos.y) + y_of);
-  } else {
-    //sprite.put_screen((int)((pos.x + x_of) * s), (int)((pos.y + y_of) * s),
-    //s, s);
-  }
+  gc.draw(sprite, pos);
+  gc.draw(flag, pos + CL_Vector (40, 0));
 }
 
 ///

Index: exit.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/exit.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- exit.hxx    23 Aug 2002 15:49:48 -0000      1.3
+++ exit.hxx    4 Sep 2002 19:40:19 -0000       1.4
@@ -36,7 +36,7 @@
   ~Exit();
   
   void  draw_colmap();
-  void  draw_offset(int x, int y, float s = 1.0);
+  void  draw (GraphicContext& gc);
   void  update (float delta);
   float get_z_pos() const { return (int) pos.z; }
   

Index: hotspot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hotspot.cxx 13 Jun 2002 14:25:12 -0000      1.2
+++ hotspot.cxx 4 Sep 2002 19:40:19 -0000       1.3
@@ -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 "graphic_context.hxx"
 #include "hotspot.hxx"
 #include "globals.hxx"
 #include "pingus_resource.hxx"
@@ -41,30 +42,9 @@
 }
 
 void 
-Hotspot::draw_offset(int x, int y, float s)
+Hotspot::draw (GraphicContext& gc)
 {
-  /*
-  std::cout << "Hotspot: " 
-       << x << " : "
-       << y << " : "
-       << x_pos << " : "
-       << y_pos << " : " 
-       << para << " : " 
-       << std::endl;
-*/  
-  if (s == 1.0)
-    {
-      surface.put_screen((int)((pos.x + x) * para),
-                         (int)((pos.y + y) * para),
-                         (int)count);
-    }
-  else 
-    {
-      surface.put_screen((int)((pos.x + x) * s * para), 
-                         (int)((pos.y + y) * s * para),
-                         s, s, (int)count);      
-    }
-
+  gc.draw (surface, pos * para, static_cast<int>(count));
   ++count;
 }
 

Index: hotspot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hotspot.hxx 23 Aug 2002 15:49:49 -0000      1.3
+++ hotspot.hxx 4 Sep 2002 19:40:19 -0000       1.4
@@ -37,8 +37,8 @@
 public:
   Hotspot(const HotspotData& spot);
   
-  void draw_offset(int x, int y, float s = 1.0);
-  virtual float get_z_pos() const { return (int) pos.z; }
+  void  draw (GraphicContext& gc);
+  float get_z_pos() const { return (int) pos.z; }
   
 private:
   Hotspot (const Hotspot&);

Index: liquid.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/liquid.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- liquid.cxx  22 Aug 2002 00:36:30 -0000      1.3
+++ liquid.cxx  4 Sep 2002 19:40:19 -0000       1.4
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <ClanLib/Display/Display/display.h>
+#include "graphic_context.hxx"
 #include "world.hxx"
 #include "pingus_resource.hxx"
 #include "col_map.hxx"
@@ -52,53 +53,11 @@
 }
 
 void
-Liquid::draw_offset(int x_of, int y_of, float s)
+Liquid::draw (GraphicContext& gc)
 {
-  int x1 = int(pos.x + x_of);
-  int x2 = int(pos.x + width + x_of);
-  int y1 = int(pos.y + y_of);
-  int y2 = int(pos.y + y_of + sur.get_height());
-
-  if (x1 < 0) {
-    x1 = 0;
-    if (x2 < 0)
-      x2 = 0;
-  }
-
-  if (y1 < 0) {
-    y1 = 0;
-    if (y2 < 0)
-      y2 = 0;
-  }
-
-  if (x2 >= CL_Display::get_width()) {
-    x2 = CL_Display::get_width() - 1;
-    if (x1 >= CL_Display::get_width())
-      x1 = x2;
-  }
-
-  if (y2 >= CL_Display::get_height()) {
-    y2 = CL_Display::get_height();
-    if (y1 >= CL_Display::get_height())
-      y1 = y2;
-  }
-
-  if (s == 1.0) {
-    // FIXME: I don't need we need clip_rects here any longer
-    CL_Display::push_clip_rect();
-    CL_Display::set_clip_rect(CL_ClipRect(x1, y1, x2, y2));
-    
-    for(int x = (int) pos.x; x <= pos.x + width; x += sur.get_width())
-      sur.put_screen(x + x_of, (int)pos.y + y_of, int(counter));
-
-    CL_Display::pop_clip_rect();
-  } else {
-    /* Do nothing, since this is buggy
-    for(int x = x_pos; x <= x_pos + width; x += sur->get_width())
-      sur->put_screen(x + x_of, y_pos + y_of,
-                      s, s, int(counter));
-    */
-  }
+  for(int x = static_cast<int>(pos.x); x <= pos.x + width; x += 
sur.get_width())
+    gc.draw(sur, x, static_cast<int>(pos.y), static_cast<int>(counter));
+  
   ++counter;
 }
 

Index: liquid.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/liquid.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- liquid.hxx  23 Aug 2002 15:49:49 -0000      1.3
+++ liquid.hxx  4 Sep 2002 19:40:19 -0000       1.4
@@ -40,7 +40,7 @@
 
   float get_z_pos() const { return (int) pos.z; }
   void draw_colmap();
-  void draw_offset(int, int, float s = 1.0);
+  void draw (GraphicContext& gc);
   
 private:
   Liquid (const Liquid&);

Index: pingu_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_map.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pingu_map.cxx       12 Jun 2002 19:06:12 -0000      1.1
+++ pingu_map.cxx       4 Sep 2002 19:40:19 -0000       1.2
@@ -68,17 +68,4 @@
   put (sur.get_provider (), x, y);
 }
 
-void 
-PinguMap::update (float /*delta*/)
-{
-  
-}
-
-void 
-PinguMap::draw_offset (int x_of, int y_of, float zoom)
-{
-  draw (0, 0, CL_Display::get_width(), CL_Display::get_height (),
-       x_of, y_of, zoom);
-}
-
 /* EOF */

Index: pingu_map.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_map.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pingu_map.hxx       23 Aug 2002 15:49:49 -0000      1.3
+++ pingu_map.hxx       4 Sep 2002 19:40:19 -0000       1.4
@@ -36,26 +36,9 @@
 class PinguMap : public WorldObj
 {
 public:
-  ///
   PinguMap();
-  ///
   virtual ~PinguMap();
 
-  /** Draws the map onto the screen
-      @param x1 The x-position on the screen
-      @param y1 The y-position on the screen
-      @param w  The width of the area to draw
-      @param h The height of the area to draw
-      @param x_of The X-Offset of the viewpoint, used to scroll on the map
-      @param y_of The Y-Offset of the viewpoint, used to scroll on the map
-      @param s  The scale factor by which the map is zoomed
-   */
-  virtual void draw(int x1, int y1, int w, int h,
-                   int x_of, int y_of, float s=1.0) = 0;
-                   
-  virtual void update (float delta); 
-  
-  virtual void draw_offset (int, int, float delta); 
   virtual void mark_dirty(int,int,int,int);
   virtual ColMap *get_colmap();
   

Index: playfield_view.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/playfield_view.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- playfield_view.cxx  12 Jun 2002 19:06:13 -0000      1.1
+++ playfield_view.cxx  4 Sep 2002 19:40:19 -0000       1.2
@@ -24,8 +24,10 @@
 #include "world.hxx"
 
 PlayfieldView::PlayfieldView (World * w, const CL_Rect& rect)
-  : world (w), x_offset (0), y_offset (0)
+  : gc (0, 0, 300, 300, 0, 0), // FIXME: broken
+    world (w), x_offset (0), y_offset (0)
 {
+  // FIXME: Cliprects should be handled in the GraphicContext
   set_clip_rect(rect.x1, rect.y1, rect.x2, rect.y2);
 }
 
@@ -41,11 +43,7 @@
 void 
 PlayfieldView::draw ()
 {
-  //std::cout << "Offset: " << x_offset << " " << y_offset << std::endl;
-  world->draw(//x1, y1,
-             //x2 - x1, y2 - y1,
-             0, 0, CL_Display::get_width (), CL_Display::get_height (),
-             x_offset + x1, y_offset + y1, 1.0f);
+  world->draw(gc);
 }
 
 void 

Index: playfield_view.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/playfield_view.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- playfield_view.hxx  4 Sep 2002 17:49:48 -0000       1.4
+++ playfield_view.hxx  4 Sep 2002 19:40:19 -0000       1.5
@@ -20,6 +20,7 @@
 #ifndef HEADER_PINGUS_PLAYFIELD_VIEW_HXX
 #define HEADER_PINGUS_PLAYFIELD_VIEW_HXX
 
+#include "display_graphic_context.hxx"
 #include "gui_obj.hxx"
 
 class CL_Rect;
@@ -31,6 +32,7 @@
 class PlayfieldView : public GuiObj
 {
 private:
+  DisplayGraphicContext gc;
   World * world;
   int x_offset;
   int y_offset;

Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- spot_map.cxx        4 Sep 2002 14:55:11 -0000       1.9
+++ spot_map.cxx        4 Sep 2002 19:40:19 -0000       1.10
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <ClanLib/Display/SurfaceProviders/canvas.h>
 #include <ClanLib/Display/Display/display.h>
+#include "graphic_context.hxx"
 #include "pingus_resource.hxx"
 #include "plf.hxx"
 #include "pingus_error.hxx"
@@ -241,72 +242,69 @@
 }
 
 void
-PingusSpotMap::draw_colmap(int /*x_pos*/, int /*y_pos*/, int /*w*/, int /*h*/, 
-                          int x_of, int y_of, float s)
+PingusSpotMap::draw_colmap(GraphicContext& gc)
 {
-  colmap->draw(x_of, y_of, s);
+  colmap->draw(gc);
 }
 
 // Draws the map with a offset, needed for scrolling
 void
-PingusSpotMap::draw(int x_pos, int y_pos, int w, int h, 
-                   int of_x, int of_y, float s)
+PingusSpotMap::draw(GraphicContext& gc)
 {
   //std::cout << "Draw: " << " x_pos: " << x_pos << " y_pos: " 
   //<< " w: " << w << " h: " << h << " s: " << s << std::endl;
 
+  // FIXME: delete the next four lines and replace them with gc.get_clip_rect()
+  int w = CL_Display::get_width ();
+  int h = CL_Display::get_height ();
+  int of_x = gc.get_x_offset () + (gc.get_width ()/2); 
+  int of_y = gc.get_y_offset () + (gc.get_height ()/2);
+
   if (draw_collision_map)
     {
-      draw_colmap(x_pos, y_pos, w, h, of_x, of_y, s);
+      draw_colmap(gc);
     }
   else
     {
-      if (s == 1.0)
-       {
-         // Trying to calc which parts of the tilemap needs to be drawn
-         int start_x = -of_x/tile_size;
-         int start_y = -of_y/tile_size;
-         unsigned int tilemap_width = w / tile_size;
-         unsigned int tilemap_height = h / tile_size + 1;
+      // Trying to calc which parts of the tilemap needs to be drawn
+      int start_x = -of_x/tile_size;
+      int start_y = -of_y/tile_size;
+      unsigned int tilemap_width = w / tile_size;
+      unsigned int tilemap_height = h / tile_size + 1;
 
-         //      std::cout  << " th: " << tilemap_height << " tw: " << 
tilemap_width << std::endl;
+      //         std::cout  << " th: " << tilemap_height << " tw: " << 
tilemap_width << std::endl;
 
-         if (start_x < 0)
-           start_x = 0;
-         if (start_y < 0)
-           start_y = 0;
+      if (start_x < 0)
+       start_x = 0;
+      if (start_y < 0)
+       start_y = 0;
 
-         //unsigned int time = CL_System::get_time (); 
-         // drawing the stuff
-         for (TileIter x = start_x; 
-              x <= (start_x + tilemap_width) && x < tile.size();
-              ++x)
+      //unsigned int time = CL_System::get_time (); 
+      // drawing the stuff
+      for (TileIter x = start_x; 
+          x <= (start_x + tilemap_width) && x < tile.size();
+          ++x)
+       {
+         for (TileIter y = start_y;
+              y <= start_y + tilemap_height && y < tile[x].size();
+              ++y)
            {
-             for (TileIter y = start_y;
-                  y <= start_y + tilemap_height && y < tile[x].size();
-                  ++y)
+             if (!tile[x][y].is_empty()) 
                {
-                 if (!tile[x][y].is_empty()) 
-                   {
-                     tile[x][y].surface.put_screen(x * tile_size + of_x, 
-                                                   y * tile_size + of_y);
-                   }
-                 else
-                   {
-                     if (pingus_debug_flags & PINGUS_DEBUG_TILES)
-                       CL_Display::fill_rect(x * tile_size + of_x, y * 
tile_size + of_y,
-                                             x * tile_size + of_x + tile_size, 
y * tile_size + of_y + tile_size,
-                                             1.0f, 0.0f, 0.0f, 0.3f);
-                   }
+                 gc.draw(tile[x][y].surface,
+                         x * tile_size, 
+                         y * tile_size);
+               }
+             else
+               {
+                 if (pingus_debug_flags & PINGUS_DEBUG_TILES)
+                   gc.draw_fillrect(x * tile_size, y * tile_size,
+                                    x * tile_size + tile_size, y * tile_size + 
tile_size,
+                                    1.0f, 0.0f, 0.0f, 0.3f);
                }
            }
-         //std::cout << "> time: " << CL_System::get_time() - time << 
std::endl;
-       } 
-      else 
-       {
-         std::cout << "PingusSpotMap: Zooming is at the moment not supported" 
<< std::endl;
-         // map_surface->put_screen(int(of_x * s), int(of_y * s), s, s);
        }
+      //std::cout << "> time: " << CL_System::get_time() - time << std::endl;
     }
 }
 

Index: spot_map.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- spot_map.hxx        23 Aug 2002 15:49:51 -0000      1.4
+++ spot_map.hxx        4 Sep 2002 19:40:19 -0000       1.5
@@ -76,13 +76,13 @@
   PingusSpotMap(PLF*);
   virtual ~PingusSpotMap();
 
+  void draw(GraphicContext& gc);
+
   void generate_colmap();
   ColMap* get_colmap();
   void load(PLF* plf);
   void gen_tiles();
-  void draw(int x, int y, int w, int h, int of_x, int of_y, float s);
-  void draw_colmap(int x_pos, int y_pos, int w, int h, 
-                  int of_x, int of_y, float s);
+
   int  get_height(void);
   int  get_width(void);
   CL_Surface get_surface(void);
@@ -97,6 +97,9 @@
   float get_z_pos () const { return 0; }
   
 private:
+  /** Draw the collision map onto the screen */
+  void draw_colmap(GraphicContext& gc);
+
   PingusSpotMap (const PingusSpotMap&);
   PingusSpotMap operator= (const PingusSpotMap&);
 };

Index: view.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/view.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- view.cxx    4 Sep 2002 17:49:48 -0000       1.8
+++ view.cxx    4 Sep 2002 19:40:19 -0000       1.9
@@ -36,8 +36,8 @@
   assert(world);
 
   size = s;
-
-  clip_rect = CL_ClipRect(x1, y1, x2 + 1, y2 + 1);
+  
+  // FIXME: clip_rect = CL_ClipRect(x1, y1, x2 + 1, y2 + 1);
 
   x1_pos = x1;
   y1_pos = y1;
@@ -60,16 +60,17 @@
 {
   assert(world);
   
-  CL_Display::push_clip_rect();
-  CL_Display::set_clip_rect(clip_rect);
+  // FIXME: CL_Display::push_clip_rect();
+  // FIXME: CL_Display::set_clip_rect(clip_rect);
 
   // Drawing the world
-  world->draw(x1_pos, y1_pos,
+  /*world->draw(x1_pos, y1_pos,
              x2_pos - x1_pos + 1, y2_pos - y1_pos + 1,
-             x_offset, y_offset, size);
+             x_offset, y_offset, size);*/
 
   // Update the scroll position
-  display_gc.set_offset (x_offset, y_offset);
+  display_gc.set_offset (x_offset - (x2_pos - x1_pos)/2,
+                        y_offset - (y2_pos - y1_pos)/2);
   world->draw (display_gc);
   
   cap.set_pingu(current_pingu);
@@ -77,7 +78,7 @@
                  get_y_pos() + get_y_offset(),
                  size);
   
-  CL_Display::pop_clip_rect();
+    // FIXME: CL_Display::pop_clip_rect();
 }
 
 void

Index: view.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/view.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- view.hxx    4 Sep 2002 17:49:48 -0000       1.7
+++ view.hxx    4 Sep 2002 19:40:19 -0000       1.8
@@ -38,10 +38,13 @@
   DisplayGraphicContext display_gc;
 
   CL_ClipRect clip_rect;
-  /// The position of the view in the world
+
+  /** The position of the view in the world */
   Range x_offset, y_offset; 
+
   bool mouse_over;
-  /// The zoom of the View, 1 is default
+
+  /** The zoom of the View, 1 is default */
   double size;              
   int mouse_x;
   int mouse_y;

Index: world.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- world.cxx   4 Sep 2002 17:49:48 -0000       1.20
+++ world.cxx   4 Sep 2002 19:40:19 -0000       1.21
@@ -91,8 +91,8 @@
 }
 
 // Merge the different layers on the screen together
-void 
-World::draw(int x1, int y1, int /*w*/, int /*h*/,
+/*void 
+World::draw(int x1, int y1, int w, int h,
            int x_of, int y_of, float s)
 {
   x_of += x1;
@@ -104,7 +104,7 @@
     }
   
   particle_holder->draw_offset(x_of, y_of, s);
-}
+}*/
 
 void
 World::draw (GraphicContext& gc)

Index: world.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- world.hxx   4 Sep 2002 17:49:48 -0000       1.9
+++ world.hxx   4 Sep 2002 19:40:19 -0000       1.10
@@ -94,20 +94,6 @@
   World(PLF*);
   virtual ~World();
 
-  /** Draws the world onto the screen
-      @param x1   The left corner of the drawing area.
-      @param y1   The upper corner of the drawing area.
-      @param w    The width of the drawing area.
-      @param h    The height of the drawing area.
-      @param x_of x_of
-      @param y_of y_of
-      @param s    s   
-      
-      FIXME: deprecated
-  */
-  void    draw(int x1, int y1, int w, int h,
-              int x_of, int y_of, float s);
-
   /** Draw the world onto the given GraphicContext */
   void    draw (GraphicContext& gc);
 

Index: worldobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- worldobj.cxx        4 Sep 2002 17:49:48 -0000       1.5
+++ worldobj.cxx        4 Sep 2002 19:40:19 -0000       1.6
@@ -58,15 +58,19 @@
 WorldObj::draw_offset(int /*x*/, int /*y*/, float /*s*/)
 {
   // do nothing
-  std::cout << "WorldObj::draw_offset(int /*x*/, int /*y*/, float /*s*/): not 
implemented, probally a bug" << std::endl;
+  std::cout << "WorldObj::draw_offset(): not implemented, probally a bug: " 
+           << typeid(*this).name () << std::endl;
 }
 
 void
 WorldObj::draw (GraphicContext& gc)
 {
+  // FIXME: I need some docu on the meaning of get_x_offset() and co.
   std::cout << "WorldObj:draw(GraphicContext): Using compat-wrapper: " 
            << typeid(*this).name () << std::endl;
-  draw_offset (int(gc.get_x_offset ()), int(gc.get_y_offset ()), gc.get_zoom 
());
+  draw_offset (static_cast<int>(gc.get_x_offset () + gc.get_width ()/2), 
+              static_cast<int>(gc.get_y_offset () + gc.get_height ()/2), 
+              gc.get_zoom ());
 }
 
 /* EOF */

--- bmp_map.cxx DELETED ---

--- bmp_map.hxx DELETED ---





reply via email to

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