Changeset - r3737:eb79e5f07768
[Not reviewed]
master
0 3 0
peter1138 - 18 years ago 2006-05-03 20:35:41
peter1138@openttd.org
(svn r4719) - Newstations: instead of drawing nothing, fall back to the default sprite layout if a station layout specifies so.
3 files changed with 10 insertions and 15 deletions:
0 comments (0 inline, 0 general)
newgrf.c
Show inline comments
 
@@ -810,12 +810,9 @@ static bool StationChangeInfo(uint stid,
 
					uint seq_count = 0;
 
					PalSpriteID ground_sprite;
 

	
 
					dts->seq = NULL;
 
					ground_sprite = grf_load_dword(&buf);
 
					if (ground_sprite == 0) {
 
						static const DrawTileSeqStruct empty = {0x80, 0, 0, 0, 0, 0, 0};
 
						dts->seq = ∅
 
						continue;
 
					}
 
					if (ground_sprite == 0) continue;
 

	
 
					if (HASBIT(ground_sprite, 31)) {
 
						// Bit 31 indicates that we should use a custom sprite.
 
@@ -825,7 +822,6 @@ static bool StationChangeInfo(uint stid,
 
						dts->ground_sprite = ground_sprite;
 
					}
 

	
 
					dts->seq = NULL;
 
					while (buf < *bufp + len) {
 
						DrawTileSeqStruct *dtss;
 

	
 
@@ -861,15 +857,11 @@ static bool StationChangeInfo(uint stid,
 
					DrawTileSeqStruct const *sdtss = sdts->seq;
 
					int seq_count = 0;
 

	
 
					dts->seq = NULL;
 
					dts->ground_sprite = sdts->ground_sprite;
 
					if (dts->ground_sprite == 0) {
 
						static const DrawTileSeqStruct empty = {0x80, 0, 0, 0, 0, 0, 0};
 
						dts->seq = &empty;
 
						continue;
 
					}
 

	
 
					dts->seq = NULL;
 
					while (1) {
 
					if (dts->ground_sprite == 0) continue;
 

	
 
					while (true) {
 
						DrawTileSeqStruct *dtss;
 

	
 
						// no relative bounding box support
rail_cmd.c
Show inline comments
 
@@ -1335,6 +1335,8 @@ static void DrawTile_Track(TileInfo *ti)
 
				 * should be drawn in company colors, and it's
 
				 * up to the GRF file to decide that. */
 

	
 
				/* If there is no sprite layout, we fall back to the default waypoint graphics. */
 
				if (cust != NULL && cust->seq != NULL) {
 
				image = cust->ground_sprite;
 
				image += (image < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset;
 

	
 
@@ -1352,6 +1354,7 @@ static void DrawTile_Track(TileInfo *ti)
 
				return;
 
			}
 
		}
 
		}
 

	
 
		drss = is_depot ? _track_depot_layout_table[GetRailDepotDirection(ti->tile)] : _track_waypoint_layout_table[GetWaypointAxis(ti->tile)];
 

	
station_cmd.c
Show inline comments
 
@@ -1996,7 +1996,7 @@ static void DrawTile_Station(TileInfo *t
 
		}
 
	}
 

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

	
 
	image = t->ground_sprite;
 
	if (image & PALETTE_MODIFIER_COLOR) image |= image_or_modificator;
0 comments (0 inline, 0 general)