summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-01-14 19:57:49 +0000
committerpeter1138 <peter1138@openttd.org>2007-01-14 19:57:49 +0000
commit92d418b031d23cf42a4df09e12945cc4b737bce2 (patch)
treec62990da208a45b3bd1c7379a1835190458d5a49 /src/train_cmd.cpp
parent19d31c7417e4c8ad763c6674b7d1c6f9022e3703 (diff)
downloadopenttd-92d418b031d23cf42a4df09e12945cc4b737bce2.tar.xz
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
This lets us increase the sprite width from 14 to up to 29 bits, effectively nulling the old sprite limit. Table changes in next commit.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 5f2acb663..00c998f8d 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -479,12 +479,12 @@ int GetTrainImage(const Vehicle* v, Direction direction)
return base;
}
-void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
+void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal)
{
const RailVehicleInfo *rvi = RailVehInfo(engine);
int img = rvi->image_index;
- uint32 image = 0;
+ SpriteID image = 0;
if (is_custom_sprite(img)) {
image = GetCustomVehicleIcon(engine, DIR_W);
@@ -499,7 +499,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
}
if (rvi->flags & RVI_MULTIHEAD) {
- DrawSprite(image | image_ormod, x - 14, y);
+ DrawSprite(image, pal, x - 14, y);
x += 15;
image = 0;
if (is_custom_sprite(img)) {
@@ -512,7 +512,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
_engine_sprite_base[img + 1];
}
}
- DrawSprite(image | image_ormod, x, y);
+ DrawSprite(image, pal, x, y);
}
uint CountArticulatedParts(EngineID engine_type)
@@ -3045,7 +3045,7 @@ static void TrainController(Vehicle *v, bool update_image)
} else {
/* is not inside depot */
- if (!TrainCheckIfLineEnds(v)) return;
+ if (IsFrontEngine(v) && !TrainCheckIfLineEnds(v)) return;
r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
if (r & 0x8) {