File diff r15588:8aad267fa5ef → r15589:fd456a62bb1c
src/newgrf.cpp
Show inline comments
 
@@ -4866,13 +4866,13 @@ static void GRFInfo(ByteReader *buf)
 

	
 
	_cur_grffile->grfid = grfid;
 
	_cur_grffile->grf_version = version;
 
	_cur_grfconfig->status = _cur_stage < GLS_RESERVE ? GCS_INITIALISED : GCS_ACTIVATED;
 

	
 
	/* Do swap the GRFID for displaying purposes since people expect that */
 
	DEBUG(grf, 1, "GRFInfo: Loaded GRFv%d set %08X - %s (palette: %s)", version, BSWAP32(grfid), name, (_cur_grfconfig->palette & GRFP_USE_MASK) ? "Windows" : "DOS");
 
	DEBUG(grf, 1, "GRFInfo: Loaded GRFv%d set %08X - %s (palette: %s, version: %i)", version, BSWAP32(grfid), name, (_cur_grfconfig->palette & GRFP_USE_MASK) ? "Windows" : "DOS", _cur_grfconfig->version);
 
}
 

	
 
/* Action 0x0A */
 
static void SpriteReplace(ByteReader *buf)
 
{
 
	/* <0A> <num-sets> <set1> [<set2> ...]
 
@@ -5949,12 +5949,24 @@ static bool ChangeGRFPalette(size_t len,
 
				break;
 
		}
 
	}
 
	return true;
 
}
 

	
 
/** Callback function for 'INFO'->'VRSN' to the version of the NewGRF. */
 
static bool ChangeGRFVersion(size_t len, ByteReader *buf)
 
{
 
	if (len != 4) {
 
		grfmsg(2, "StaticGRFInfo: expected 4 bytes for 'INFO'->'VRSN' but got " PRINTF_SIZE ", ignoring this field", len);
 
		buf->Skip(len);
 
	} else {
 
		_cur_grfconfig->version = buf->ReadDWord();
 
	}
 
	return true;
 
}
 

	
 

	
 
static GRFParameterInfo *_cur_parameter; ///< The parameter which info is currently changed by the newgrf.
 

	
 
/** Callback function for 'INFO'->'PARAM'->param_num->'NAME' to set the name of a parameter. */
 
static bool ChangeGRFParamName(byte langid, const char *str)
 
{
 
@@ -6187,12 +6199,13 @@ static bool HandleParameterInfo(ByteRead
 

	
 
AllowedSubtags _tags_info[] = {
 
	AllowedSubtags('NAME', ChangeGRFName),
 
	AllowedSubtags('DESC', ChangeGRFDescription),
 
	AllowedSubtags('NPAR', ChangeGRFNumUsedParams),
 
	AllowedSubtags('PALS', ChangeGRFPalette),
 
	AllowedSubtags('VRSN', ChangeGRFVersion),
 
	AllowedSubtags('PARA', HandleParameterInfo),
 
	AllowedSubtags()
 
};
 

	
 
AllowedSubtags _tags_root[] = {
 
	AllowedSubtags('INFO', _tags_info),