summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-11-08 12:17:14 +0000
committerpeter1138 <peter1138@openttd.org>2006-11-08 12:17:14 +0000
commit0aa8c0123a827e6aa74dc9f88824aa810a1e1df9 (patch)
tree1e7c5d1234332f86f7b7b1377dba55c22375ca0c
parentc73578aae6cd14c04a5bd19ab1b1016f3e6bcda9 (diff)
downloadopenttd-0aa8c0123a827e6aa74dc9f88824aa810a1e1df9.tar.xz
(svn r7113) -Codechange: [NewStations] Add support for copying custom station layouts
-rw-r--r--newgrf.c13
-rw-r--r--newgrf_station.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/newgrf.c b/newgrf.c
index 59965bb6a..7a50859f0 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -952,6 +952,8 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
FOR_EACH_OBJECT {
StationSpec *statspec = _cur_grffile->stations[stid + i];
+ statspec->copied_layouts = false;
+
while (buf < *bufp + len) {
byte length = grf_load_byte(&buf);
byte number = grf_load_byte(&buf);
@@ -1001,11 +1003,16 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
break;
case 0x0F: /* Copy custom layout */
- /* TODO */
FOR_EACH_OBJECT {
- grf_load_byte(&buf);
+ StationSpec *statspec = _cur_grffile->stations[stid + i];
+ byte srcid = grf_load_byte(&buf);
+ const StationSpec *srcstatspec = _cur_grffile->stations[srcid];
+
+ statspec->lengths = srcstatspec->lengths;
+ statspec->platforms = srcstatspec->platforms;
+ statspec->layouts = srcstatspec->layouts;
+ statspec->copied_layouts = true;
}
- ret = true;
break;
case 0x10: /* Little/lots cargo threshold */
diff --git a/newgrf_station.h b/newgrf_station.h
index a5a45d9a0..a133fb3d7 100644
--- a/newgrf_station.h
+++ b/newgrf_station.h
@@ -67,6 +67,7 @@ typedef struct StationSpec {
byte lengths;
byte *platforms;
StationLayout **layouts;
+ bool copied_layouts;
/**
* NUM_GLOBAL_CID sprite groups.