summaryrefslogtreecommitdiff
path: root/src/sprite.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-21 19:21:21 +0000
committerrubidium <rubidium@openttd.org>2007-12-21 19:21:21 +0000
commit01e20c91403ebe8c88697ec11812fb46d414c770 (patch)
treefc1669fb9cd1857bea972a4378d8ebd1e80facfa /src/sprite.h
parentd5c4ba8246fbd9b44469037d8224a94c0a5ce5d3 (diff)
downloadopenttd-01e20c91403ebe8c88697ec11812fb46d414c770.tar.xz
(svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations.
Diffstat (limited to 'src/sprite.h')
-rw-r--r--src/sprite.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sprite.h b/src/sprite.h
index e2654c2af..00ceed3ee 100644
--- a/src/sprite.h
+++ b/src/sprite.h
@@ -5,6 +5,17 @@
#ifndef SPRITE_H
#define SPRITE_H
+#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
+#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
+
+/**
+ * Whether a sprite comes from the original graphics files or a new grf file
+ * (either supplied by OpenTTD or supplied by the user).
+ *
+ * @param sprite The sprite to check
+ * @return True if it is a new sprite, or false if it is original.
+ */
+#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
/* The following describes bunch of sprites to be drawn together in a single 3D
* bounding box. Used especially for various multi-sprite buildings (like