summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-26 22:45:48 +0000
committersmatz <smatz@openttd.org>2009-05-26 22:45:48 +0000
commit5a463c8347fe1e68ab31dda1425e9060d52bfbd6 (patch)
tree55f5c9de8dcbda6268d003b29af59650594ce27a /src/smallmap_gui.cpp
parent7ee882d03f4c41d8659ed82fd5be0d0efbae0a0c (diff)
downloadopenttd-5a463c8347fe1e68ab31dda1425e9060d52bfbd6.tar.xz
(svn r16442) -Codechange: use new Vehicle accessors at more places
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r--src/smallmap_gui.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 1e397eb31..1692ee467 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -20,6 +20,7 @@
#include "vehicle_base.h"
#include "sound_func.h"
#include "window_func.h"
+#include "effectvehicle_base.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -739,13 +740,9 @@ public:
/* draw vehicles? */
if (this->map_type == SMT_CONTOUR || this->map_type == SMT_VEHICLES) {
- Vehicle *v;
- bool skip;
- byte colour;
-
- FOR_ALL_VEHICLES(v) {
- if (v->type != VEH_EFFECT &&
- (v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
+ EffectVehicle *v;
+ FOR_ALL_EFFECTVEHICLES(v) {
+ if ((v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
/* Remap into flat coordinates. */
Point pt = RemapCoords(
v->x_pos / TILE_SIZE - this->scroll_x / TILE_SIZE, // divide each one separately because (a-b)/c != a/c-b/c in integer world
@@ -759,7 +756,7 @@ public:
if (!IsInsideMM(y, 0, dpi->height)) continue;
/* Default is to draw both pixels. */
- skip = false;
+ bool skip = false;
/* Offset X coordinate */
x -= this->subscroll + 3 + dpi->left;
@@ -776,7 +773,7 @@ public:
}
/* Calculate pointer to pixel and the colour */
- colour = (this->map_type == SMT_VEHICLES) ? _vehicle_type_colours[v->type] : 0xF;
+ byte colour = (this->map_type == SMT_VEHICLES) ? _vehicle_type_colours[v->type] : 0xF;
/* And draw either one or two pixels depending on clipping */
blitter->SetPixel(dpi->dst_ptr, x, y, colour);