(svn r18121) -Codechange: pass the maximum left/right location to the Draw*Engine functions

This commit is contained in:
rubidium
2009-11-16 17:15:42 +00:00
parent 179b924173
commit 1c5a92ae98
9 changed files with 28 additions and 26 deletions

View File

@@ -657,7 +657,7 @@ static SpriteID GetRailIcon(EngineID engine, bool rear_head, int &y)
return GetDefaultTrainSprite(spritenum, DIR_W);
}
void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal)
void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
{
if (RailVehInfo(engine)->railveh_type == RAILVEH_MULTIHEAD) {
int yf = y;
@@ -665,11 +665,11 @@ void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal)
SpriteID spritef = GetRailIcon(engine, false, yf);
SpriteID spriter = GetRailIcon(engine, true, yr);
DrawSprite(spritef, pal, x - 14, yf);
DrawSprite(spriter, pal, x + 15, yr);
DrawSprite(spritef, pal, preferred_x - 14, yf);
DrawSprite(spriter, pal, preferred_x + 15, yr);
} else {
SpriteID sprite = GetRailIcon(engine, false, y);
DrawSprite(sprite, pal, x, y);
DrawSprite(sprite, pal, preferred_x, y);
}
}