summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-03 20:42:45 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-03 20:42:45 +0000
commitdebfc88862d4476872c77fb512de2aeb1c757ca2 (patch)
treef7dab51d927e64cf1c169d7c48832136b22e6851
parent76411cef63faacc4428213e828b11f1f6abd1d9e (diff)
downloadopenttd-debfc88862d4476872c77fb512de2aeb1c757ca2.tar.xz
(svn r4720) - Newstations: instead of literally copying sprite layout data, just copy the pointer to the existing data.
-rw-r--r--newgrf.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/newgrf.c b/newgrf.c
index 62b0e6464..b617597f2 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -847,31 +847,9 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int
StationSpec *statspec = &_cur_grffile->stations[stid + i];
byte srcid = grf_load_byte(&buf);
const StationSpec *srcstatspec = &_cur_grffile->stations[srcid];
- uint t;
statspec->tiles = srcstatspec->tiles;
- statspec->renderdata = calloc(statspec->tiles, sizeof(*statspec->renderdata));
- for (t = 0; t < statspec->tiles; t++) {
- DrawTileSprites *dts = &statspec->renderdata[t];
- const DrawTileSprites *sdts = &srcstatspec->renderdata[t];
- DrawTileSeqStruct const *sdtss = sdts->seq;
- int seq_count = 0;
-
- dts->seq = NULL;
- dts->ground_sprite = sdts->ground_sprite;
- if (dts->ground_sprite == 0) continue;
-
- while (true) {
- DrawTileSeqStruct *dtss;
-
- // no relative bounding box support
- dts->seq = realloc((void*)dts->seq, ++seq_count * sizeof(DrawTileSeqStruct));
- dtss = (DrawTileSeqStruct*) &dts->seq[seq_count - 1];
- *dtss = *sdtss;
- if ((byte) dtss->delta_x == 0x80) break;
- sdtss++;
- }
- }
+ statspec->renderdata = srcstatspec->renderdata;
}
break;