summaryrefslogtreecommitdiff
path: root/src/render/graphics.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-14 16:59:21 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-14 16:59:21 +0300
commitd9a77eb8ac5d507665cbf8b20f5d8187148ebfd1 (patch)
treedb2f8a25d466ce6aa5ca1747216156f7869a06d1 /src/render/graphics.h
parent2851324a6847efa7ea6f556941b369e9e304dc23 (diff)
downloadmv-d9a77eb8ac5d507665cbf8b20f5d8187148ebfd1.tar.gz
mv-d9a77eb8ac5d507665cbf8b20f5d8187148ebfd1.tar.bz2
mv-d9a77eb8ac5d507665cbf8b20f5d8187148ebfd1.tar.xz
mv-d9a77eb8ac5d507665cbf8b20f5d8187148ebfd1.zip
Improve a bit separate images drawing.
Diffstat (limited to 'src/render/graphics.h')
-rw-r--r--src/render/graphics.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/render/graphics.h b/src/render/graphics.h
index 7d4d7c524..cb009291b 100644
--- a/src/render/graphics.h
+++ b/src/render/graphics.h
@@ -47,6 +47,15 @@ struct SDL_Window;
static const int defaultScreenWidth = 800;
static const int defaultScreenHeight = 600;
+#define DRAW_IMAGE(graphics, image, x, y) \
+ { \
+ if (image) \
+ { \
+ (graphics)->drawImage2(image, 0, 0, x, y, \
+ (image)->mBounds.w, (image)->mBounds.h, false); \
+ } \
+ }
+
/**
* 9 images defining a rectangle. 4 corners, 4 sides and a middle area. The
* topology is as follows:
@@ -370,14 +379,6 @@ class Graphics : public gcn::Graphics
virtual void setRendererFlags(const uint32_t flags A_UNUSED)
{ }
#endif
- int mWidth;
- int mHeight;
-
- protected:
- /**
- * Constructor.
- */
- Graphics();
/**
* Blits an image onto the screen.
@@ -391,6 +392,14 @@ class Graphics : public gcn::Graphics
const int width, const int height,
const bool useColor) = 0;
+ int mWidth;
+ int mHeight;
+
+ protected:
+ /**
+ * Constructor.
+ */
+ Graphics();
void setMainFlags(const int w, const int h, const int bpp,
const bool fs, const bool hwaccel,