summaryrefslogtreecommitdiff
path: root/src/gfx.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-05 21:49:15 +0000
committerrubidium <rubidium@openttd.org>2007-10-05 21:49:15 +0000
commit6e7402a1c539e72c3742e7357de2d7996c949434 (patch)
tree82f42d837d503e7878a6a5f01cc1e974dd2b8c8a /src/gfx.h
parentbf35f3a21a7eed4d4f6c7714e65cdce23e535db9 (diff)
downloadopenttd-6e7402a1c539e72c3742e7357de2d7996c949434.tar.xz
(svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
Diffstat (limited to 'src/gfx.h')
-rw-r--r--src/gfx.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gfx.h b/src/gfx.h
index 38d4b3052..57c536747 100644
--- a/src/gfx.h
+++ b/src/gfx.h
@@ -242,6 +242,16 @@ DECLARE_POSTFIX_INCREMENT(FontSize);
void RedrawScreenRect(int left, int top, int right, int bottom);
void GfxScroll(int left, int top, int width, int height, int xo, int yo);
+/**
+ * Used to only draw a part of the sprite.
+ * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
+ * Both corners are included in the drawing area.
+ */
+struct SubSprite {
+ int left, top, right, bottom;
+};
+
+void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
/* XXX doesn't really belong here, but the only
* consumers always use it in conjunction with DoDrawString() */