pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3841 - in trunk/pingus/src: . components display editor gu


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3841 - in trunk/pingus/src: . components display editor gui math worldmap
Date: Wed, 16 Jul 2008 21:02:22 +0200

Author: grumbel
Date: 2008-07-16 21:02:18 +0200 (Wed, 16 Jul 2008)
New Revision: 3841

Modified:
   trunk/pingus/src/addon_menu.cpp
   trunk/pingus/src/capture_rectangle.cpp
   trunk/pingus/src/components/button_panel.cpp
   trunk/pingus/src/components/check_box.cpp
   trunk/pingus/src/components/choice_box.cpp
   trunk/pingus/src/components/label.cpp
   trunk/pingus/src/components/menu_button.cpp
   trunk/pingus/src/components/pingus_counter.cpp
   trunk/pingus/src/components/playfield.cpp
   trunk/pingus/src/components/slider_box.cpp
   trunk/pingus/src/components/smallmap.cpp
   trunk/pingus/src/components/time_display.cpp
   trunk/pingus/src/credits.cpp
   trunk/pingus/src/display/delta_framebuffer.cpp
   trunk/pingus/src/display/drawing_context.cpp
   trunk/pingus/src/display/drawing_context.hpp
   trunk/pingus/src/display/drawing_request.hpp
   trunk/pingus/src/display/scene_context.cpp
   trunk/pingus/src/display/scene_context.hpp
   trunk/pingus/src/display/sdl_framebuffer.cpp
   trunk/pingus/src/editor/button.cpp
   trunk/pingus/src/editor/checkbox.cpp
   trunk/pingus/src/editor/combobox.cpp
   trunk/pingus/src/editor/editor_screen.cpp
   trunk/pingus/src/editor/file_dialog.cpp
   trunk/pingus/src/editor/file_list.cpp
   trunk/pingus/src/editor/gui_style.cpp
   trunk/pingus/src/editor/inputbox.cpp
   trunk/pingus/src/editor/label.cpp
   trunk/pingus/src/editor/object_selector.cpp
   trunk/pingus/src/editor/object_selector_list.cpp
   trunk/pingus/src/editor/panel.cpp
   trunk/pingus/src/font_test_screen.cpp
   trunk/pingus/src/game_session.cpp
   trunk/pingus/src/graphic_context_state.cpp
   trunk/pingus/src/ground_map.cpp
   trunk/pingus/src/gui/checkbox.cpp
   trunk/pingus/src/gui/combobox.cpp
   trunk/pingus/src/gui/input_box.cpp
   trunk/pingus/src/level_menu.cpp
   trunk/pingus/src/math/rect.hpp
   trunk/pingus/src/option_menu.cpp
   trunk/pingus/src/pingu.cpp
   trunk/pingus/src/pingus_menu.cpp
   trunk/pingus/src/result_screen.cpp
   trunk/pingus/src/start_screen.cpp
   trunk/pingus/src/story_screen.cpp
   trunk/pingus/src/worldmap/level_dot.cpp
   trunk/pingus/src/worldmap/path_drawable.cpp
   trunk/pingus/src/worldmap/path_drawable.hpp
   trunk/pingus/src/worldmap/sprite_drawable.hpp
   trunk/pingus/src/worldmap/worldmap_component.cpp
   trunk/pingus/src/worldmap/worldmap_screen.cpp
Log:
Simplified DrawingContext API a bit by removing redundant functions

Modified: trunk/pingus/src/addon_menu.cpp
===================================================================
--- trunk/pingus/src/addon_menu.cpp     2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/addon_menu.cpp     2008-07-16 19:02:18 UTC (rev 3841)
@@ -38,18 +38,18 @@
   // gc.draw_fillrect(Rect(100, 100, 400, 400), Color(255, 0, 0));
   gc.draw(background, Vector2i(gc.get_width()/2 - background.get_width()/2, 
gc.get_height()/2 - background.get_height()/2));
 
-  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 90, "Add-On Menu");
+  gc.print_center(Fonts::chalk_large, Vector2i(gc.get_width()/2, 90), "Add-On 
Menu");
 
-  gc.print_left(Fonts::chalk_normal, 120, 145, "X-Mas Pingus Sprites");
-  gc.print_left(Fonts::chalk_small,  140, 170, "christmas look for penguins");
-  gc.print_left(Fonts::chalk_small,  140, 190, "Author: John Foo 
<address@hidden>");
+  gc.print_left(Fonts::chalk_normal, Vector2i(120, 145), "X-Mas Pingus 
Sprites");
+  gc.print_left(Fonts::chalk_small,  Vector2i(140, 170), "christmas look for 
penguins");
+  gc.print_left(Fonts::chalk_small,  Vector2i(140, 190), "Author: John Foo 
<address@hidden>");
 
-  gc.print_center(Fonts::chalk_normal, gc.get_width()/2, gc.get_height()/2 + 
160, "Update Online [ ]");
+  gc.print_center(Fonts::chalk_normal, Vector2i(gc.get_width()/2, 
gc.get_height()/2 + 160), "Update Online [ ]");
 
-  gc.print_center(Fonts::chalk_normal, gc.get_width()/2 + 225 + 30, 
gc.get_height()/2 + 125 - 20, _("Close"));
+  gc.print_center(Fonts::chalk_normal, Vector2i(gc.get_width()/2 + 225 + 30, 
gc.get_height()/2 + 125 - 20), _("Close"));
   gc.draw(ok_button, Vector2i(gc.get_width()/2 + 225, gc.get_height()/2 + 
125));
 
-  gc.draw(ok_button, 610, 145);
+  gc.draw(ok_button, Vector2i(610, 145));
 }
 
 void

Modified: trunk/pingus/src/capture_rectangle.cpp
===================================================================
--- trunk/pingus/src/capture_rectangle.cpp      2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/capture_rectangle.cpp      2008-07-16 19:02:18 UTC (rev 
3841)
@@ -68,8 +68,8 @@
         }
 
       sc.color().print_center(font, 
-                              (int)pingu->get_center_pos().x,
-                              (int)pingu->get_center_pos().y - 32,
+                              Vector2i(pingu->get_center_pos().x,
+                                       pingu->get_center_pos().y - 32),
                               action_str,
                               1000);
     }

Modified: trunk/pingus/src/components/button_panel.cpp
===================================================================
--- trunk/pingus/src/components/button_panel.cpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/components/button_panel.cpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -74,7 +74,7 @@
       gc.draw(buttons[i].sprite, rect.left + 20, rect.top + 38*i + 16);
 
       std::string str = 
StringUtil::to_string(aholder->get_available(buttons[i].name));
-      gc.print_center(Fonts::pingus_small, rect.left + 46, rect.top + 5 + 
38*i, str);
+      gc.print_center(Fonts::pingus_small, Vector2i(rect.left + 46, rect.top + 
5 + 38*i), str);
     }
 }
 

Modified: trunk/pingus/src/components/check_box.cpp
===================================================================
--- trunk/pingus/src/components/check_box.cpp   2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/check_box.cpp   2008-07-16 19:02:18 UTC (rev 
3841)
@@ -39,8 +39,8 @@
     gc.draw_rect(rect, Color(0, 255, 255));
 
   if (state)
-    gc.print_center(Fonts::chalk_normal, rect.left+rect.get_width()/2, 
rect.top, "X");
-  gc.print_center(Fonts::chalk_normal, rect.left+rect.get_width()/2, rect.top, 
"[ ]");
+    gc.print_center(Fonts::chalk_normal, 
Vector2i(rect.left+rect.get_width()/2, rect.top), "X");
+  gc.print_center(Fonts::chalk_normal, Vector2i(rect.left+rect.get_width()/2, 
rect.top), "[ ]");
 }
 
 void

Modified: trunk/pingus/src/components/choice_box.cpp
===================================================================
--- trunk/pingus/src/components/choice_box.cpp  2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/choice_box.cpp  2008-07-16 19:02:18 UTC (rev 
3841)
@@ -37,12 +37,12 @@
       if (current_choice >= 0 && current_choice < int(choices.size()))
         {
           //if (current_choice != 0) 
-            gc.print_left(Fonts::chalk_normal,  rect.left,  rect.top, "<");
+          gc.print_left(Fonts::chalk_normal,  Vector2i(rect.left, rect.top), 
"<");
 
             //if (current_choice != int(choices.size())-1)
-            gc.print_right(Fonts::chalk_normal, rect.right, rect.top, ">");
+          gc.print_right(Fonts::chalk_normal, Vector2i(rect.right, rect.top), 
">");
 
-          gc.print_center(Fonts::chalk_normal, rect.left + rect.get_width()/2, 
rect.top, 
+          gc.print_center(Fonts::chalk_normal, Vector2i(rect.left + 
rect.get_width()/2, rect.top), 
                           choices[current_choice]);
         }
     }

Modified: trunk/pingus/src/components/label.cpp
===================================================================
--- trunk/pingus/src/components/label.cpp       2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/label.cpp       2008-07-16 19:02:18 UTC (rev 
3841)
@@ -31,7 +31,7 @@
   if (maintainer_mode)
     gc.draw_rect(rect, Color(0, 255, 255));
 
-  gc.print_left(Fonts::chalk_normal, rect.left, rect.top, label);
+  gc.print_left(Fonts::chalk_normal, Vector2i(rect.left, rect.top), label);
 }
 
 /* EOF */

Modified: trunk/pingus/src/components/menu_button.cpp
===================================================================
--- trunk/pingus/src/components/menu_button.cpp 2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/menu_button.cpp 2008-07-16 19:02:18 UTC (rev 
3841)
@@ -78,12 +78,12 @@
     {
       gc.draw(surface_p,Vector2i(x_pos, y_pos));
       gc.draw(highlight, Vector2i(x_pos, y_pos));
-      gc.print_center(font_large, x_pos, y_pos - 28, text);
+      gc.print_center(font_large, Vector2i(x_pos, y_pos - 28), text);
     }
   else
     {
       gc.draw(surface_p, Vector2i(x_pos, y_pos));
-      gc.print_center(font_large, x_pos, y_pos - 28, text);
+      gc.print_center(font_large, Vector2i(x_pos, y_pos - 28), text);
     }
   UNUSED_ARG(gc);
 }

Modified: trunk/pingus/src/components/pingus_counter.cpp
===================================================================
--- trunk/pingus/src/components/pingus_counter.cpp      2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/components/pingus_counter.cpp      2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -48,7 +48,7 @@
           world->get_pingus()->get_number_of_exited(),
           server->get_plf().get_number_to_save());
 
-  gc.print_center(font, gc.get_width()/2, -1, str);
+  gc.print_center(font, Vector2i(gc.get_width()/2, -1), str);
 }
 
 

Modified: trunk/pingus/src/components/playfield.cpp
===================================================================
--- trunk/pingus/src/components/playfield.cpp   2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/playfield.cpp   2008-07-16 19:02:18 UTC (rev 
3841)
@@ -64,32 +64,27 @@
 
   state.pop(*scene_context);
 
