--- a/src/newgrf_fsmports.cpp Fri Aug 03 18:24:48 2007 +0000
+++ b/src/newgrf_fsmports.cpp Sat Aug 04 17:26:22 2007 +0000
@@ -576,57 +576,37 @@
/** Draw representation of a station tile for GUI purposes.
* @param x Position x of image.
* @param y Position y of image.
- * @param axis Axis.
- * @param railtype Rail type.
+ * @param tile tile ID from action 1 set
* @param sclass, station Type of station.
* @param station station ID
* @return True if the tile was drawn (allows for fallback to default graphic)
*/
-bool DrawFSMportsTile(int x, int y, RailType railtype, Axis axis, FSMportsClassID sclass, uint station)
+bool DrawFSMportsTile(int x, int y, byte tile, FSMportsClassID sclass, uint FSMports)
{
const FSMportsSpec *fsmportsspec;
const DrawTileSprites *sprites;
const DrawTileSeqStruct *seq;
- const RailtypeInfo *rti = GetRailTypeInfo(railtype);
SpriteID relocation;
SpriteID image;
SpriteID pal = PLAYER_SPRITE_COLOR(_local_player);
- uint tile = 2;
- fsmportsspec = GetCustomFSMportsSpec(sclass, station);
+ fsmportsspec = GetCustomFSMportsSpec(sclass, FSMports);
if (fsmportsspec == NULL) return false;
relocation = GetCustomFSMportsRelocation(fsmportsspec, NULL, INVALID_TILE);
- if (HASBIT(fsmportsspec->callbackmask, CBM_CUSTOM_LAYOUT)) {
- uint16 callback = GetFSMportsCallback(CBID_STATION_SPRITE_LAYOUT, 0x2110000, 0, fsmportsspec, NULL, INVALID_TILE);
- if (callback != CALLBACK_FAILED) tile = callback;
- }
+ assert(fsmportsspec->renderdata != NULL);
- if (fsmportsspec->renderdata == NULL) {
- sprites = GetStationTileLayout(STATION_AIRPORT, tile + axis);
- } else {
- sprites = &fsmportsspec->renderdata[(tile < fsmportsspec->tiles) ? tile + axis : (uint)axis];
- }
+ sprites = &fsmportsspec->renderdata[tile];
image = sprites->ground_sprite;
- if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
- image += GetCustomFSMportsGroundRelocation(fsmportsspec, NULL, INVALID_TILE);
- image += rti->custom_ground_offset;
- } else {
- image += rti->total_offset;
- }
-
+ image += relocation;
DrawSprite(image, PAL_NONE, x, y);
foreach_draw_tile_seq(seq, sprites->seq) {
Point pt;
image = seq->image;
- if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
- image += rti->total_offset;
- } else {
- image += relocation;
- }
+ image += relocation;
if ((byte)seq->delta_z != 0x80) {
pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);