summaryrefslogtreecommitdiff
path: root/src/newgrf_spritegroup.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-05 05:41:56 +0000
committerrubidium <rubidium@openttd.org>2007-07-05 05:41:56 +0000
commit4c356457e6335692cb5e28f279724b97e3c1c608 (patch)
tree8f43488078024be2576c0659efafbe7b95adb002 /src/newgrf_spritegroup.h
parentaa04ad59f12b723543869a840bbfcc594469cac7 (diff)
downloadopenttd-4c356457e6335692cb5e28f279724b97e3c1c608.tar.xz
(svn r10442) -Codechange: implement the industry production callback.
Diffstat (limited to 'src/newgrf_spritegroup.h')
-rw-r--r--src/newgrf_spritegroup.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h
index 5575351b1..02fb1f878 100644
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -8,6 +8,19 @@
#include "town.h"
#include "industry.h"
+/**
+ * Gets the value of a so-called newgrf "register".
+ * @param i index of the register
+ * @pre i < 0x110
+ * @return the value of the register
+ */
+static inline uint32 GetRegister(uint i)
+{
+ assert(i < 0x110);
+ extern uint32 _temp_store[0x110];
+ return _temp_store[i];
+}
+
struct SpriteGroup;
@@ -135,6 +148,13 @@ struct TileLayoutSpriteGroup {
struct DrawTileSprites *dts;
};
+struct IndustryProductionSpriteGroup {
+ uint8 version;
+ uint16 substract_input[3];
+ uint16 add_output[2];
+ uint8 again;
+};
+
/* List of different sprite group types */
enum SpriteGroupType {
SGT_INVALID,
@@ -144,6 +164,7 @@ enum SpriteGroupType {
SGT_CALLBACK,
SGT_RESULT,
SGT_TILELAYOUT,
+ SGT_INDUSTRY_PRODUCTION,
};
/* Common wrapper for all the different sprite group types */
@@ -157,6 +178,7 @@ struct SpriteGroup {
CallbackResultSpriteGroup callback;
ResultSpriteGroup result;
TileLayoutSpriteGroup layout;
+ IndustryProductionSpriteGroup indprod;
} g;
};