summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-10-28 15:40:18 +0000
committerglx <glx@openttd.org>2007-10-28 15:40:18 +0000
commit6120d0275120b0830811f5eb983ffe05e9545bce (patch)
tree09da5f37172fa5f54c8410e10e03bff557736bb8 /src/train_cmd.cpp
parente6116d11b8cfd58d1880e79143de93900404e33c (diff)
downloadopenttd-6120d0275120b0830811f5eb983ffe05e9545bce.tar.xz
(svn r11352) -Codechange: cache callback 2D result (vehicle color mapping) instead calling it every time the vehicle is drawn
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 715472f2f..71dbebb0c 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -41,6 +41,7 @@
#include "date.h"
#include "cargotype.h"
#include "group.h"
+#include "table/sprites.h"
static bool TrainCheckIfLineEnds(Vehicle *v);
static void TrainController(Vehicle *v, bool update_image);
@@ -176,6 +177,9 @@ void TrainConsistChanged(Vehicle* v)
/* Cache wagon override sprite group. NULL is returned if there is none */
u->u.rail.cached_override = GetWagonOverrideSpriteSet(u->engine_type, u->cargo_type, u->u.rail.first_engine);
+ /* Reset color map */
+ u->colormap = PAL_NONE;
+
if (rvi_u->visual_effect != 0) {
u->u.rail.cached_vis_effect = rvi_u->visual_effect;
} else {