Changeset - r3568:28403abe7c7c
[Not reviewed]
master
0 4 0
peter1138 - 18 years ago 2006-04-16 17:29:37
peter1138@openttd.org
(svn r4450) - NewStations, rename *CustomStationSprite() to *CustomStationSpecIndex() to reflect their use, and alter the test for determining if a station has customised graphics.
4 files changed with 10 insertions and 12 deletions:
0 comments (0 inline, 0 general)
docs/landscape.html
Show inline comments
 
@@ -381,8 +381,7 @@ exit towards: <tt>47</tt> - NE, <tt>48</
 
<li>m1: <a href="#OwnershipInfo">owner</a> of the station</li>
 
<li>m2: index into the <a href="#_StationArray">array of stations</a></li>
 
<li>m3 bits 0..3: <a href="#TrackType">track type</a> for railway stations, must be 0 for all the other stations</li>
 
<li>m3 bit 4 = use custom sprite (valid only railway stations FOR NOW)</li>
 
<li>m4 = custom station id</li>
 
<li>m4 = custom station id; 0 means standard graphics</li>
 
</ul>
 
</td></tr>
 

	
docs/landscape_grid.html
Show inline comments
 
@@ -145,7 +145,7 @@ the array so you can quickly see what is
 
      <td class="caption">station</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX XXXX XXXX</td>
 
      <td class="bits"><span class="free">OOO</span>X XXXX</td>
 
      <td class="bits"><span class="free">OOOO</span> XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
station_cmd.c
Show inline comments
 
@@ -1061,7 +1061,7 @@ int32 CmdBuildRailroadStation(TileIndex 
 

	
 
				MakeRailStation(tile, st->owner, st->index, axis, *layout_ptr++, GB(p2, 0, 4));
 

	
 
				if (HASBIT(p2, 4)) SetCustomStationSprite(tile, GB(p2, 8, 8));
 
				if (HASBIT(p2, 4)) SetCustomStationSpecIndex(tile, GB(p2, 8, 8));
 

	
 
				tile += tile_delta;
 
			} while (--w);
 
@@ -1934,9 +1934,9 @@ static void DrawTile_Station(TileInfo *t
 
	if (ti->tileh != 0 && !IsDock(ti->tile))
 
		DrawFoundation(ti, ti->tileh);
 

	
 
	if (IsCustomStationSprite(ti->tile)) {
 
	if (IsCustomStationSpecIndex(ti->tile)) {
 
		// look for customization
 
		const StationSpec *statspec = GetCustomStation(STAT_CLASS_DFLT, GetCustomStationSprite(ti->tile));
 
		const StationSpec *statspec = GetCustomStation(STAT_CLASS_DFLT, GetCustomStationSpecIndex(ti->tile));
 

	
 
		//debug("Cust-o-mized %p", statspec);
 

	
station_map.h
Show inline comments
 
@@ -218,20 +218,19 @@ static inline TileIndexDiffC GetDockOffs
 
	return dock_offset[GetDockDirection(t)];
 
}
 

	
 
static inline bool IsCustomStationSprite(TileIndex t)
 
static inline bool IsCustomStationSpecIndex(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	return HASBIT(_m[t].m3, 4);
 
	return _m[t].m4 != 0;
 
}
 

	
 
static inline void SetCustomStationSprite(TileIndex t, byte sprite)
 
static inline void SetCustomStationSpecIndex(TileIndex t, byte specindex)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	SETBIT(_m[t].m3, 4);
 
	_m[t].m4 = sprite;
 
	_m[t].m4 = specindex;
 
}
 

	
 
static inline uint GetCustomStationSprite(TileIndex t)
 
static inline uint GetCustomStationSpecIndex(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	return _m[t].m4;
0 comments (0 inline, 0 general)