summaryrefslogtreecommitdiff
path: root/src/spriteloader
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-04 17:12:37 +0000
committerfrosch <frosch@openttd.org>2011-05-04 17:12:37 +0000
commitbbcd2bab5dabc8eb12c1349aac1c3dfa7a6a036d (patch)
tree5d948cd0e875f2e29ecabecb143749b8c6b40ed9 /src/spriteloader
parentc7a9c7dc927d60df77fe7824ed03f29bd1b29067 (diff)
downloadopenttd-bbcd2bab5dabc8eb12c1349aac1c3dfa7a6a036d.tar.xz
(svn r22419) -Change: Always use the DOS palette for drawing.
-Remove: the '-i' option for palette selection.
Diffstat (limited to 'src/spriteloader')
-rw-r--r--src/spriteloader/grf.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/spriteloader/grf.cpp b/src/spriteloader/grf.cpp
index 1d4622ef6..a0f5c8632 100644
--- a/src/spriteloader/grf.cpp
+++ b/src/spriteloader/grf.cpp
@@ -19,6 +19,8 @@
#include "../core/math_func.hpp"
#include "grf.hpp"
+extern const byte _palmap_w2d[];
+
/**
* We found a corrupted sprite. This means that the sprite itself
* contains invalid data or is too small for the given dimensions.
@@ -129,7 +131,7 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
for (int x = 0; x < length; x++) {
switch (sprite_type) {
- case ST_NORMAL: data->m = _palette_remap_grf[file_slot] ? _palette_remap[*dest] : *dest; break;
+ case ST_NORMAL: data->m = _palette_remap_grf[file_slot] ? _palmap_w2d[*dest] : *dest; break;
case ST_FONT: data->m = min(*dest, 2u); break;
default: data->m = *dest; break;
}
@@ -154,7 +156,7 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
for (int i = 0; i < sprite->width * sprite->height; i++) {
switch (sprite_type) {
- case ST_NORMAL: sprite->data[i].m = _palette_remap_grf[file_slot] ? _palette_remap[dest[i]] : dest[i]; break;
+ case ST_NORMAL: sprite->data[i].m = _palette_remap_grf[file_slot] ? _palmap_w2d[dest[i]] : dest[i]; break;
case ST_FONT: sprite->data[i].m = min(dest[i], 2u); break;
default: sprite->data[i].m = dest[i]; break;
}