|
@@ -14,24 +14,25 @@
|
|
|
#include "station.h"
|
|
|
#include "sprite.h"
|
|
|
#include "newgrf.h"
|
|
|
#include "variables.h"
|
|
|
#include "string.h"
|
|
|
#include "table/strings.h"
|
|
|
#include "bridge.h"
|
|
|
#include "economy.h"
|
|
|
#include "newgrf_engine.h"
|
|
|
#include "vehicle.h"
|
|
|
#include "newgrf_text.h"
|
|
|
#include "table/sprites.h"
|
|
|
#include "date.h"
|
|
|
|
|
|
#include "newgrf_spritegroup.h"
|
|
|
|
|
|
/* TTDPatch extended GRF format codec
|
|
|
* (c) Petr Baudis 2004 (GPL'd)
|
|
|
* Changes by Florian octo Forster are (c) by the OpenTTD development team.
|
|
|
*
|
|
|
* Contains portions of documentation by TTDPatch team.
|
|
|
* Thanks especially to Josef Drexler for the documentation as well as a lot
|
|
|
* of help at #tycoon. Also thanks to Michael Blunck for is GRF files which
|
|
|
* served as subject to the initial testing of this codec. */
|
|
|
|
|
@@ -997,25 +998,25 @@ static bool StationChangeInfo(uint stid,
|
|
|
*bufp = buf;
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int len)
|
|
|
{
|
|
|
byte *buf = *bufp;
|
|
|
int i;
|
|
|
bool ret = false;
|
|
|
|
|
|
switch (prop) {
|
|
|
case 0x08: /* Year of availability */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].avail_year = grf_load_byte(&buf);
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].avail_year = BASE_YEAR + grf_load_byte(&buf);
|
|
|
break;
|
|
|
|
|
|
case 0x09: /* Minimum length */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].min_length = grf_load_byte(&buf);
|
|
|
break;
|
|
|
|
|
|
case 0x0A: /* Maximum length */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].max_length = grf_load_byte(&buf);
|
|
|
break;
|
|
|
|
|
|
case 0x0B: /* Cost factor */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].price = grf_load_byte(&buf);
|
|
@@ -1050,24 +1051,28 @@ static bool BridgeChangeInfo(uint brid,
|
|
|
}
|
|
|
|
|
|
for (sprite = 0; sprite < 32; sprite++)
|
|
|
bridge->sprite_table[tableid][sprite] = grf_load_dword(&buf);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case 0x0E: /* Flags; bit 0 - disable far pillars */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].flags = grf_load_byte(&buf);
|
|
|
break;
|
|
|
|
|
|
case 0x0F: /* Long year -- must be set after property 8 */
|
|
|
FOR_EACH_OBJECT _bridge[brid + i].avail_year = grf_load_word(&buf);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
ret = true;
|
|
|
}
|
|
|
|
|
|
*bufp = buf;
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, int len)
|
|
|
{
|
|
|
byte *buf = *bufp;
|
|
|
int i;
|