summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-04-23 18:03:55 +0000
committerpeter1138 <peter1138@openttd.org>2006-04-23 18:03:55 +0000
commitb54ebaba70f211044ba8aa39ee13599b3945b2ff (patch)
treec232fca29ca56889c12869a4fcd8fb60ef7026de
parentbbcdbb830bef0bf7596be1c76fffeb8346fcd9a4 (diff)
downloadopenttd-b54ebaba70f211044ba8aa39ee13599b3945b2ff.tar.xz
(svn r4549) - NewGRF: store the grf version from Action 0x08.
-rw-r--r--newgrf.c3
-rw-r--r--newgrf.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/newgrf.c b/newgrf.c
index af3f62869..584f671e3 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -2017,6 +2017,7 @@ static void SkipIf(byte *buf, int len)
}
}
+/* Action 0x08 */
static void GRFInfo(byte *buf, int len)
{
/* <08> <version> <grf-id> <name> <info>
@@ -2039,12 +2040,14 @@ static void GRFInfo(byte *buf, int len)
info = name + strlen(name) + 1;
_cur_grffile->grfid = grfid;
+ _cur_grffile->grf_version = version;
_cur_grffile->flags |= 0x0001; /* set active flag */
DEBUG(grf, 1) ("[%s] Loaded GRFv%d set %08lx - %s:\n%s",
_cur_grffile->filename, version, grfid, name, info);
}
+/* Action 0x0A */
static void SpriteReplace(byte *buf, int len)
{
/* <0A> <num-sets> <set1> [<set2> ...]
diff --git a/newgrf.h b/newgrf.h
index c4d937461..5bf2359fc 100644
--- a/newgrf.h
+++ b/newgrf.h
@@ -19,6 +19,7 @@ typedef struct GRFFile {
uint16 flags;
uint16 sprite_offset;
SpriteID first_spriteset; ///< Holds the first spriteset's sprite offset.
+ byte grf_version;
struct GRFFile *next;
/* A sprite group contains all sprites of a given vehicle (or multiple