src/sprite.h
changeset 8609 8c0c3e9dd6a0
parent 8102 5a299e72a426
child 8619 c2434269c3eb
--- a/src/sprite.h	Fri Dec 21 08:34:53 2007 +0000
+++ b/src/sprite.h	Fri Dec 21 19:21:21 2007 +0000
@@ -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