- fixed level editor crash (a hack)
[supertux.git] / src / texture.h
index 3ba0e58..0e68e70 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <list>
 #include "screen.h"
+#include "vector.h"
 
 SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha);
 
@@ -87,11 +88,17 @@ public:
   /** Reload the surface, which is necesarry in case of a mode swich */
   void reload();
 
-  void draw(float x, float y, Uint8 alpha = 255, bool update = false);
+  void draw(float x, float y, Uint8 alpha = 255, bool upside_down = false, bool update = false);
   void draw_bg(Uint8 alpha = 255, bool update = false);
   void draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha = 255, bool update = false);
   void draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update = false);
   void resize(int w_, int h_);
+
+  /// conveniance function
+  void draw(const Vector& pos, Uint8 alpha = 255, bool upside_down = false, bool update = false)
+  {
+    draw(pos.x, pos.y, alpha, upside_down, update);
+  }
 };
 
 /** Surface implementation, all implementation have to inherit from
@@ -110,7 +117,7 @@ public:
   virtual ~SurfaceImpl();
   
   /** Return 0 on success, -2 if surface needs to be reloaded */
-  virtual int draw(float x, float y, Uint8 alpha, bool update) = 0;
+  virtual int draw(float x, float y, Uint8 alpha, bool upside_down, bool update) = 0;
   virtual int draw_bg(Uint8 alpha, bool update) = 0;
   virtual int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update) = 0;
   virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0;
@@ -127,7 +134,7 @@ public:
   SurfaceSDL(const std::string& file, int x, int y, int w, int h, int use_alpha);
   virtual ~SurfaceSDL();
 
-  int draw(float x, float y, Uint8 alpha, bool update);
+  int draw(float x, float y, Uint8 alpha, bool upside_down, bool update);
   int draw_bg(Uint8 alpha, bool update);
   int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update);
   int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update);
@@ -145,7 +152,7 @@ public:
   SurfaceOpenGL(const std::string& file, int x, int y, int w, int h, int use_alpha);
   virtual ~SurfaceOpenGL();
 
-  int draw(float x, float y, Uint8 alpha, bool update);
+  int draw(float x, float y, Uint8 alpha, bool upside_down, bool update);
   int draw_bg(Uint8 alpha, bool update);
   int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update);
   int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update);