(svn r11651) -Codechange [FS#1555]: implement GRF parameter querying for industries and fix a 'bug' as side effect.
This commit is contained in:
@@ -24,6 +24,15 @@
|
||||
#include "sprite.h"
|
||||
#include "transparency.h"
|
||||
|
||||
static uint32 GetGRFParameter(IndustryGfx indtile_id, byte parameter)
|
||||
{
|
||||
const IndustryTileSpec *indtspec = GetIndustryTileSpec(indtile_id);
|
||||
const GRFFile *file = indtspec->grf_prop.grffile;
|
||||
|
||||
if (parameter >= file->param_end) return 0;
|
||||
return file->param[parameter];
|
||||
}
|
||||
|
||||
/**
|
||||
* Based on newhouses equivalent, but adapted for newindustries
|
||||
* @param parameter from callback. It's in fact a pair of coordinates
|
||||
@@ -101,6 +110,9 @@ static uint32 IndustryTileGetVariable(const ResolverObject *object, byte variabl
|
||||
|
||||
/* Get industry tile ID at offset */
|
||||
case 0x62 : return GetIndustryIDAtOffset(GetNearbyTile(parameter, tile), inds);
|
||||
|
||||
/* Read GRF parameter */
|
||||
case 0x7F: return GetGRFParameter(GetIndustryGfx(tile), parameter);
|
||||
}
|
||||
|
||||
DEBUG(grf, 1, "Unhandled industry tile property 0x%X", variable);
|
||||
|
Reference in New Issue
Block a user