1
0
Fork 0

(svn r7113) -Codechange: [NewStations] Add support for copying custom station layouts

release/0.5
peter1138 2006-11-08 12:17:14 +00:00
parent c73578aae6
commit 0aa8c0123a
2 changed files with 11 additions and 3 deletions

View File

@ -952,6 +952,8 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
FOR_EACH_OBJECT { FOR_EACH_OBJECT {
StationSpec *statspec = _cur_grffile->stations[stid + i]; StationSpec *statspec = _cur_grffile->stations[stid + i];
statspec->copied_layouts = false;
while (buf < *bufp + len) { while (buf < *bufp + len) {
byte length = grf_load_byte(&buf); byte length = grf_load_byte(&buf);
byte number = 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; break;
case 0x0F: /* Copy custom layout */ case 0x0F: /* Copy custom layout */
/* TODO */
FOR_EACH_OBJECT { 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; break;
case 0x10: /* Little/lots cargo threshold */ case 0x10: /* Little/lots cargo threshold */

View File

@ -67,6 +67,7 @@ typedef struct StationSpec {
byte lengths; byte lengths;
byte *platforms; byte *platforms;
StationLayout **layouts; StationLayout **layouts;
bool copied_layouts;
/** /**
* NUM_GLOBAL_CID sprite groups. * NUM_GLOBAL_CID sprite groups.