Changeset - r3474:e7fed2d1f48b
[Not reviewed]
master
0 2 0
celestar - 19 years ago 2006-04-08 05:24:29
celestar@openttd.org
(svn r4319) -Codechange: Station map accessors
2 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -1923,17 +1923,17 @@ static void DrawTile_Station(TileInfo *t
 

	
 
		if (statspec != NULL) {
 
			const Station* st = GetStationByTile(ti->tile);
 

	
 
			relocation = GetCustomStationRelocation(statspec, st, 0);
 
			//debug("Relocation %d", relocation);
 
			t = &statspec->renderdata[ti->map5];
 
			t = &statspec->renderdata[GetStationGfx(ti->tile)];
 
		}
 
	}
 

	
 
	if (t == NULL) t = &_station_display_datas[ti->map5];
 
	if (t == NULL) t = &_station_display_datas[GetStationGfx(ti->tile)];
 

	
 
	image = t->ground_sprite;
 
	if (image & PALETTE_MODIFIER_COLOR) image |= image_or_modificator;
 

	
 
	// For custom sprites, there's no railtype-based pitching.
 
	offset = (image & SPRITE_MASK) < _custom_sprites_base ? rti->total_offset : railtype;
station_map.h
Show inline comments
 
@@ -220,12 +220,18 @@ static inline void SetCustomStationSprit
 
static inline uint GetCustomStationSprite(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	return _m[t].m4;
 
}
 

	
 
static inline byte GetStationGfx(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	return _m[t].m5;
 
}
 

	
 

	
 
static inline void MakeStation(TileIndex t, Owner o, StationID sid, byte m5)
 
{
 
	SetTileType(t, MP_STATION);
 
	SetTileOwner(t, o);
 
	_m[t].m2 = sid;
0 comments (0 inline, 0 general)