-  gc.draw(new SceneContextDrawingRequest(scene_context.get(), 
Vector3f(0,0,-10000)));
+  gc.draw(new SceneContextDrawingRequest(scene_context.get(), Vector2i(0,0), 
-10000));
 
   gc.push_modelview();
   gc.translate(rect.left, rect.top);
   // Draw the scrolling band
   if (mouse_scrolling && !drag_drop_scrolling)
     {
-      gc.draw_line(mouse_pos.x, mouse_pos.y,
-                   scroll_center.x, scroll_center.y-15,
+      gc.draw_line(mouse_pos, scroll_center - Vector2i(0, 15),
                    Color(0, 255, 0));
 
-      gc.draw_line(mouse_pos.x, mouse_pos.y,
-                   scroll_center.x, scroll_center.y,
-                   Color(255, 0, 0));
-
-      gc.draw_line(mouse_pos.x, mouse_pos.y,
-                   scroll_center.x, scroll_center.y+15,
+      gc.draw_line(mouse_pos, scroll_center + Vector2i(0, 15),
                    Color(0, 0, 255));
 
-      gc.draw_line(mouse_pos.x, mouse_pos.y,
-                   scroll_center.x + 15, scroll_center.y,
+      gc.draw_line(mouse_pos, scroll_center + Vector2i(15, 0),
                    Color(0, 255, 255));
 
-      gc.draw_line(mouse_pos.x, mouse_pos.y,
-                   scroll_center.x - 15, scroll_center.y,
+      gc.draw_line(mouse_pos, scroll_center - Vector2i(15, 0),
                    Color(255, 255, 0));
+
+      gc.draw_line(mouse_pos, scroll_center, 
+                   Color(255, 0, 0));
     }
   gc.pop_modelview();
 }

Modified: trunk/pingus/src/components/slider_box.cpp
===================================================================
--- trunk/pingus/src/components/slider_box.cpp  2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/slider_box.cpp  2008-07-16 19:02:18 UTC (rev 
3841)
@@ -35,21 +35,21 @@
 
   if (value == 0)
     {
-      gc.print_center(Fonts::chalk_normal, rect.left + rect.get_width()/2, 
rect.top, "off");
+      gc.print_center(Fonts::chalk_normal, Vector2i(rect.left + 
rect.get_width()/2, rect.top), "off");
     }
   else
     {
       for(int i = 0; i < 20; ++i)
         {
           if (i < value)
-            gc.print_left(Fonts::chalk_normal, rect.left + 
i*(rect.get_width()-12)/20 + 6, rect.top, "l");
+            gc.print_left(Fonts::chalk_normal, Vector2i(rect.left + 
i*(rect.get_width()-12)/20 + 6, rect.top), "l");
           //gc.print_left(Fonts::chalk_normal, rect.left + 
i*(rect.get_width()-12)/20 + 6, rect.top, "l");
         }
     }
   
-  gc.print_left(Fonts::chalk_normal, rect.left, rect.top, 
+  gc.print_left(Fonts::chalk_normal, Vector2i(rect.left, rect.top), 
                 "[");
-  gc.print_right(Fonts::chalk_normal, rect.right, rect.top, 
+  gc.print_right(Fonts::chalk_normal, Vector2i(rect.right, rect.top), 
                  "]");
 }
 

Modified: trunk/pingus/src/components/smallmap.cpp
===================================================================
--- trunk/pingus/src/components/smallmap.cpp    2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/components/smallmap.cpp    2008-07-16 19:02:18 UTC (rev 
3841)
@@ -81,8 +81,7 @@
     }
   
   gc.draw(image->get_surface(), Vector2i(rect.left, rect.top));
-  gc.draw_rect(view_rect.left, view_rect.top, view_rect.right, 
view_rect.bottom,
-               Color(0, 255, 0));
+  gc.draw_rect(view_rect, Color(0, 255, 0));
 
   server->get_world()->draw_smallmap(this);
 
@@ -93,7 +92,7 @@
       int x = static_cast<int>(rect.left + ((*i)->get_x() * rect.get_width()  
/ world->get_width()));
       int y = static_cast<int>(rect.top + ((*i)->get_y() * rect.get_height() / 
world->get_height()));
 
-      gc.draw_line(x, y, x, y-2, Color(255, 255, 0));
+      gc.draw_line(Vector2i(x, y), Vector2i(x, y-2), Color(255, 255, 0));
     }
 
   gc_ptr = 0;

Modified: trunk/pingus/src/components/time_display.cpp
===================================================================
--- trunk/pingus/src/components/time_display.cpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/components/time_display.cpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -58,7 +58,7 @@
           time_string = StringUtil::to_string(time_value);
         }
 
-      gc.print_right(font, Display::get_width() - 30, 3, time_string, 150);
+      gc.print_right(font, Vector2i(Display::get_width() - 30, 3), 
time_string, 150);
     }
 }
 

Modified: trunk/pingus/src/credits.cpp
===================================================================
--- trunk/pingus/src/credits.cpp        2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/credits.cpp        2008-07-16 19:02:18 UTC (rev 3841)
@@ -266,13 +266,13 @@
     for(int x = 0; x < gc.get_width(); x += background.get_width())
       gc.draw(background, x, y);
 
-  gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
+  gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
 
   gc.draw(pingu, Vector2i(gc.get_width()/2, gc.get_height()/2 - 20));
   
   gc.print_right(Fonts::chalk_normal,
-                Display::get_width()/2 + 275,
-                Display::get_height()/2 + 110,
+                 Vector2i(Display::get_width()/2 + 275,
+                          Display::get_height()/2 + 110),
                 _("Exit"));
   
   yof = 0;
@@ -287,11 +287,11 @@
       switch ((*i)[0])
        {
        case '-':
-         scene_context->color().print_center(font, x, (y + yof), i->substr(1));
+         scene_context->color().print_center(font, Vector2i(x, (y + yof)), 
i->substr(1));
          yof += font.get_height() + 5;
          break;
        case '_':
-         scene_context->color().print_center(font_small, x, (y + yof), 
i->substr(1));
+         scene_context->color().print_center(font_small, Vector2i(x, (y + 
yof)), i->substr(1));
          yof += font_small.get_height() + 5;
          break;
        case 'n':
@@ -302,7 +302,7 @@
          break;
        }
     }
-  gc.draw(new SceneContextDrawingRequest(scene_context, Vector3f(0,0,100)));
+  gc.draw(new SceneContextDrawingRequest(scene_context, Vector2i(0,0), 100));
 }
 
 void

Modified: trunk/pingus/src/display/delta_framebuffer.cpp
===================================================================
--- trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -32,7 +32,7 @@
   {}
 
   virtual void render(Framebuffer& fb) =0;
-  virtual Rect get_region() const =0;
+  virtual void mark_changed_regions(std::vector<Rect>& update_rects) const =0;
 
   bool equal(DrawOp* op) const;
 };
@@ -56,8 +56,8 @@
     fb.draw_surface(surface, rect, pos);
   }
   
