mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24840) -Fix: Draw NewGRF railtypes in NewGRF station previews.
This commit is contained in:
parent
245e32a10e
commit
fb58c42aa0
|
@ -843,10 +843,16 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
|
||||||
|
|
||||||
SpriteID image = sprites->ground.sprite;
|
SpriteID image = sprites->ground.sprite;
|
||||||
PaletteID pal = sprites->ground.pal;
|
PaletteID pal = sprites->ground.pal;
|
||||||
image += HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? ground_relocation : total_offset;
|
RailTrackOffset overlay_offset;
|
||||||
if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += ground_relocation;
|
if (rti != NULL && rti->UsesOverlay() && SplitGroundSpriteForOverlay(NULL, &image, &overlay_offset)) {
|
||||||
|
SpriteID ground = GetCustomRailSprite(rti, INVALID_TILE, RTSG_GROUND);
|
||||||
DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y);
|
DrawSprite(image, PAL_NONE, x, y);
|
||||||
|
DrawSprite(ground + overlay_offset, PAL_NONE, x, y);
|
||||||
|
} else {
|
||||||
|
image += HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? ground_relocation : total_offset;
|
||||||
|
if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += ground_relocation;
|
||||||
|
DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
DrawRailTileSeqInGUI(x, y, sprites, total_offset, relocation, palette);
|
DrawRailTileSeqInGUI(x, y, sprites, total_offset, relocation, palette);
|
||||||
|
|
||||||
|
|
|
@ -2559,7 +2559,7 @@ const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx)
|
||||||
* @param [out] overlay_offset Overlay to draw.
|
* @param [out] overlay_offset Overlay to draw.
|
||||||
* @return true if overlay can be drawn.
|
* @return true if overlay can be drawn.
|
||||||
*/
|
*/
|
||||||
static bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset)
|
bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset)
|
||||||
{
|
{
|
||||||
bool snow_desert;
|
bool snow_desert;
|
||||||
switch (*ground) {
|
switch (*ground) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "rail_type.h"
|
#include "rail_type.h"
|
||||||
#include "road_type.h"
|
#include "road_type.h"
|
||||||
#include "economy_func.h"
|
#include "economy_func.h"
|
||||||
|
#include "rail.h"
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
|
void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
|
||||||
|
|
||||||
|
@ -44,6 +45,8 @@ bool CanStationTileHaveWires(TileIndex tile);
|
||||||
|
|
||||||
void UpdateAirportsNoise();
|
void UpdateAirportsNoise();
|
||||||
|
|
||||||
|
bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrackOffset *overlay_offset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the maintenance cost of a number of station tiles.
|
* Calculates the maintenance cost of a number of station tiles.
|
||||||
* @param num Number of station tiles.
|
* @param num Number of station tiles.
|
||||||
|
|
Loading…
Reference in New Issue