-  Rect get_region() const {
-    return Rect(pos, rect.get_size());
+  void mark_changed_regions(std::vector<Rect>& update_rects) const {
+    update_rects.push_back(Rect(pos, rect.get_size()));
   }
 
   bool operator==(const SurfaceDrawOp& rhs) const {
@@ -83,8 +83,8 @@
     fb.fill_rect(rect, color);
   }
   
-  Rect get_region() const {
-    return rect;
+  void mark_changed_regions(std::vector<Rect>& update_rects) const {
+    update_rects.push_back(rect);
   }
 
   bool operator==(const FillRectDrawOp& rhs) const {
@@ -93,7 +93,34 @@
       color == rhs.color;
   }
 };
+
 
+struct DrawRectDrawOp : public DrawOp
+{
+  Rect  rect;
+  Color color;
+  
+  DrawRectDrawOp(const Rect& rect_, const Color& color_)
+    : DrawOp(FILLRECT_DRAWOP),
+      rect(rect_),
+      color(color_)
+  {}
+
+  void render(Framebuffer& fb) {
+    fb.draw_rect(rect, color);
+  }
+  
+  void mark_changed_regions(std::vector<Rect>& update_rects) const {
+    update_rects.push_back(rect);
+  }
+
+  bool operator==(const DrawRectDrawOp& rhs) const {
+    return 
+      rect  == rhs.rect &&
+      color == rhs.color;
+  }
+};
+
 int calculate_area(const std::vector<Rect>& rects)
 {
   int area = 0;
@@ -178,11 +205,11 @@
     // FIXME: This is kind of a slow brute force approach
     for(DrawOps::const_iterator i = backbuffer.draw_ops.begin(); i != 
backbuffer.draw_ops.end(); ++i)
       if (!frontbuffer.has_op(*i))
-        changed_regions.push_back((*i)->get_region());
+        (*i)->mark_changed_regions(changed_regions);
 
     for(DrawOps::const_iterator i = frontbuffer.draw_ops.begin(); i != 
frontbuffer.draw_ops.end(); ++i)
       if (!backbuffer.has_op(*i))
-        changed_regions.push_back((*i)->get_region());
+        (*i)->mark_changed_regions(changed_regions);
   }
  
   void render(SDLFramebuffer& fb, DrawOpBuffer& frontbuffer) 
@@ -303,7 +330,7 @@
 void
 DeltaFramebuffer::draw_rect(const Rect& rect, const Color& color)
 {
-  framebuffer->draw_rect(rect, color);
+  backbuffer->add(new DrawRectDrawOp(rect, color));
 }
 
 void

Modified: trunk/pingus/src/display/drawing_context.cpp
===================================================================
--- trunk/pingus/src/display/drawing_context.cpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/display/drawing_context.cpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -38,12 +38,10 @@
   Font font;
   Origin origin;
   std::string text;
-  float x;
-  float y;
 
 public:
-  FontDrawingRequest(Font font_, Origin origin_, const Vector3f& pos, const 
std::string& text_, float z)
-    : DrawingRequest(Vector3f(pos.x, pos.y, z)),
+  FontDrawingRequest(Font font_, Origin origin_, const Vector2i& pos, const 
std::string& text_, float z)
+    : DrawingRequest(pos, z),
       font(font_), 
       origin(origin_),
       text(text_)
@@ -63,8 +61,8 @@
   Sprite sprite;
 
 public:
-  SpriteDrawingRequest(const Sprite& sprite_, const Vector3f& pos_)
-    : DrawingRequest(pos_),
+  SpriteDrawingRequest(const Sprite& sprite_, const Vector2i& pos_, float z_)
+    : DrawingRequest(pos_, z_),
       sprite(sprite_)
   {
   }
@@ -83,7 +81,8 @@
 
 public:
   FillScreenDrawingRequest(const Color& color_) 
-    : DrawingRequest(Vector3f(0, 0, -1000.0f)), color(color_)
+    : DrawingRequest(Vector2i(0, 0), -1000.0f),
+      color(color_)
   {
   }
   virtual ~FillScreenDrawingRequest() {}
@@ -98,17 +97,17 @@
 private:
   Vector2i pos1;
   Vector2i pos2;
-  Color  color;
+  Color    color;
 
 public:
   LineDrawingRequest(const Vector2i& pos1_, 
                      const Vector2i& pos2_, 
                      const Color&  color_,
                      float z)
-    : DrawingRequest(Vector3f(0, 0, z)),
+    : DrawingRequest(Vector2i(0, 0), z),
       pos1(pos1_),
       pos2(pos2_),
-      color(color_)      
+      color(color_)
   {
   }
 
@@ -128,7 +127,7 @@
   
 public:
   RectDrawingRequest(const Rect& rect_, const Color& color_, bool filled_, 
float z)
-    : DrawingRequest(Vector3f(0, 0, z)),
+    : DrawingRequest(Vector2i(0, 0), z),
       d_rect(rect_), color(color_), filled(filled_)
   {}
   
@@ -158,7 +157,7 @@
   
 public:
   DrawingContextDrawingRequest(DrawingContext& dc_, float z)
-    : DrawingRequest(Vector3f(0,0,z)),
+    : DrawingRequest(Vector2i(0,0) ,z),
       dc(dc_)
   {}
   
@@ -175,14 +174,14 @@
   : rect(rect_),
     do_clipping(clip)
 {
-  translate_stack.push_back(Vector3f(0, 0));
+  translate_stack.push_back(Vector2i(0, 0));
 }
 
 DrawingContext::DrawingContext()
   : rect(0, 0, Display::get_width(), Display::get_height()),
     do_clipping(false)
 {
-  translate_stack.push_back(Vector3f(0, 0));
+  translate_stack.push_back(Vector2i(0, 0));
 }
 
 DrawingContext::~DrawingContext()
@@ -259,21 +258,22 @@
 DrawingContext::draw(const Sprite&   sprite,  float x, float y, float z)
 { // FIXME: This should get flattend down to a simple texture draw
   // command for easier sorting after texture-id/alpha
-  draw(new SpriteDrawingRequest(sprite, Vector3f((int)translate_stack.back().x 
+ x,
-                                                 (int)translate_stack.back().y 
+ y,
-                                                  z)));
+  draw(new SpriteDrawingRequest(sprite, Vector2i((int)translate_stack.back().x 
+ x,
+                                                 (int)translate_stack.back().y 
+ y),
+                                z));
 }
 
 void
-DrawingContext::draw_line (int x1, int y1, int x2, int y2, 
-                           const Color& color, float z)
+DrawingContext::draw_line(const Vector2i& pos1, const Vector2i& pos2,
+                          const Color& color, float z)
 {
-  draw(new LineDrawingRequest(Vector2i(int(x1 + translate_stack.back().x), 
int(y1 + translate_stack.back().y)),
-    Vector2i(int(x2 + translate_stack.back().x), int(y2 + 
translate_stack.back().y)), color, z));
+  draw(new LineDrawingRequest(pos1 + translate_stack.back(),
+                              pos2 + translate_stack.back(),
+                              color, z));
 }
 
 void
-DrawingContext::draw_fillrect (const Rect& rect, const Color& color, float z)
+DrawingContext::draw_fillrect(const Rect& rect, const Color& color, float z)
 {
   draw(new RectDrawingRequest(Rect(int(rect.left + translate_stack.back().x), 
                                    int(rect.top + translate_stack.back().y), 
@@ -285,7 +285,7 @@
 }
 
 void
-DrawingContext::draw_rect (const Rect& rect, const Color& color, float z)
+DrawingContext::draw_rect(const Rect& rect, const Color& color, float z)
 {
   draw(new RectDrawingRequest(Rect(int(rect.left + translate_stack.back().x),
                                    int(rect.top + translate_stack.back().y), 
@@ -297,66 +297,12 @@
 }
 
 void
-DrawingContext::draw_fillrect (int x1, int y1, int x2, int y2, 
-                               const Color& color, float z)
-{
-  draw(new RectDrawingRequest(Rect(int(x1 + translate_stack.back().x), int(y1 
+ translate_stack.back().y), 
-                                   int(x2 + translate_stack.back().x), int(y2 
+ translate_stack.back().y)),
-                              color,
-                              true,
-                              z));
-}
-
-void
-DrawingContext::draw_rect (int x1, int y1, int x2, int y2, 
-                           const Color& color, float z)
-{
-  draw(new RectDrawingRequest(Rect(int(x1 + translate_stack.back().x), int(y1 
+ translate_stack.back().y), 
-                                   int(x2 + translate_stack.back().x), int(y2 
+ translate_stack.back().y)),
-                              color,
-                              false,
-                              z));
-}
-
-void
-DrawingContext::draw_pixel (float x_pos, float y_pos, 
-                            const Color& color)
-{
-}
-
-void
-DrawingContext::draw_circle (float x_pos, float y_pos, float radius,
-                             const Color& color)
-{
-}
-
-/** Draws an arc, starting from angle_start to angle_end in
-      counterclockwise direction. Angles are taken in radian */
-void
-DrawingContext::draw_arc (float x_pos, float y_pos, float radius, float 
angle_start, float angle_end,
-                          const Color& color)
-{
-}
-
-void
 DrawingContext::fill_screen(const Color& color)
 {
   draw(new FillScreenDrawingRequest(color));
 }
 
 void
-DrawingContext::rotate(float angel)
-{
-  // FIXME: not implemented
-}
-
-void
-DrawingContext::scale(float x, float y)
-{
-  // FIXME: not implemented
-}
-
-void
 DrawingContext::translate(float x, float y)
 {
   translate_stack.back().x += x;
@@ -380,7 +326,7 @@
 DrawingContext::reset_modelview()
 {
   translate_stack.clear();
-  translate_stack.push_back(Vector3f(0, 0));
+  translate_stack.push_back(Vector2i(0, 0));
 }
 
 Rect
@@ -416,47 +362,44 @@
 }
 
 void
-DrawingContext::print_left (const Font& font_, int x_pos, int y_pos, const 
std::string& str, float z)
+DrawingContext::print_left(const Font& font_, const Vector2i& pos, const 
std::string& str, float z)
 {
   draw(new FontDrawingRequest(font_, 
                               origin_top_left,
-                              Vector3f(x_pos + translate_stack.back().x,
-                                        y_pos + translate_stack.back().y),
+                              pos + translate_stack.back(),
                               str,
                               z));
 }
 
 void
-DrawingContext::print_center (const Font& font_, int x_pos, int y_pos, const 
std::string& str, float z)
+DrawingContext::print_center(const Font& font_, const Vector2i& pos, const 
std::string& str, float z)
 {
   draw(new FontDrawingRequest(font_, 
                               origin_top_center,
-                              Vector3f(x_pos + translate_stack.back().x,
-                                        y_pos + translate_stack.back().y),
+                              pos + translate_stack.back(),
                               str,
                               z));
 }
 
 void
-DrawingContext::print_right (const Font& font_, int x_pos, int y_pos, const 
std::string& str, float z)
+DrawingContext::print_right(const Font& font_, const Vector2i& pos, const 
std::string& str, float z)
 {
   draw(new FontDrawingRequest(font_, 
                               origin_top_right,
-                              Vector3f(x_pos + translate_stack.back().x,
-                                       y_pos + translate_stack.back().y),
+                              pos + translate_stack.back(),
                               str,
                               z));
 }
 
 Vector3f
-DrawingContext::screen_to_world (Vector3f pos)
+DrawingContext::screen_to_world(Vector3f pos)
 {
   return pos - Vector3f(translate_stack.back().x + rect.left,
                         translate_stack.back().y + rect.top);
 }
 
 Vector3f
-DrawingContext::world_to_screen (Vector3f pos)
+DrawingContext::world_to_screen(Vector3f pos)
 {
   return pos + Vector3f(translate_stack.back().x + rect.left, 
                         translate_stack.back().y + rect.top);

Modified: trunk/pingus/src/display/drawing_context.hpp
===================================================================
--- trunk/pingus/src/display/drawing_context.hpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/display/drawing_context.hpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -40,7 +40,7 @@
   typedef std::vector<DrawingRequest*> DrawingRequests;
   DrawingRequests drawingrequests;
 
-  std::vector<Vector3f> translate_stack;
+  std::vector<Vector2i> translate_stack;
 
   /** The rectangle that the DrawingContext uses on the screen */
   Rect rect;
@@ -76,38 +76,14 @@
       queue */
   void fill_screen(const Color& color);
 
-  void draw_line (int x1, int y1, int x2, int y2, 
-                 const Color& color, float z = 0);
-  void draw_fillrect (int x1, int y1, int x2, int y2, 
-                     const Color& color, float z = 0);
-  void draw_rect (int x1, int y1, int x2, int y2, 
-                 const Color& color, float z = 0);
-
-  void draw_fillrect (const Rect& rect,
-                     const Color& color, float z = 0);
-  void draw_rect (const Rect& rect,
-                 const Color& color, float z = 0);
-
-  void draw_pixel (float x_pos, float y_pos, 
-                  const Color& color);
-  void draw_circle (float x_pos, float y_pos, float radius,
-                    const Color& color);
-
-  /** Draws an arc, starting from angle_start to angle_end in
-      counterclockwise direction. Angles are taken in radian */
-  void draw_arc (float x_pos, float y_pos, float radius, float angle_start, 
float angle_end,
-                 const Color& color);
+  void draw_line(const Vector2i& pos1, const Vector2i& pos2, const Color& 
color, float z = 0);
+  void draw_fillrect(const Rect& rect, const Color& color, float z = 0);
+  void draw_rect(const Rect& rect, const Color& color, float z = 0);
   /*} */
 
   /** Translate the drawing context */
   void translate(float x, float y);
 
-  /** Set the rotation of the drawing context */
-  void rotate(float angel);
-
-  /** Set the scaling of the drawing context */
-  void scale(float x, float y);
-
   void push_modelview();
   void pop_modelview();
   void reset_modelview();
@@ -122,13 +98,13 @@
   int get_height() const;
 
   /** Print a text left aligned */
-  void print_left (const Font& font, int x_pos, int y_pos, const std::string& 
str, float z = 0.0f);
+  void print_left(const Font& font, const Vector2i& pos, const std::string& 
str, float z = 0.0f);
 
   /** Print a text centred to the given position */
-  void print_center (const Font& font, int x_pos, int y_pos, const 
std::string& str, float z = 0.0f);
+  void print_center(const Font& font, const Vector2i& pos, const std::string& 
str, float z = 0.0f);
 
   /** Print a text right aligned */
-  void print_right (const Font& font, int x_pos, int y_pos, const std::string& 
str, float z = 0.0f);
+  void print_right(const Font& font, const Vector2i& pos, const std::string& 
str, float z = 0.0f);
 
   Vector3f screen_to_world (Vector3f pos);
   Vector3f world_to_screen (Vector3f pos);

Modified: trunk/pingus/src/display/drawing_request.hpp
===================================================================
--- trunk/pingus/src/display/drawing_request.hpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/display/drawing_request.hpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -18,7 +18,7 @@
 #define HEADER_DRAWING_REQUEST_HPP
 
 #include "SDL.h"
-#include "math/vector3f.hpp"
+#include "math/vector2i.hpp"
 #include "math/rect.hpp"
 
 class Framebuffer;
@@ -26,13 +26,11 @@
 class DrawingRequest
 {
 protected:
-  Vector3f pos;
-  bool     valid;
+  Vector2i pos;
+  float    z;
 
-  std::vector<Rect> dirty_rects;
-
 public:
-  DrawingRequest(const Vector3f& pos_) : pos(pos_), valid(true) {}
+  DrawingRequest(const Vector2i& pos_, float z_) : pos(pos_), z(z_) {}
   virtual ~DrawingRequest() {};
   
   /** \a rect is the rectangle that is managed by the parent
@@ -40,17 +38,13 @@
       (rect.left,rect.top)  */
   virtual void render(Framebuffer& fb, const Rect& rect) = 0;
 
-  virtual void mark(const Rect& r) { dirty_rects.push_back(r); }
-  
   /** Returns true if the request contains an alpha channel and needs
       to be drawn in order */
   virtual bool has_alpha() { return true; }
 
   /** Returns the position at which the request should be drawn */
-  virtual float get_z_pos() { return pos.z; }
+  virtual float get_z_pos() { return z; }
 
-  virtual void set_valid(bool v) { valid = v; }
-  virtual bool is_valid() const { return valid; }
 private:
   DrawingRequest (const DrawingRequest&);
   DrawingRequest& operator= (const DrawingRequest&);

Modified: trunk/pingus/src/display/scene_context.cpp
===================================================================
--- trunk/pingus/src/display/scene_context.cpp  2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/display/scene_context.cpp  2008-07-16 19:02:18 UTC (rev 
3841)
@@ -86,25 +86,7 @@
   impl->highlight.translate(x, y);
 }
 
-/** Set the rotation of the drawing context */
 void
-SceneContext::rotate(float angel)
-{
-  impl->color.rotate(angel);
-  impl->light.rotate(angel);
-  impl->highlight.rotate(angel);
-}
-
-/** Set the scaling of the drawing context */
-void
-SceneContext::scale(float x, float y)
-{
-  impl->color.scale(x, y);
-  impl->light.scale(x, y);
-  impl->highlight.scale(x, y);
-}
-
-void
 SceneContext::push_modelview()
 {
   impl->color.push_modelview();
@@ -190,9 +172,9 @@
   impl->highlight.clear();
 }
 
-SceneContextDrawingRequest::SceneContextDrawingRequest(SceneContext* sc_, 
const Vector3f& pos_) 
-  : DrawingRequest(pos_),
-    sc(sc_)
+SceneContextDrawingRequest::SceneContextDrawingRequest(SceneContext* sc, const 
Vector2i& pos, float z)
+  : DrawingRequest(pos, z),
+    sc(sc)
 {
 }
 

Modified: trunk/pingus/src/display/scene_context.hpp
===================================================================
--- trunk/pingus/src/display/scene_context.hpp  2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/display/scene_context.hpp  2008-07-16 19:02:18 UTC (rev 
3841)
@@ -81,14 +81,14 @@
   SceneContext (const SceneContext&);
   SceneContext& operator= (const SceneContext&);
 };
-
+
 class SceneContextDrawingRequest : public DrawingRequest
 {
 private:
   SceneContext* sc;
 
 public:
-  SceneContextDrawingRequest(SceneContext* sc, const Vector3f& pos_ = 
Vector3f(0,0,0));
+  SceneContextDrawingRequest(SceneContext* sc, const Vector2i& pos, float z);
   virtual ~SceneContextDrawingRequest();
   void render(Framebuffer& fb, const Rect& render);
 };

Modified: trunk/pingus/src/display/sdl_framebuffer.cpp
===================================================================
--- trunk/pingus/src/display/sdl_framebuffer.cpp        2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/display/sdl_framebuffer.cpp        2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -326,6 +326,8 @@
 void
 SDLFramebuffer::draw_rect(const Rect& rect, const Color& color)
 {
+  assert(rect.is_normal());
+
   draw_line(Vector2i(rect.left,    rect.top),      Vector2i(rect.right-1, 
rect.top),      color);
   draw_line(Vector2i(rect.left,    rect.bottom-1), Vector2i(rect.right-1, 
rect.bottom-1), color);
   draw_line(Vector2i(rect.left,    rect.top),      Vector2i(rect.left,    
rect.bottom-1), color);
@@ -333,10 +335,9 @@
 }
 
 void
-SDLFramebuffer::fill_rect(const Rect& rect_, const Color& color)
+SDLFramebuffer::fill_rect(const Rect& rect, const Color& color)
 {
-  Rect rect = rect_;
-  rect.normalize();
+  assert(rect.is_normal());
 
   if (color.a == 255)
     {

Modified: trunk/pingus/src/editor/button.cpp
===================================================================
--- trunk/pingus/src/editor/button.cpp  2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/editor/button.cpp  2008-07-16 19:02:18 UTC (rev 3841)
@@ -43,7 +43,7 @@
     }
 
   gc.print_center(Fonts::verdana11, 
-                  rect.left + rect.get_width()/2, rect.top + 
rect.get_height()/2 - 6,
+                  Vector2i(rect.left + rect.get_width()/2, rect.top + 
rect.get_height()/2 - 6),
                   text);
 }
 

Modified: trunk/pingus/src/editor/checkbox.cpp
===================================================================
--- trunk/pingus/src/editor/checkbox.cpp        2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/checkbox.cpp        2008-07-16 19:02:18 UTC (rev 
3841)
@@ -41,8 +41,8 @@
 
   if (!label.empty())
     gc.print_center(Fonts::verdana11, 
-                    rect.left + rect.get_width()/2, 
-                    rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2, 
+                    Vector2i(rect.left + rect.get_width()/2, 
+                             rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2), 
                     label);
 }
 

Modified: trunk/pingus/src/editor/combobox.cpp
===================================================================
--- trunk/pingus/src/editor/combobox.cpp        2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/combobox.cpp        2008-07-16 19:02:18 UTC (rev 
3841)
@@ -103,8 +103,9 @@
 
     if (current_item != -1)
       {
-        gc.print_left(Fonts::verdana11, rect.left + 5, 
-                      rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2,
+        gc.print_left(Fonts::verdana11, 
+                      Vector2i(rect.left + 5, 
+                               rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2),
                       item_list[current_item].label);
       }
   }
@@ -121,8 +122,8 @@
                              Color(150,200,255), 95);
 
           gc.print_left(Fonts::verdana11, 
-                        list_rect.left + 5, 
-                        list_rect.top + i * rect.get_height() + 
rect.get_height()/2 - Fonts::verdana11.get_height()/2,
+                        Vector2i(list_rect.left + 5, 
+                                 list_rect.top + i * rect.get_height() + 
rect.get_height()/2 - Fonts::verdana11.get_height()/2),
                         item_list[i].label, 100);
         }
 

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/editor_screen.cpp   2008-07-16 19:02:18 UTC (rev 
3841)
@@ -161,25 +161,25 @@
   if (show_help)
     {
       Size size(600, 400);
-      gc.draw_fillrect(int(gc.get_width()/2)  - size.width/2 - 2,
-                       int(gc.get_height()/2) - size.height/2 - 2,
-                       int(gc.get_width()/2)  + size.width/2 + 2,
-                       int(gc.get_height()/2) + size.height/2 + 2,
+      gc.draw_fillrect(Rect(gc.get_width()/2  - size.width/2 - 2,
+                            gc.get_height()/2 - size.height/2 - 2,
+                            gc.get_width()/2  + size.width/2 + 2,
+                            gc.get_height()/2 + size.height/2 + 2),
                        Color(0,0,0));
-      gc.draw_fillrect(int(gc.get_width()/2)  - size.width/2, 
-                       int(gc.get_height()/2) - size.height/2,
-                       int(gc.get_width()/2)  + size.width/2, 
-                       int(gc.get_height()/2) + size.height/2,
+      gc.draw_fillrect(Rect(gc.get_width()/2  - size.width/2, 
+                            gc.get_height()/2 - size.height/2,
+                            gc.get_width()/2  + size.width/2, 
+                            gc.get_height()/2 + size.height/2),
                        Color(255,255,255));
       
       gc.print_center(Fonts::verdana11,
-                      int(gc.get_width()/2),
-                      int(gc.get_height()/2) - size.height/2 + 12,
+                      Vector2i(gc.get_width()/2,
+                               gc.get_height()/2 - size.height/2 + 12),
                       "Editor Help");
 
-      int x = int(gc.get_width()/2 - size.width/2 + 12);
-      int y = int(gc.get_height()/2) - size.height/2 + 36;
-      gc.print_center(Fonts::verdana11, x + 50, y,
+      int x = gc.get_width()/2 - size.width/2 + 12;
+      int y = gc.get_height()/2 - size.height/2 + 36;
+      gc.print_center(Fonts::verdana11, Vector2i(x + 50, y),
                       "A\n"
                       "Shift+A\n"
                       "], w\n"
@@ -190,7 +190,7 @@
                       "Shift+R\n"
                       );
 
-      gc.print_left(Fonts::verdana11, x+100, y,
+      gc.print_left(Fonts::verdana11, Vector2i(x+100, y),
                     _("Select all\n"
                       "Clear Selection\n"
                       "Raise objects\n"
@@ -202,7 +202,7 @@
 
       x = int(gc.get_width()/2 + 12);
       y = int(gc.get_height()/2) - size.height/2 + 36;
-      gc.print_center(Fonts::verdana11, x + 50, y,
+      gc.print_center(Fonts::verdana11, Vector2i(x + 50, y),
                       "F\n"
                       "Shift+F\n"
                       "Delete\n"
@@ -212,7 +212,7 @@
                       "l\n"
                       );
 
-      gc.print_left(Fonts::verdana11, x + 100, y,
+      gc.print_left(Fonts::verdana11, Vector2i(x + 100, y),
                     _("Flip object horizontaly\n"
                       "Flip object vertically\n"
                       "Delete all marked objects\n"
@@ -223,8 +223,8 @@
                     );
 
       gc.print_left(Fonts::verdana11,
-                    int(gc.get_width()/2 - size.width/2 + 12),
-                    int(gc.get_height()/2) - 10,
+                    Vector2i(gc.get_width()/2 - size.width/2 + 12,
+                             gc.get_height()/2 - 10),
                     _("You should name your level files systematically, i.e. 
by their theme, "
                       "their number and your nickname:\n\n"
                       "     <levelname><number>-<creator>.pingus\n\n"

Modified: trunk/pingus/src/editor/file_dialog.cpp
===================================================================
--- trunk/pingus/src/editor/file_dialog.cpp     2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/file_dialog.cpp     2008-07-16 19:02:18 UTC (rev 
3841)
@@ -95,8 +95,8 @@
 {
   // Window border and title 
   GUIStyle::draw_raised_box(gc, Rect(0,0,rect.get_width(), rect.get_height()));
-  gc.draw_fillrect(4,4,rect.get_width()-4, 30, Color(77,130,180));
-  gc.print_center(Fonts::pingus_small, rect.get_width()/2, 2, 
+  gc.draw_fillrect(Rect(4,4,rect.get_width()-4, 30), Color(77,130,180));
+  gc.print_center(Fonts::pingus_small, Vector2i(rect.get_width()/2, 2), 
                   mode == LOAD ? _("Open a level") : _("Save your level"));
 }
   

Modified: trunk/pingus/src/editor/file_list.cpp
===================================================================
--- trunk/pingus/src/editor/file_list.cpp       2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/file_list.cpp       2008-07-16 19:02:18 UTC (rev 
3841)
@@ -102,12 +102,12 @@
           (i - directory.begin()) == click_item)
         {
           if (click_item == current_item)
-            gc.draw_fillrect(x, y, x + hspace, y + vspace, Color(0, 0, 255));
+            gc.draw_fillrect(Rect(x, y, x + hspace, y + vspace), Color(0, 0, 
255));
           else
-            gc.draw_rect(x, y, x + hspace, y + vspace, Color(0, 0, 255));
+            gc.draw_rect(Rect(x, y, x + hspace, y + vspace), Color(0, 0, 255));
         }
       
-      gc.print_left(Fonts::verdana11, x + 4, y + 3,
+      gc.print_left(Fonts::verdana11, Vector2i(x + 4, y + 3),
                     ((i->type == System::DE_DIRECTORY) ? "[DIR]  " : "[FILE] 
") + i->name);
 
       y += 20;

Modified: trunk/pingus/src/editor/gui_style.cpp
===================================================================
--- trunk/pingus/src/editor/gui_style.cpp       2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/gui_style.cpp       2008-07-16 19:02:18 UTC (rev 
3841)
@@ -22,11 +22,10 @@
 GUIStyle::draw_raised_box(DrawingContext& gc, const Rect& rect, const Color& 
color, int border)
 {
   // FIXME: Should use draw_line
-  gc.draw_fillrect(rect.left, rect.top, rect.right, rect.bottom,
-                   Color(255, 255, 255));
-  gc.draw_fillrect(rect.left+border, rect.top+border, rect.right, rect.bottom,
-                          Color(169, 157, 140));
-  gc.draw_fillrect(rect.left+border, rect.top+border, rect.right-border, 
rect.bottom-border,
+  gc.draw_fillrect(rect, Color(255, 255, 255));
+  gc.draw_fillrect(Rect(rect.left+border, rect.top+border, rect.right, 
rect.bottom),
+                   Color(169, 157, 140));
+  gc.draw_fillrect(Rect(rect.left+border, rect.top+border, rect.right-border, 
rect.bottom-border),
                    color);
 }
 
@@ -34,11 +33,11 @@
 GUIStyle::draw_lowered_box(DrawingContext& gc, const Rect& rect, const Color& 
color, int border)
 {
   // FIXME: Should use draw_line
-  gc.draw_fillrect(rect.left, rect.top, rect.right, rect.bottom,
+  gc.draw_fillrect(rect,
                    Color(169, 157, 140));
-  gc.draw_fillrect(rect.left+border, rect.top+border, rect.right, rect.bottom,
+  gc.draw_fillrect(Rect(rect.left+border, rect.top+border, rect.right, 
rect.bottom),
                    Color(255, 255, 255));
-  gc.draw_fillrect(rect.left+border, rect.top+border, rect.right-border, 
rect.bottom-border,
+  gc.draw_fillrect(Rect(rect.left+border, rect.top+border, rect.right-border, 
rect.bottom-border),
                    color);  
 }
 

Modified: trunk/pingus/src/editor/inputbox.cpp
===================================================================
--- trunk/pingus/src/editor/inputbox.cpp        2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/inputbox.cpp        2008-07-16 19:02:18 UTC (rev 
3841)
@@ -32,8 +32,9 @@
   gc.draw_fillrect(rect, Color(255,255,255));
   gc.draw_rect(rect, has_focus() ? Color(255,128,0) : Color(0,0,0));
   
-  gc.print_left(Fonts::verdana11, rect.left + 5, 
-                rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2,
+  gc.print_left(Fonts::verdana11, 
+                Vector2i(rect.left + 5, 
+                         rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2),
                 text);
 }
 

Modified: trunk/pingus/src/editor/label.cpp
===================================================================
--- trunk/pingus/src/editor/label.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/editor/label.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -29,7 +29,8 @@
 void
 Label::draw (DrawingContext& gc)
 {
-  gc.print_left(Fonts::verdana11, rect.left, rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2,
+  gc.print_left(Fonts::verdana11, 
+                Vector2i(rect.left, rect.top + rect.get_height()/2 - 
Fonts::verdana11.get_height()/2),
                 text);
 }
 

Modified: trunk/pingus/src/editor/object_selector.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector.cpp 2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/editor/object_selector.cpp 2008-07-16 19:02:18 UTC (rev 
3841)
@@ -240,7 +240,7 @@
                  rect.left + 17 + t_w/2 + 4, rect.top + 38 + 
Fonts::verdana11.get_height() + 2);
         gc.draw_fillrect(t_r, Color(255, 255, 200), 1000.0f);
         gc.draw_rect(t_r, Color(0,0,0), 1000.0f);
-        gc.print_center(Fonts::verdana11, rect.left + 17, rect.top + 38, 
tooltip, 1000.0f);
+        gc.print_center(Fonts::verdana11, Vector2i(rect.left + 17, rect.top + 
38), tooltip, 1000.0f);
       }
   }
 

Modified: trunk/pingus/src/editor/object_selector_list.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector_list.cpp    2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/editor/object_selector_list.cpp    2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -66,18 +66,18 @@
 
           gc.draw((*i)->thumbnail, Vector2i(x * 48, y * 48));
 
-          gc.draw_rect(x * 48,      y * 48, 
-                       x * 48 + 48, y * 48 + 48, 
+          gc.draw_rect(Rect(x * 48,      y * 48, 
+                            x * 48 + 48, y * 48 + 48), 
                        Color(155,155,155));
 
           if (has_mouse_over() && current_object != -1 && (i - 
set->get_objects().begin()) == current_object)
             {
-              gc.draw_fillrect(x * 48,      y * 48, 
-                               x * 48 + 48, y * 48 + 48, 
+              gc.draw_fillrect(Rect(x * 48,      y * 48, 
+                                    x * 48 + 48, y * 48 + 48), 
                                Color(255,255,255, 100));
 
-              gc.draw_rect(x * 48,      y * 48, 
-                           x * 48 + 48, y * 48 + 48, 
+              gc.draw_rect(Rect(x * 48,      y * 48, 
+                                x * 48 + 48, y * 48 + 48), 
                            Color(255,255,255));
             }
         }

Modified: trunk/pingus/src/editor/panel.cpp
===================================================================
--- trunk/pingus/src/editor/panel.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/editor/panel.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -96,7 +96,7 @@
                  pos.x + 17 + t_w/2 + 4, pos.y + 38 + 
Fonts::verdana11.get_height() + 2);
         gc.draw_fillrect(t_r, Color(255, 255, 200), 1000.0f);
         gc.draw_rect(t_r, Color(0,0,0), 1000.0f);
-        gc.print_center(Fonts::verdana11, pos.x + 17, pos.y + 38, tooltip, 
1000.0f);
+        gc.print_center(Fonts::verdana11, Vector2i(pos.x + 17, pos.y + 38), 
tooltip, 1000.0f);
       }
   }
 
@@ -217,9 +217,9 @@
 Panel::draw (DrawingContext& gc)
 {
   // FIXME: Could use draw_line
-  gc.draw_fillrect(0, 0, Display::get_width(), 38, Color(255, 255, 255));
-  gc.draw_fillrect(1, 1, Display::get_width(), 38, Color(169, 157, 140));
-  gc.draw_fillrect(1, 1, Display::get_width()-1, 37, Color(237, 233, 227));
+  gc.draw_fillrect(Rect(0, 0, Display::get_width(), 38),   Color(255, 255, 
255));
+  gc.draw_fillrect(Rect(1, 1, Display::get_width(), 38),   Color(169, 157, 
140));
+  gc.draw_fillrect(Rect(1, 1, Display::get_width()-1, 37), Color(237, 233, 
227));
 }
 
 void

Modified: trunk/pingus/src/font_test_screen.cpp
===================================================================
--- trunk/pingus/src/font_test_screen.cpp       2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/font_test_screen.cpp       2008-07-16 19:02:18 UTC (rev 
3841)
@@ -43,16 +43,16 @@
     for(int x = 0; x < gc.get_width()/checker; x += 1)
       {
         if ((x+y) % 2 != 0)
-          gc.draw_fillrect(x*checker, y*checker,
-                           x*checker + checker, y*checker + checker,
+          gc.draw_fillrect(Rect(x*checker, y*checker,
+                                x*checker + checker, y*checker + checker),
                            dark ? Color(50, 50, 50) : Color(255, 255, 255));
         else
-          gc.draw_fillrect(x*checker, y*checker,
-                           x*checker + checker, y*checker + checker,
+          gc.draw_fillrect(Rect(x*checker, y*checker,
+                                x*checker + checker, y*checker + checker),
                            dark ? Color(0, 0, 0) : Color(200,200,200));
       }
 
-  gc.print_left(Fonts::chalk_large, 10, 10, "Pingus - Font Test");
+  gc.print_left(Fonts::chalk_large, Vector2i(10, 10), "Pingus - Font Test");
 
   gc.push_modelview();
   gc.translate(scrollx, scrolly);
@@ -64,34 +64,33 @@
 
       // print the actual character
       gc.print_left(reference,
-                   x,
-                   y - reference.get_height(),
+                   Vector2i(x,
+                             y - reference.get_height()),
                     std::string(1, char(i)));
       // print the index number
       gc.print_left(reference,
-                   x, 
-                   y + font.get_height(),
+                   Vector2i(x, 
+                             y + font.get_height()),
                    StringUtil::to_string(i));
       
       if (font.get_width(char(i)))
         {
-          gc.draw_rect(x, y, 
-                       x+font.get_height(), 
-                       y+font.get_height(), 
+          gc.draw_rect(Rect(x, y, 
+                            x+font.get_height(), 
+                            y+font.get_height()), 
                        Color(0,0,255));
-          gc.draw_rect(x, y, 
-                       x+font.get_width(char(i)), 
-                       y+font.get_height(), 
+          gc.draw_rect(Rect(x, y, 
+                            x+font.get_width(char(i)), 
+                            y+font.get_height()), 
                        Color(255,0,255));
-          gc.print_left(font,
-                        x, y,
+          gc.print_left(font, Vector2i(x, y),
                         std::string(1, char(i)));
         }
       else
         {
-          gc.draw_rect(x, y, 
-                       x+font.get_height(), 
-                       y+font.get_height(), 
+          gc.draw_rect(Rect(x, y, 
+                            x+font.get_height(), 
+                            y+font.get_height()), 
                        Color(255,0,0));
         }
     }

Modified: trunk/pingus/src/game_session.cpp
===================================================================
--- trunk/pingus/src/game_session.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/game_session.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -172,16 +172,16 @@
     { // Draw a black border around the playfield when the playfield is 
smaller then the screen
       Color border_color(0, 0, 0);
       // top
-      gc.draw_fillrect(0, 0, Display::get_width(), rect.top,
+      gc.draw_fillrect(Rect(0, 0, Display::get_width(), rect.top),
                        border_color);
       // bottom
-      gc.draw_fillrect(0, rect.bottom, Display::get_width(), 
Display::get_height(),
+      gc.draw_fillrect(Rect(0, rect.bottom, Display::get_width(), 
Display::get_height()),
                        border_color);
       // left
-      gc.draw_fillrect(0, rect.top, rect.left, rect.bottom,
+      gc.draw_fillrect(Rect(0, rect.top, rect.left, rect.bottom),
                        border_color);
       // right
-      gc.draw_fillrect(rect.right, rect.top, Display::get_width(), rect.bottom,
+      gc.draw_fillrect(Rect(rect.right, rect.top, Display::get_width(), 
rect.bottom),
                        border_color);
     }
 }

Modified: trunk/pingus/src/graphic_context_state.cpp
===================================================================
--- trunk/pingus/src/graphic_context_state.cpp  2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/graphic_context_state.cpp  2008-07-16 19:02:18 UTC (rev 
3841)
@@ -86,12 +86,6 @@
   gc.push_modelview();
 
   gc.translate((float)impl->rect.left, (float)impl->rect.top);
-
-  gc.translate((float)get_width()/2, (float)get_height()/2);
-  gc.rotate(impl->rotation);
-  gc.translate(-(float)get_width()/2, -(float)get_height()/2);
-
-  gc.scale(get_zoom(), get_zoom());
   gc.translate(impl->offset.x, impl->offset.y);
 }
 
@@ -101,12 +95,6 @@
   gc.push_modelview();
 
   gc.translate((float)impl->rect.left, (float)impl->rect.top);
-
-  gc.translate((float)get_width()/2, (float)get_height()/2);
-  gc.rotate(impl->rotation);
-  gc.translate(-(float)get_width()/2, -(float)get_height()/2);
-
-  gc.scale(get_zoom(), get_zoom());
   gc.translate(impl->offset.x, impl->offset.y);
 }
 

Modified: trunk/pingus/src/ground_map.cpp
===================================================================
--- trunk/pingus/src/ground_map.cpp     2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/ground_map.cpp     2008-07-16 19:02:18 UTC (rev 3841)
@@ -135,10 +135,10 @@
         else
           {
             if (0 /*pingus_debug_flags & PINGUS_DEBUG_TILES*/)
-              gc.color().draw_fillrect(x * tile_size,
-                                       y * tile_size,
-                                       x * tile_size + tile_size,
-                                       y * tile_size + tile_size,
+              gc.color().draw_fillrect(Rect(x * tile_size,
+                                            y * tile_size,
+                                            x * tile_size + tile_size,
+                                            y * tile_size + tile_size),
                                        Color(255, 0, 0, 75));
           }
       }

Modified: trunk/pingus/src/gui/checkbox.cpp
===================================================================
--- trunk/pingus/src/gui/checkbox.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/gui/checkbox.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -25,39 +25,39 @@
 namespace GUI {
        
 Checkbox::Checkbox(Vector2i p, std::string label_, CheckboxListener* l) :
-       checkmark("core/misc/checkbox_clicked"),
-       is_checked(false),
-       pos(p),
-       width(20),
-       height(20),
-       listener(l),
-       label(label_)
+  checkmark("core/misc/checkbox_clicked"),
+  is_checked(false),
+  pos(p),
+  width(20),
+  height(20),
+  listener(l),
+  label(label_)
 {
 }
        
 void 
 Checkbox::draw(DrawingContext& gc)
 {
-       gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y + height, 
-                     Color(0,0,0));
-       if (is_checked)
-               gc.draw(checkmark, pos);
+  gc.draw_rect(Rect(pos.x, pos.y, pos.x + width, pos.y + height), 
+               Color(0,0,0));
+  if (is_checked)
+    gc.draw(checkmark, pos);
        
-       gc.print_right(Fonts::pingus_small, pos.x, pos.y, label);
+  gc.print_right(Fonts::pingus_small, pos, label);
 }
 
 bool
 Checkbox::is_at(int x, int y)
 {
-       return (x > pos.x && x < pos.x + width &&
-               y > pos.y && y < pos.y + height);
+  return (x > pos.x && x < pos.x + width &&
+          y > pos.y && y < pos.y + height);
 }
 
 void 
 Checkbox::on_primary_button_click(int x, int y)
 {
-       is_checked = !is_checked;
-       listener->checkbox_changed(is_checked, this);
+  is_checked = !is_checked;
+  listener->checkbox_changed(is_checked, this);
 }
 
 }      // GUI namespace

Modified: trunk/pingus/src/gui/combobox.cpp
===================================================================
--- trunk/pingus/src/gui/combobox.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/gui/combobox.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -137,27 +137,27 @@
     return;
        
   // Draw the label
-  gc.print_right(Fonts::pingus_small, pos.x, pos.y, label);
+  gc.print_right(Fonts::pingus_small, pos, label);
 
   // Draw the rectangle
-  gc.draw_fillrect(pos.x, pos.y, pos.x + get_width(), pos.y + get_height(),
+  gc.draw_fillrect(Rect(pos.x, pos.y, pos.x + get_width(), pos.y + 
get_height()),
                    Color(255,255,255));
 
   // Next, draw the rectangle border
-  gc.draw_rect(pos.x, pos.y, pos.x + get_width(), pos.y + get_height(),
+  gc.draw_rect(Rect(pos.x, pos.y, pos.x + get_width(), pos.y + get_height()),
                Color(0,0,0));
 
   if (drop_down && item_list.size() > 0)
     {
       // Draw the highlighted box
       int y_offset = (((mouse_pos.y - pos.y - height)/height)+1) * height;
-      gc.draw_fillrect(pos.x, pos.y + y_offset, pos.x + get_width(), pos.y + 
y_offset + 
-                       height, Color(128,128,128));
+      gc.draw_fillrect(Rect(pos.x, pos.y + y_offset, pos.x + get_width(), 
pos.y + y_offset + height),
+                       Color(128,128,128));
                
       // Draw all of the items
       for (unsigned i = 0; i < item_list.size(); i++)
         {
-          gc.print_left(Fonts::pingus_small, pos.x + 5, pos.y + ((i + 1) * 
height), 
+          gc.print_left(Fonts::pingus_small, Vector2i(pos.x + 5, pos.y + ((i + 
1) * height)), 
                         item_list[i]->get_displayed_string());
         }
     }
@@ -165,7 +165,7 @@
   if (current_item)
     {
       // Print the currently selected item
-      gc.print_left(Fonts::pingus_small, pos.x + 3, pos.y, 
current_item->get_displayed_string());
+      gc.print_left(Fonts::pingus_small, Vector2i(pos.x + 3, pos.y), 
current_item->get_displayed_string());
     }
 }
 

Modified: trunk/pingus/src/gui/input_box.cpp
===================================================================
--- trunk/pingus/src/gui/input_box.cpp  2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/gui/input_box.cpp  2008-07-16 19:02:18 UTC (rev 3841)
@@ -37,21 +37,23 @@
 InputBox::draw(DrawingContext &gc)
 {
   // Draw the rectangle and border
-  gc.draw_fillrect(pos.x, pos.y, pos.x + width, pos.y + height, 
+  gc.draw_fillrect(Rect(pos.x, pos.y, pos.x + width, pos.y + height), 
                    Color(0,0,0));
-  gc.draw_rect(pos.x, pos.y, pos.x + width, pos.y + height, 
Color(255,255,255));       
+  gc.draw_rect(Rect(pos.x, pos.y, pos.x + width, pos.y + height), 
Color(255,255,255)); 
 
   // If there is text, draw it:
   if (str != std::string())
-    gc.print_left(Fonts::pingus_small, pos.x + 10, pos.y, shrink_string(str));
+    gc.print_left(Fonts::pingus_small, Vector2i(pos.x + 10, pos.y), 
shrink_string(str));
 
   if (label != std::string())
-    gc.print_right(Fonts::pingus_small, pos.x, pos.y, label);
+    gc.print_right(Fonts::pingus_small, pos, label);
      
   if (has_focus())
-    gc.draw_line(pos.x + 
Fonts::pingus_small.get_size(shrink_string(str)).width + 12,
-                 pos.y, pos.x + 
Fonts::pingus_small.get_size(shrink_string(str)).width + 12, 
-                 pos.y + height,       Color(0,255,255));
+    gc.draw_line(Vector2i(pos.x + 
Fonts::pingus_small.get_size(shrink_string(str)).width + 12,
+                          pos.y), 
+                 Vector2i(pos.x + 
Fonts::pingus_small.get_size(shrink_string(str)).width + 12, 
+                          pos.y + height),
+                 Color(0,255,255));
 }
 
 bool

Modified: trunk/pingus/src/level_menu.cpp
===================================================================
--- trunk/pingus/src/level_menu.cpp     2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/level_menu.cpp     2008-07-16 19:02:18 UTC (rev 3841)
@@ -52,7 +52,7 @@
 
   void draw(DrawingContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos, _("Abort"));
+    gc.print_center(Fonts::chalk_normal, Vector2i(x_pos + 55, y_pos), 
_("Abort"));
   }
 
   void on_click() {
@@ -132,7 +132,7 @@
     gc.push_modelview();
     gc.translate(static_cast<float>(rect.left), static_cast<float>(rect.top));
 
-    gc.print_center(Fonts::chalk_large, rect.get_width()/2, -50, 
_("Levelsets"));
+    gc.print_center(Fonts::chalk_large, Vector2i(rect.get_width()/2, -50), 
_("Levelsets"));
 
     //gc.draw_fillrect(Rect(Vector2i(0,0), Size(rect.get_width(), 
rect.get_height())),
     //                 Color(255, 255, 0, 100));
@@ -147,11 +147,11 @@
 
         gc.draw(levelset->get_image(), Vector2i(30, y));
 
-        gc.print_left(Fonts::chalk_normal, 85+30, 15 + y, 
_(levelset->get_title()));
-        gc.print_left(Fonts::chalk_small,  85+50, 40 + y, 
_(levelset->get_description()));
+        gc.print_left(Fonts::chalk_normal, Vector2i(85+30, 15 + y), 
_(levelset->get_title()));
+        gc.print_left(Fonts::chalk_small,  Vector2i(85+50, 40 + y), 
_(levelset->get_description()));
 
-        gc.print_right(Fonts::chalk_normal, rect.get_width() - 30, 15 + y, 
(boost::format("%1% %2%%%") % _("Solved:") % levelset->get_completion()).str());
-        gc.print_right(Fonts::chalk_small,  rect.get_width() - 30, 60 + y, 
(boost::format("%1% %2%") % levelset->get_level_count() % _("levels")).str());
+        gc.print_right(Fonts::chalk_normal, Vector2i(rect.get_width() - 30, 15 
+ y), (boost::format("%1% %2%%%") % _("Solved:") % 
levelset->get_completion()).str());
+        gc.print_right(Fonts::chalk_small,  Vector2i(rect.get_width() - 30, 60 
+ y), (boost::format("%1% %2%") % levelset->get_level_count() % 
_("levels")).str());
 
         //gc.draw(ok_button, 620, y);
 
@@ -160,7 +160,7 @@
     
     int total_pages = (int(levelsets.size())+2)/3;
   
-    gc.print_center(Fonts::chalk_normal, rect.get_width()/2, 360,
+    gc.print_center(Fonts::chalk_normal, Vector2i(rect.get_width()/2, 360),
                     (boost::format("%1% %2%/%3%") % _("Page") % (page+1) % 
total_pages).str());
 
     gc.pop_modelview();
@@ -241,7 +241,7 @@
     gc.push_modelview();
     gc.translate(static_cast<float>(rect.left), static_cast<float>(rect.top));
 
-    gc.print_center(Fonts::chalk_large, rect.get_width()/2, -70, 
_(levelset->get_title()));
+    gc.print_center(Fonts::chalk_large, Vector2i(rect.get_width()/2, -70), 
_(levelset->get_title()));
 
     if (levelset)
       {
@@ -250,8 +250,8 @@
         //gc.draw_fillrect(Rect(Vector2i(0,0), Size(rect.get_width(), 
rect.get_height())),
         //                 Color(255, 255, 0, 100));
 
-        gc.print_left(Fonts::chalk_normal,  30, -32, _("Title"));
-        gc.print_right(Fonts::chalk_normal, rect.get_width() - 30, -32, 
_("Status"));
+        gc.print_left(Fonts::chalk_normal,  Vector2i(30, -32), _("Title"));
+        gc.print_right(Fonts::chalk_normal, Vector2i(rect.get_width() - 30, 
-32), _("Status"));
 
         int y = 0;
         for(int i = page*8; i < (page+1)*8 && i < levelset->get_level_count(); 
++i)
@@ -262,20 +262,20 @@
               gc.draw(marker, Vector2i(0, y));
                         
             if (maintainer_mode)
-              gc.print_left(Fonts::chalk_small, 30, y+4, 
levelset->get_level(i)->plf.get_resname());
+              gc.print_left(Fonts::chalk_small, Vector2i(30, y+4), 
levelset->get_level(i)->plf.get_resname());
             else
-              gc.print_left(Fonts::chalk_small, 30, y+4, 
_(levelset->get_level(i)->plf.get_levelname()));
+              gc.print_left(Fonts::chalk_small, Vector2i(30, y+4), 
_(levelset->get_level(i)->plf.get_levelname()));
 
             if (levelset->get_level(i)->finished)
-              gc.print_right(Fonts::chalk_small, rect.get_width() -30, y+4, 
_("solved"));
+              gc.print_right(Fonts::chalk_small, Vector2i(rect.get_width() 
-30, y+4), _("solved"));
             else
-              gc.print_right(Fonts::chalk_small, rect.get_width() -30, y+4, 
_("unsolved"));
+              gc.print_right(Fonts::chalk_small, Vector2i(rect.get_width() 
-30, y+4), _("unsolved"));
 
             y += 32;
           }
       }
 
-    gc.print_center(Fonts::chalk_normal, rect.get_width()/2, 360,
+    gc.print_center(Fonts::chalk_normal, Vector2i(rect.get_width()/2, 360),
                     (boost::format("%1% %2%/%3%") % _("Page") % (page+1) % 
((levelset->get_level_count()+7)/8)).str());
 
     gc.pop_modelview();

Modified: trunk/pingus/src/math/rect.hpp
===================================================================
--- trunk/pingus/src/math/rect.hpp      2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/math/rect.hpp      2008-07-16 19:02:18 UTC (rev 3841)
@@ -145,6 +145,11 @@
     return (r.left < right && r.right > left && r.top < bottom && r.bottom > 
top);
   }
 
+  bool is_normal() const 
+  {
+    return left <= right && top <= bottom;
+  }
+
   //! Operations:
 public:
   //: Sets the size of the rectangle, maintaining top/left position.
@@ -326,18 +331,10 @@
   void normalize()
   {
     if (left > right)
-      {
-        float temp = right;
-        right = left;
-        left = temp;
-      }
-
+      std::swap(left, right);
+    
     if (top > bottom)
-      {
-        float temp = bottom;
-        bottom = top;
-        top = temp;
-      }
+      std::swap(top, bottom);
   }
 
   // Moves each edge f away from the center, thus width = old_width + 2*f

Modified: trunk/pingus/src/option_menu.cpp
===================================================================
--- trunk/pingus/src/option_menu.cpp    2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/option_menu.cpp    2008-07-16 19:02:18 UTC (rev 3841)
@@ -189,13 +189,13 @@
   // gc.draw_fillrect(Rect(100, 100, 400, 400), Color(255, 0, 0));
   gc.draw(background, Vector2i(gc.get_width()/2 - background.get_width()/2, 
gc.get_height()/2 - background.get_height()/2));
 
-  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 90, "Option Menu");
+  gc.print_center(Fonts::chalk_large, Vector2i(gc.get_width()/2, 90), "Option 
Menu");
 
-  gc.print_center(Fonts::chalk_normal, gc.get_width()/2 + 225 + 30, 
gc.get_height()/2 + 125 - 20, _("Close"));
+  gc.print_center(Fonts::chalk_normal, Vector2i(gc.get_width()/2 + 225 + 30, 
gc.get_height()/2 + 125 - 20), _("Close"));
   gc.draw(ok_button, Vector2i(gc.get_width()/2 + 225, gc.get_height()/2 + 
125));
 
-  gc.print_center(Fonts::chalk_normal, gc.get_width()/2, gc.get_height()/2 + 
160, "Reset to Defaults [ ]");
-  gc.print_left(Fonts::chalk_normal, gc.get_width()/2 - 280, gc.get_height()/2 
+ 160, "Save [ ]");
+  gc.print_center(Fonts::chalk_normal, Vector2i(gc.get_width()/2, 
gc.get_height()/2 + 160), "Reset to Defaults [ ]");
+  gc.print_left(Fonts::chalk_normal, Vector2i(gc.get_width()/2 - 280, 
gc.get_height()/2 + 160), "Save [ ]");
 }
 
 void

Modified: trunk/pingus/src/pingu.cpp
===================================================================
--- trunk/pingus/src/pingu.cpp  2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/pingu.cpp  2008-07-16 19:02:18 UTC (rev 3841)
@@ -350,7 +350,7 @@
       // FIXME: in ticks, should probally be in seconds]
       snprintf(str, 16, "%d", action_time/3);
 
-      gc.color().print_center(Fonts::lcd, (int)pos_x, (int)pos_y - 45 + 2, 
str);
+      gc.color().print_center(Fonts::lcd, Vector2i((int)pos_x, (int)pos_y - 45 
+ 2), str);
     }
 }
 

Modified: trunk/pingus/src/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus_menu.cpp    2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/pingus_menu.cpp    2008-07-16 19:02:18 UTC (rev 3841)
@@ -138,32 +138,32 @@
 {
   background->draw(gc);
 
-  gc.draw_fillrect(0,
-                   Display::get_height () - 26,
-                   Display::get_width (),
-                   Display::get_height (),
+  gc.draw_fillrect(Rect(0,
+                        Display::get_height () - 26,
+                        Display::get_width (),
+                        Display::get_height ()),
                    Color(0, 0, 0, 255));
 
   gc.draw(logo, Vector2i((gc.get_width()/2) - (logo.get_width()/2),
                          gc.get_height()/2 - 250));
 
-  gc.print_left(Fonts::pingus_small, 25, 
-                gc.get_height()-130,
+  gc.print_left(Fonts::pingus_small, Vector2i(25, gc.get_height()-130),
                 "Pingus "VERSION", Copyright (C) 1998-2007 Ingo Ruhnke 
<address@hidden>\n"
                 "See the file AUTHORS for a complete list of contributors.\n");
-  gc.print_left(Fonts::pingus_small, 25, 
-                gc.get_height()-80,
+  gc.print_left(Fonts::pingus_small, Vector2i(25, gc.get_height()-80),
                 "Pingus comes with ABSOLUTELY NO WARRANTY. This is free 
software, and you are\n"
                 "welcome to redistribute it under certain conditions; see the 
file COPYING for details.\n");
 
-  gc.print_center(Fonts::pingus_small, gc.get_width() / 2,
-                  gc.get_height() - Fonts::pingus_small.get_height(),
+  gc.print_center(Fonts::pingus_small, 
+                  Vector2i(gc.get_width() / 2,
+                           gc.get_height() - Fonts::pingus_small.get_height()),
                   help);
 
   if (0) // display hint
     {
-      gc.print_center(Fonts::pingus_small, gc.get_width() / 2,
-                      gc.get_height() - Fonts::pingus_small.get_height(),
+      gc.print_center(Fonts::pingus_small, 
+                      Vector2i(gc.get_width() / 2,
+                               gc.get_height() - 
Fonts::pingus_small.get_height()),
                       hint);
     }
 }

Modified: trunk/pingus/src/result_screen.cpp
===================================================================
--- trunk/pingus/src/result_screen.cpp  2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/result_screen.cpp  2008-07-16 19:02:18 UTC (rev 3841)
@@ -88,7 +88,7 @@
 
   void draw(DrawingContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos - 4, _("Abort"));
+    gc.print_center(Fonts::chalk_normal, Vector2i(x_pos + 55, y_pos - 4), 
_("Abort"));
   }
 
   void on_click() {
@@ -119,7 +119,7 @@
 
   void draw (DrawingContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_center(Fonts::chalk_normal, x_pos + 30, y_pos - 24, _("Retry"));
+    gc.print_center(Fonts::chalk_normal, Vector2i(x_pos + 30, y_pos - 24), 
_("Retry"));
   }
 
   bool is_at(int x, int y) {
@@ -161,20 +161,24 @@
 
   gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
 
-  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 
-                  Display::get_height()/2 - 200,
+  gc.print_center(Fonts::chalk_large, 
+                  Vector2i(gc.get_width()/2, 
+                           Display::get_height()/2 - 200),
                   _(result.plf.get_levelname()));
 
   if (result.success())
     {
-      gc.print_center(Fonts::chalk_large, gc.get_width()/2,
-                      Display::get_height()/2 - 140, _("Success!"));
+      gc.print_center(Fonts::chalk_large, 
+                      Vector2i(gc.get_width()/2,
+                               Display::get_height()/2 - 140),
+                      _("Success!"));
       /*gc.print_center(Fonts::pingus_small, gc.get_width()/2, 
gc.get_height()-30,
         "..:: Press Space to continue ::..");*/
     }
   else
     {
-      gc.print_center(Fonts::chalk_large, gc.get_width()/2, 
Display::get_height()/2 - 140,
+      gc.print_center(Fonts::chalk_large, 
+                      Vector2i(gc.get_width()/2, Display::get_height()/2 - 
140),
                       _("Failure!"));
       /*gc.print_center(Fonts::pingus_normal, gc.get_width()/2, 
gc.get_height()-30,
         "..:: Press Space to retry the level ::..");*/
@@ -211,23 +215,22 @@
       else
         message = _("Better luck next time!");
     }
-  gc.print_center(Fonts::chalk_normal, gc.get_width()/2,
-                  Display::get_height()/2 - 70, message);
+  gc.print_center(Fonts::chalk_normal, Vector2i(gc.get_width()/2, 
gc.get_height()/2 - 70), message);
 
-  int left_x  = Display::get_width()/2 - 100;
-  int right_x = Display::get_width()/2 + 100;
+  int left_x  = gc.get_width()/2 - 100;
+  int right_x = gc.get_width()/2 + 100;
   int y = Display::get_height()/2 + 10;
 
-  gc.print_left(Fonts::chalk_normal,  left_x,  y, _("Saved: "));
-  gc.print_right(Fonts::chalk_normal, right_x, y, 
StringUtil::to_string(result.saved)
+  gc.print_left(Fonts::chalk_normal,  Vector2i(left_x,  y), _("Saved: "));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), 
StringUtil::to_string(result.saved)
                  + "/" + StringUtil::to_string(result.needed));;
 
-  gc.print_left(Fonts::chalk_normal,  left_x,  (y+=30), _("Died: "));
-  gc.print_right(Fonts::chalk_normal, right_x, y, 
StringUtil::to_string(result.killed));
+  gc.print_left(Fonts::chalk_normal,  Vector2i(left_x,  (y+=30)), _("Died: "));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), 
StringUtil::to_string(result.killed));
 
 
-  gc.print_left(Fonts::chalk_normal,  left_x, (y+=30), _("Time left: "));
-  gc.print_right(Fonts::chalk_normal, right_x, y, time_str);
+  gc.print_left(Fonts::chalk_normal,  Vector2i(left_x, (y+=30)), _("Time left: 
"));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), time_str);
 }
 
 ResultScreen::ResultScreen(Result arg_result)

Modified: trunk/pingus/src/start_screen.cpp
===================================================================
--- trunk/pingus/src/start_screen.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/start_screen.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -69,7 +69,7 @@
 
   void draw(DrawingContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_center(Fonts::chalk_normal, x_pos + 30, y_pos - 20, _("Ok"));
+    gc.print_center(Fonts::chalk_normal, Vector2i(x_pos + 30, y_pos - 20), 
_("Ok"));
   }
 
   bool is_at(int x, int y) {
@@ -110,7 +110,7 @@
 
   void draw(DrawingContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos, _("Abort"));
+    gc.print_center(Fonts::chalk_normal, Vector2i(x_pos + 55, y_pos), 
_("Abort"));
   }
 
   void on_click() {
@@ -147,37 +147,37 @@
   int y = gc.get_height()/2 + 40;
 
   gc.print_center(Fonts::chalk_large,
-                  gc.get_width() /2,
-                  gc.get_height()/2 - 230,
+                  Vector2i(gc.get_width() /2,
+                           gc.get_height()/2 - 230),
                   _(plf.get_levelname()));
 
   gc.print_left(Fonts::chalk_normal,
-                gc.get_width() /2 - 290,
-                gc.get_height()/2 - 170,
+                Vector2i(gc.get_width() /2 - 290,
+                         gc.get_height()/2 - 170),
                 format_description(800 - 200));
 
   y += 32;
   y += 30;
 
-  gc.print_left (Fonts::chalk_normal, left_x,  y, _("Number of Pingus: "));
-  gc.print_right(Fonts::chalk_normal, right_x, y, 
StringUtil::to_string(plf.get_number_of_pingus()));
+  gc.print_left (Fonts::chalk_normal, Vector2i(left_x,  y), _("Number of 
Pingus: "));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), 
StringUtil::to_string(plf.get_number_of_pingus()));
+  
+  gc.print_left (Fonts::chalk_normal, Vector2i(left_x,  (y += 30)), _("Number 
to Save: "));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), 
StringUtil::to_string(plf.get_number_to_save()));
+  
+  gc.print_left (Fonts::chalk_normal, Vector2i(left_x,  (y += 30)), _("Time: 
"));
+  gc.print_right(Fonts::chalk_normal, Vector2i(right_x, y), time_str);
 
-  gc.print_left (Fonts::chalk_normal, left_x,  (y += 30), _("Number to Save: 
"));
-  gc.print_right(Fonts::chalk_normal, right_x, y, 
StringUtil::to_string(plf.get_number_to_save()));
-
-  gc.print_left (Fonts::chalk_normal, left_x,  (y += 30), _("Time: "));
-  gc.print_right(Fonts::chalk_normal, right_x, y, time_str);
-
   //gc.print_left (Fonts::chalk_normal, left_x,  (y += 30), _("Difficulty:"));
   //gc.print_right(Fonts::chalk_normal, right_x, y, 
StringUtil::to_string(plf.get_difficulty()) + "/100");
 
   gc.print_center(Fonts::chalk_small, 
-                  gc.get_width()/2,
-                  gc.get_height()/2 + 215,
+                  Vector2i(gc.get_width()/2,
+                           gc.get_height()/2 + 215),
                   _("Author: ") + plf.get_author());
 
   if (maintainer_mode)
-    gc.print_left(Fonts::chalk_small, 110, 430, _("Filename: ") + 
plf.get_resname());
+    gc.print_left(Fonts::chalk_small, Vector2i(110, 430), _("Filename: ") + 
plf.get_resname());
 }
 
 const std::string&

Modified: trunk/pingus/src/story_screen.cpp
===================================================================
--- trunk/pingus/src/story_screen.cpp   2008-07-16 15:41:36 UTC (rev 3840)
+++ trunk/pingus/src/story_screen.cpp   2008-07-16 19:02:18 UTC (rev 3841)
@@ -102,7 +102,7 @@
 
   void draw (DrawingContext& gc)
   {
-    gc.print_right(Fonts::chalk_small, x_pos, y_pos, _("skip"));
+    gc.print_right(Fonts::chalk_small, Vector2i(x_pos, y_pos), _("skip"));
   }
 
   bool is_at(int x, int y) {
@@ -163,13 +163,14 @@
 
   gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
 
-  gc.print_center(Fonts::chalk_large, gc.get_width()/2,
-                  gc.get_height()/2 - 200, story->get_title());
+  gc.print_center(Fonts::chalk_large, 
+                  Vector2i(gc.get_width()/2, gc.get_height()/2 - 200), 
+                  story->get_title());
   gc.draw(page_surface, Vector2i(gc.get_width()/2, gc.get_height()/2 - 65));
 
   gc.print_left(Fonts::chalk_normal,
-                gc.get_width()/2  - 280,
-                gc.get_height()/2 + 35,
+                Vector2i(gc.get_width()/2  - 280,
+                         gc.get_height()/2 + 35),
                 display_text);
 }
 

Modified: trunk/pingus/src/worldmap/level_dot.cpp
===================================================================
--- trunk/pingus/src/worldmap/level_dot.cpp     2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/worldmap/level_dot.cpp     2008-07-16 19:02:18 UTC (rev 
3841)
@@ -137,8 +137,8 @@
         pos_correction = realpos + length - static_cast<int>(gc.get_width());
       
       gc.print_center(Fonts::pingus_small,
-                      (int)pos.x - pos_correction,
-                      (int)pos.y - 44,
+                      Vector2i((int)pos.x - pos_correction,
+                               (int)pos.y - 44),
                       _(get_plf().get_levelname()), 
                       10000);
     }
@@ -152,8 +152,8 @@
         pos_correction = realpos + length - static_cast<int>(gc.get_width());
         
       gc.print_center(Fonts::pingus_small,
-                      (int)pos.x - pos_correction,
-                      (int)pos.y - 30,
+                      Vector2i((int)pos.x - pos_correction,
+                               (int)pos.y - 30),
                       _("locked"), 
                       10000);
     }
@@ -161,7 +161,7 @@
   if (maintainer_mode)
     {
       gc.print_center(Fonts::pingus_small,
-                      (int)pos.x, (int)pos.y - 56,
+                      Vector2i((int)pos.x, (int)pos.y - 56),
                       get_plf().get_resname(), 
                       10000);
     }

Modified: trunk/pingus/src/worldmap/path_drawable.cpp
===================================================================
--- trunk/pingus/src/worldmap/path_drawable.cpp 2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/worldmap/path_drawable.cpp 2008-07-16 19:02:18 UTC (rev 
3841)
@@ -33,8 +33,8 @@
 
   for(Path::iterator next = prev + 1; next != path.end(); ++next)
     {
-      gc.draw_line((int)prev->x, (int)prev->y,
-                   (int)next->x, (int)next->y,
+      gc.draw_line(Vector2i((int)prev->x, (int)prev->y),
+                   Vector2i((int)next->x, (int)next->y),
                    Color(255, 255, 255));
       prev = next;
     }

Modified: trunk/pingus/src/worldmap/path_drawable.hpp
===================================================================
--- trunk/pingus/src/worldmap/path_drawable.hpp 2008-07-16 15:41:36 UTC (rev 
3840)
+++ trunk/pingus/src/worldmap/path_drawable.hpp 2008-07-16 19:02:18 UTC (rev 
3841)
@@ -21,13 +21,14 @@
 #include "path_graph.hpp"
 
 namespace WorldmapNS {
-
+
 /** Drawable to show the path between two nodes, only used for
     debugging */
 class PathDrawable : public Drawable
 {
 private:
   Path path;
+
 public:
   PathDrawable(const Path& arg_path);
 
@@ -38,7 +39,7 @@
   PathDrawable (const PathDrawable&);
   PathDrawable& operator= (const PathDrawable&);
 };
-
+
 } // namespace WorldmapNS
 
 #endif

Modified: trunk/pingus/src/worldmap/sprite_drawable.hpp
===================================================================
--- trunk/pingus/src/worldmap/sprite_drawable.hpp       2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/worldmap/sprite_drawable.hpp       2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -32,6 +32,7 @@
       covered by it, so that the Pingu can travel into caves and other
       things, while the roof will disapear */
   bool       auto_uncover;
+
 public:
   SpriteDrawable(FileReader reader);
 

Modified: trunk/pingus/src/worldmap/worldmap_component.cpp
===================================================================
--- trunk/pingus/src/worldmap/worldmap_component.cpp    2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/worldmap/worldmap_component.cpp    2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -49,7 +49,7 @@
   //scene_context->color().draw_fillrect(-100, -100, 2000, 2000, 
Color(255,0,0,0), -10000);
   worldmap->draw(scene_context->color());
 
-  gc.draw(new SceneContextDrawingRequest(scene_context.get(), 
Vector3f(0,0,-1000)));
+  gc.draw(new SceneContextDrawingRequest(scene_context.get(), Vector2i(0,0), 
-1000));
 
   scene_context->pop_modelview();
 
@@ -58,16 +58,16 @@
     {
       Color border_color(0, 0, 0);
       // top
-      gc.draw_fillrect(0, 0, Display::get_width(), cliprect.top,
+      gc.draw_fillrect(Rect(0, 0, Display::get_width(), cliprect.top),
                        border_color);
       // bottom
-      gc.draw_fillrect(0, cliprect.bottom, Display::get_width(), 
Display::get_height(),
+      gc.draw_fillrect(Rect(0, cliprect.bottom, Display::get_width(), 
Display::get_height()),
                        border_color);
       // left
-      gc.draw_fillrect(0, cliprect.top, cliprect.left, cliprect.bottom,
+      gc.draw_fillrect(Rect(0, cliprect.top, cliprect.left, cliprect.bottom),
                        border_color);
       // right
-      gc.draw_fillrect(cliprect.right, cliprect.top, Display::get_width(), 
cliprect.bottom,
+      gc.draw_fillrect(Rect(cliprect.right, cliprect.top, 
Display::get_width(), cliprect.bottom),
                        border_color);
     }
 }

Modified: trunk/pingus/src/worldmap/worldmap_screen.cpp
===================================================================
--- trunk/pingus/src/worldmap/worldmap_screen.cpp       2008-07-16 15:41:36 UTC 
(rev 3840)
+++ trunk/pingus/src/worldmap/worldmap_screen.cpp       2008-07-16 19:02:18 UTC 
(rev 3841)
@@ -104,7 +104,7 @@
 WorldmapScreenCreditsButton::draw (DrawingContext& gc)
 {
   SurfaceButton::draw(gc);
-  gc.print_center(Fonts::chalk_small, Display::get_width() - 59 - 24, 2, 
_("Show Ending?"));
+  gc.print_center(Fonts::chalk_small, Vector2i(Display::get_width() - 59 - 24, 
2), _("Show Ending?"));
 }
 
 void
@@ -133,7 +133,7 @@
 WorldmapScreenStoryButton::draw (DrawingContext& gc)
 {
   SurfaceButton::draw(gc);
-  gc.print_center(Fonts::chalk_small, 59, 2, _("Show Story?"));
+  gc.print_center(Fonts::chalk_small, Vector2i(59, 2), _("Show Story?"));
 }
 
 void
@@ -162,7 +162,7 @@
 WorldmapScreenCloseButton::draw (DrawingContext& gc)
 {
   SurfaceButton::draw(gc);
-  gc.print_center(Fonts::chalk_small, 44, Display::get_height() - 25, 
_("Leave?"));
+  gc.print_center(Fonts::chalk_small, Vector2i(44, Display::get_height() - 
25), _("Leave?"));
 }
 
 void
@@ -198,8 +198,8 @@
     {
       SurfaceButton::draw(gc);
       gc.print_center(Fonts::chalk_small,
-                      Display::get_width() - 43 - 22,
-                      Display::get_height() - 25,
+                      Vector2i(Display::get_width() - 43 - 22,
+                               Display::get_height() - 25),
                       _("Enter?"));
     }
 }
@@ -286,7 +286,8 @@
           Vector2i(gc.get_width()/2 - levelname_bg.get_width()/2,
                    gc.get_height() - levelname_bg.get_height()));
 
-  gc.print_center(Fonts::chalk_small, gc.get_width()/2, gc.get_height() - 25,
+  gc.print_center(Fonts::chalk_small, 
+                  Vector2i(gc.get_width()/2, gc.get_height() - 25),
                   worldmap->get_levelname());
 }
 





reply via email to

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