diff options
author | frosch <frosch@openttd.org> | 2011-05-04 17:12:37 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-05-04 17:12:37 +0000 |
commit | bbcd2bab5dabc8eb12c1349aac1c3dfa7a6a036d (patch) | |
tree | 5d948cd0e875f2e29ecabecb143749b8c6b40ed9 /src | |
parent | c7a9c7dc927d60df77fe7824ed03f29bd1b29067 (diff) | |
download | openttd-bbcd2bab5dabc8eb12c1349aac1c3dfa7a6a036d.tar.xz |
(svn r22419) -Change: Always use the DOS palette for drawing.
-Remove: the '-i' option for palette selection.
Diffstat (limited to 'src')
-rw-r--r-- | src/base_media_base.h | 4 | ||||
-rw-r--r-- | src/blitter/32bpp_anim.cpp | 10 | ||||
-rw-r--r-- | src/gfx.cpp | 74 | ||||
-rw-r--r-- | src/gfx_func.h | 3 | ||||
-rw-r--r-- | src/gfx_type.h | 5 | ||||
-rw-r--r-- | src/gfxinit.cpp | 46 | ||||
-rw-r--r-- | src/newgrf.cpp | 16 | ||||
-rw-r--r-- | src/openttd.cpp | 12 | ||||
-rw-r--r-- | src/spritecache.cpp | 3 | ||||
-rw-r--r-- | src/spriteloader/grf.cpp | 6 | ||||
-rw-r--r-- | src/table/palette_convert.h | 4 | ||||
-rw-r--r-- | src/table/palettes.h | 99 |
12 files changed, 52 insertions, 230 deletions
diff --git a/src/base_media_base.h b/src/base_media_base.h index a8fae72f2..e0c02887d 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -207,10 +207,6 @@ struct GraphicsSet : BaseSet<GraphicsSet, MAX_GFT, DATA_DIR> { /** All data/functions related with replacing the base graphics. */ class BaseGraphics : public BaseMedia<GraphicsSet> { public: - /** - * Determine the palette of the current graphics set. - */ - static void DeterminePalette(); }; /** All data of a sounds set. */ diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp index 6549ca842..23dbc35c6 100644 --- a/src/blitter/32bpp_anim.cpp +++ b/src/blitter/32bpp_anim.cpp @@ -165,16 +165,16 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel do { /* Compiler assumes pointer aliasing, can't optimise this on its own */ uint m = *src_n++; - /* Above 217 (PALETTE_ANIM_SIZE_START) is palette animation */ + /* Above PALETTE_ANIM_START is palette animation */ *anim++ = m; - *dst++ = (m >= PALETTE_ANIM_SIZE_START) ? this->LookupColourInPalette(m) : src_px->data; + *dst++ = (m >= PALETTE_ANIM_START) ? this->LookupColourInPalette(m) : src_px->data; src_px++; } while (--n != 0); } else { do { uint m = *src_n++; *anim++ = m; - if (m >= PALETTE_ANIM_SIZE_START) { + if (m >= PALETTE_ANIM_START) { *dst = ComposeColourPANoCheck(this->LookupColourInPalette(m), src_px->a, *dst); } else { *dst = ComposeColourRGBANoCheck(src_px->r, src_px->g, src_px->b, src_px->a, *dst); @@ -299,8 +299,6 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, uint32 *usrc = (uint32 *)src; uint8 *anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf; - int count = (_use_palette == PAL_DOS) ? PALETTE_ANIM_SIZE_DOS : PALETTE_ANIM_SIZE_WIN; - for (; height > 0; height--) { /* We need to keep those for palette animation. */ uint32 *dst_pal = dst; @@ -323,7 +321,7 @@ void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, * palette animation, much cheaper though slightly nastier. */ for (int i = 0; i < width; i++) { uint colour = *anim_pal; - if (IsInsideBS(colour, PALETTE_ANIM_SIZE_START, count)) { + if (IsInsideBS(colour, PALETTE_ANIM_START, PALETTE_ANIM_SIZE)) { /* Update this pixel */ *dst_pal = LookupColourInPalette(colour); } diff --git a/src/gfx.cpp b/src/gfx.cpp index 62b8b024a..c83315058 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -292,8 +292,8 @@ static void SetColourRemap(TextColour colour) bool raw_colour = (colour & TC_IS_PALETTE_COLOUR) != 0; colour &= ~(TC_NO_SHADE | TC_IS_PALETTE_COLOUR); - _string_colourremap[1] = raw_colour ? (byte)colour : _string_colourmap[_use_palette][colour]; - _string_colourremap[2] = no_shade ? 0 : (_use_palette == PAL_DOS ? 1 : 215); + _string_colourremap[1] = raw_colour ? (byte)colour : _string_colourmap[colour]; + _string_colourremap[2] = no_shade ? 0 : 1; _colour_remap_ptr = _string_colourremap; } @@ -1255,7 +1255,7 @@ void DoPaletteAnimations(); void GfxInitPalettes() { - memcpy(_cur_palette, _palettes[_use_palette], sizeof(_cur_palette)); + memcpy(_cur_palette, _palette, sizeof(_cur_palette)); DoPaletteAnimations(); _pal_first_dirty = 0; @@ -1274,12 +1274,7 @@ void DoPaletteAnimations() Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); const Colour *s; const ExtraPaletteValues *ev = &_extra_palette_values; - /* Amount of colours to be rotated. - * A few more for the DOS palette, because the water colours are - * 245-254 for DOS and 217-226 for Windows. */ - const int colour_rotation_amount = (_use_palette == PAL_DOS) ? PALETTE_ANIM_SIZE_DOS : PALETTE_ANIM_SIZE_WIN; - Colour old_val[PALETTE_ANIM_SIZE_DOS]; - const int oldval_size = colour_rotation_amount * sizeof(*old_val); + Colour old_val[PALETTE_ANIM_SIZE]; const uint old_tc = palette_animation_counter; uint i; uint j; @@ -1288,28 +1283,10 @@ void DoPaletteAnimations() palette_animation_counter = 0; } - Colour *palette_pos = &_cur_palette[PALETTE_ANIM_SIZE_START]; // Points to where animations are taking place on the palette + Colour *palette_pos = &_cur_palette[PALETTE_ANIM_START]; // Points to where animations are taking place on the palette /* Makes a copy of the current anmation palette in old_val, * so the work on the current palette could be compared, see if there has been any changes */ - memcpy(old_val, palette_pos, oldval_size); - - /* Dark blue water */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->dark_water_toyland : ev->dark_water; - j = EXTR(320, EPV_CYCLES_DARK_WATER); - for (i = 0; i != EPV_CYCLES_DARK_WATER; i++) { - *palette_pos++ = s[j]; - j++; - if (j == EPV_CYCLES_DARK_WATER) j = 0; - } - - /* Glittery water; jumps over 3 colours each cycle! */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->glitter_water_toyland : ev->glitter_water; - j = EXTR(128, EPV_CYCLES_GLITTER_WATER); - for (i = 0; i != EPV_CYCLES_GLITTER_WATER / 3; i++) { - *palette_pos++ = s[j]; - j += 3; - if (j >= EPV_CYCLES_GLITTER_WATER) j -= EPV_CYCLES_GLITTER_WATER; - } + memcpy(old_val, palette_pos, sizeof(old_val)); /* Fizzy Drink bubbles animation */ s = ev->fizzy_drink; @@ -1369,34 +1346,31 @@ void DoPaletteAnimations() if (j == EPV_CYCLES_LIGHTHOUSE) j = 0; } - /* Animate water for old DOS graphics */ - if (_use_palette == PAL_DOS) { - /* Dark blue water DOS */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->dark_water_toyland : ev->dark_water; - j = EXTR(320, EPV_CYCLES_DARK_WATER); - for (i = 0; i != EPV_CYCLES_DARK_WATER; i++) { - *palette_pos++ = s[j]; - j++; - if (j == EPV_CYCLES_DARK_WATER) j = 0; - } + /* Dark blue water */ + s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->dark_water_toyland : ev->dark_water; + j = EXTR(320, EPV_CYCLES_DARK_WATER); + for (i = 0; i != EPV_CYCLES_DARK_WATER; i++) { + *palette_pos++ = s[j]; + j++; + if (j == EPV_CYCLES_DARK_WATER) j = 0; + } - /* Glittery water DOS */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->glitter_water_toyland : ev->glitter_water; - j = EXTR(128, EPV_CYCLES_GLITTER_WATER); - for (i = 0; i != EPV_CYCLES_GLITTER_WATER / 3; i++) { - *palette_pos++ = s[j]; - j += 3; - if (j >= EPV_CYCLES_GLITTER_WATER) j -= EPV_CYCLES_GLITTER_WATER; - } + /* Glittery water */ + s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->glitter_water_toyland : ev->glitter_water; + j = EXTR(128, EPV_CYCLES_GLITTER_WATER); + for (i = 0; i != EPV_CYCLES_GLITTER_WATER / 3; i++) { + *palette_pos++ = s[j]; + j += 3; + if (j >= EPV_CYCLES_GLITTER_WATER) j -= EPV_CYCLES_GLITTER_WATER; } if (blitter != NULL && blitter->UsePaletteAnimation() == Blitter::PALETTE_ANIMATION_NONE) { palette_animation_counter = old_tc; } else { - if (memcmp(old_val, &_cur_palette[PALETTE_ANIM_SIZE_START], oldval_size) != 0) { + if (memcmp(old_val, &_cur_palette[PALETTE_ANIM_START], sizeof(old_val)) != 0) { /* Did we changed anything on the palette? Seems so. Mark it as dirty */ - _pal_first_dirty = PALETTE_ANIM_SIZE_START; - _pal_count_dirty = colour_rotation_amount; + _pal_first_dirty = PALETTE_ANIM_START; + _pal_count_dirty = PALETTE_ANIM_SIZE; } } } diff --git a/src/gfx_func.h b/src/gfx_func.h index afc0a083f..cfedd74c1 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -180,9 +180,6 @@ extern DrawPixelInfo *_cur_dpi; */ extern byte _colour_gradient[COLOUR_END][8]; -extern PaletteType _use_palette; extern bool _palette_remap_grf[]; -extern const byte *_palette_remap; -extern const byte *_palette_reverse_remap; #endif /* GFX_FUNC_H */ diff --git a/src/gfx_type.h b/src/gfx_type.h index 146d033ba..77111b767 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -234,9 +234,8 @@ DECLARE_ENUM_AS_BIT_SET(TextColour) /** Defines a few values that are related to animations using palette changes */ enum PaletteAnimationSizes { - PALETTE_ANIM_SIZE_WIN = 28, ///< number of animated colours in Windows palette - PALETTE_ANIM_SIZE_DOS = 38, ///< number of animated colours in DOS palette - PALETTE_ANIM_SIZE_START = 217, ///< Index in the _palettes array from which all animations are taking places (table/palettes.h) + PALETTE_ANIM_SIZE = 28, ///< number of animated colours + PALETTE_ANIM_START = 227, ///< Index in the _palettes array from which all animations are taking places (table/palettes.h) }; /** Define the operation GfxFillRect performs */ diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index a90235b14..d25d8ec8c 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -21,16 +21,9 @@ #include "base_media_func.h" #include "table/sprites.h" -#include "table/palette_convert.h" -/** The currently used palette */ -PaletteType _use_palette = PAL_AUTODETECT; -/** Whether the given NewGRFs must get a palette remap or not. */ +/** Whether the given NewGRFs must get a palette remap from windows to DOS or not. */ bool _palette_remap_grf[MAX_FILE_SLOTS]; -/** Palette map to go from the !_use_palette to the _use_palette */ -const byte *_palette_remap = NULL; -/** Palette map to go from the _use_palette to the !_use_palette */ -const byte *_palette_reverse_remap = NULL; #include "table/landscape_sprite.h" @@ -96,10 +89,9 @@ void CheckExternalFiles() { if (BaseGraphics::GetUsedSet() == NULL || BaseSounds::GetUsedSet() == NULL) return; - BaseGraphics::DeterminePalette(); const GraphicsSet *used_set = BaseGraphics::GetUsedSet(); - DEBUG(grf, 1, "Using the %s base graphics set with the %s palette", used_set->name, _use_palette == PAL_DOS ? "DOS" : "Windows"); + DEBUG(grf, 1, "Using the %s base graphics set", used_set->name); static const size_t ERROR_MESSAGE_LENGTH = 256; static const size_t MISSING_FILE_MESSAGE_LENGTH = 128; @@ -142,7 +134,7 @@ static void LoadSpriteTables() uint i = FIRST_GRF_SLOT; const GraphicsSet *used_set = BaseGraphics::GetUsedSet(); - _palette_remap_grf[i] = (_use_palette != used_set->palette); + _palette_remap_grf[i] = (PAL_DOS != used_set->palette); LoadGrfFile(used_set->files[GFT_BASE].filename, 0, i++); /* @@ -151,7 +143,7 @@ static void LoadSpriteTables() * has a few sprites less. However, we do not care about those missing * sprites as they are not shown anyway (logos in intro game). */ - _palette_remap_grf[i] = (_use_palette != used_set->palette); + _palette_remap_grf[i] = (PAL_DOS != used_set->palette); LoadGrfFile(used_set->files[GFT_LOGOS].filename, 4793, i++); /* @@ -160,7 +152,7 @@ static void LoadSpriteTables() * and the ground sprites. */ if (_settings_game.game_creation.landscape != LT_TEMPERATE) { - _palette_remap_grf[i] = (_use_palette != used_set->palette); + _palette_remap_grf[i] = (PAL_DOS != used_set->palette); LoadGrfIndexed( used_set->files[GFT_ARCTIC + _settings_game.game_creation.landscape - 1].filename, _landscape_spriteindexes[_settings_game.game_creation.landscape - 1], @@ -266,32 +258,6 @@ static const char * const _graphics_file_names[] = { "base", "logos", "arctic", template <class T, size_t Tnum_files, Subdirectory Tsubdir> /* static */ const char * const *BaseSet<T, Tnum_files, Tsubdir>::file_names = _graphics_file_names; -/** - * Determine the palette that has to be used. - * - forced palette via command line -> leave it that way - * - otherwise -> palette based on the graphics pack - */ -/* static */ void BaseGraphics::DeterminePalette() -{ - assert(BaseGraphics::used_set != NULL); - if (_use_palette >= MAX_PAL) _use_palette = BaseGraphics::used_set->palette; - - switch (_use_palette) { - case PAL_DOS: - _palette_remap = _palmap_w2d; - _palette_reverse_remap = _palmap_d2w; - break; - - case PAL_WINDOWS: - _palette_remap = _palmap_d2w; - _palette_reverse_remap = _palmap_w2d; - break; - - default: - NOT_REACHED(); - } -} - template <class Tbase_set> /* static */ bool BaseMedia<Tbase_set>::DetermineBestSet() { @@ -307,7 +273,7 @@ template <class Tbase_set> best->valid_files < c->valid_files || (best->valid_files == c->valid_files && ( (best->shortname == c->shortname && best->version < c->version) || - (best->palette != _use_palette && c->palette == _use_palette)))) { + (best->palette != PAL_DOS && c->palette == PAL_DOS)))) { best = c; } } diff --git a/src/newgrf.cpp b/src/newgrf.cpp index bf99651c1..f5e67aa1e 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -315,12 +315,6 @@ StringID MapGRFStringID(uint32 grfid, StringID str) return TTDPStringIDToOTTDStringIDMapping(str); } -static inline uint8 MapDOSColour(uint8 colour) -{ - extern const byte _palmap_d2w[]; - return (_use_palette == PAL_DOS ? colour : _palmap_d2w[colour]); -} - static std::map<uint32, uint32> _grf_id_overrides; static void SetNewGRFOverride(uint32 source_grfid, uint32 target_grfid) @@ -2192,11 +2186,11 @@ static ChangeInfoResult CargoChangeInfo(uint cid, int numinfo, int prop, ByteRea break; case 0x13: // Colour for station rating bars - cs->rating_colour = MapDOSColour(buf->ReadByte()); + cs->rating_colour = buf->ReadByte(); break; case 0x14: // Colour for cargo graph - cs->legend_colour = MapDOSColour(buf->ReadByte()); + cs->legend_colour = buf->ReadByte(); break; case 0x15: // Freight status @@ -2802,7 +2796,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, break; case 0x19: // Map colour - indsp->map_colour = MapDOSColour(buf->ReadByte()); + indsp->map_colour = buf->ReadByte(); break; case 0x1A: // Special industry flags to define special behavior @@ -3301,7 +3295,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR break; case 0x16: // Map colour - rti->map_colour = MapDOSColour(buf->ReadByte()); + rti->map_colour = buf->ReadByte(); break; case 0x17: // Introduction date @@ -7948,7 +7942,7 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage) FioOpenFile(file_index, filename); _file_index = file_index; // XXX - _palette_remap_grf[_file_index] = ((config->palette & GRFP_USE_MASK) != (_use_palette == PAL_WINDOWS)); + _palette_remap_grf[_file_index] = (config->palette & GRFP_USE_MASK); _cur_grfconfig = config; diff --git a/src/openttd.cpp b/src/openttd.cpp index 816180ba2..370b0b246 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -172,10 +172,6 @@ static void ShowHelp() " -f = Fork into the background (dedicated only)\n" #endif #endif /* ENABLE_NETWORK */ - " -i palette = Force to use the DOS (0) or Windows (1) palette\n" - " (defines default setting when adding newgrfs)\n" - " Default value (2) lets OpenTTD use the palette\n" - " specified in graphics set file (see below)\n" " -I graphics_set = Force the graphics set (see below)\n" " -S sounds_set = Force the sounds set (see below)\n" " -M music_set = Force the music set (see below)\n" @@ -356,7 +352,6 @@ static const OptionData _options[] = { GETOPT_SHORT_VALUE('t'), GETOPT_SHORT_OPTVAL('d'), GETOPT_SHORT_NOVAL('e'), - GETOPT_SHORT_OPTVAL('i'), GETOPT_SHORT_OPTVAL('g'), GETOPT_SHORT_VALUE('G'), GETOPT_SHORT_VALUE('c'), @@ -457,13 +452,6 @@ int ttd_main(int argc, char *argv[]) break; } case 'e': _switch_mode = SM_EDITOR; break; - case 'i': - /* there is an argument, it is not empty, and it is exactly 1 char long */ - if (!StrEmpty(mgo.opt) && mgo.opt[1] == '\0') { - _use_palette = (PaletteType)(mgo.opt[0] - '0'); - if (_use_palette <= MAX_PAL) break; - } - usererror("Valid value for '-i' is 0, 1 or 2"); case 'g': if (mgo.opt != NULL) { strecpy(_file_to_saveload.name, mgo.opt, lastof(_file_to_saveload.name)); diff --git a/src/spritecache.cpp b/src/spritecache.cpp index f11882d5e..7765c340a 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -20,6 +20,7 @@ #include "core/math_func.hpp" #include "table/sprites.h" +#include "table/palette_convert.h" /* Default of 4MB spritecache */ uint _sprite_cache_size = 4; @@ -237,7 +238,7 @@ static void *ReadSprite(const SpriteCache *sc, SpriteID id, SpriteType sprite_ty /* The data of index 0 is never used; "literal 00" according to the (New)GRF specs. */ for (int i = 1; i < RECOLOUR_SPRITE_SIZE; i++) { - dest[i] = _palette_remap[dest_tmp[_palette_reverse_remap[i - 1] + 1]]; + dest[i] = _palmap_w2d[dest_tmp[_palmap_d2w[i - 1] + 1]]; } } else { FioReadBlock(dest, num); 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; } diff --git a/src/table/palette_convert.h b/src/table/palette_convert.h index 02f4478f3..863216af0 100644 --- a/src/table/palette_convert.h +++ b/src/table/palette_convert.h @@ -10,7 +10,7 @@ /** @file palette_convert.h Translation tables from one GRF to another GRF. */ /** Converting from the Windows palette to the DOS palette */ -static const byte _palmap_w2d[] = { +extern const byte _palmap_w2d[] = { 0, 1, 2, 3, 4, 5, 6, 7, // 0..7 8, 9, 10, 11, 12, 13, 14, 15, // 8..15 16, 17, 18, 19, 20, 21, 22, 23, // 16..23 @@ -46,7 +46,7 @@ static const byte _palmap_w2d[] = { }; /** Converting from the DOS palette to the Windows palette */ -extern const byte _palmap_d2w[] = { +static const byte _palmap_d2w[] = { 0, 215, 216, 136, 88, 106, 32, 33, // 0..7 40, 245, 10, 11, 12, 13, 14, 15, // 8..15 16, 17, 18, 19, 20, 21, 22, 23, // 16..23 diff --git a/src/table/palettes.h b/src/table/palettes.h index 719725a1d..323c5e302 100644 --- a/src/table/palettes.h +++ b/src/table/palettes.h @@ -13,9 +13,8 @@ #define M(r, g, b) { 0xff << 24 | (r) << 16 | (g) << 8 | (b) } -static const Colour _palettes[][256] = { - /* palette 0 (mixed TTD DOS + TTD Windows palette */ - { +static const Colour _palette[256] = { + /* mixed TTD DOS + TTD Windows palette */ { 0}, M( 16, 16, 16), M( 32, 32, 32), M( 48, 48, 48), M( 65, 64, 65), M( 82, 80, 82), M( 98, 101, 98), M(115, 117, 115), M(131, 133, 131), M(148, 149, 148), M(168, 168, 168), M(184, 184, 184), @@ -80,79 +79,8 @@ static const Colour _palettes[][256] = { M(252, 228, 0), M(148, 148, 148), M( 16, 101, 115), M( 24, 109, 123), M( 32, 117, 131), M( 41, 125, 139), M( 90, 165, 189), M(115, 182, 197), M(148, 202, 222), M(180, 222, 238), M(222, 246, 255), M(252, 252, 252) - }, - - /* palette 1 (TTD Windows) */ - { - { 0}, M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), - M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), - M(212, 0, 212), M(212, 0, 212), M(168, 168, 168), M(184, 184, 184), - M(200, 200, 200), M(216, 216, 216), M(232, 232, 232), M(252, 252, 252), - M( 52, 60, 72), M( 68, 76, 92), M( 88, 96, 112), M(108, 116, 132), - M(132, 140, 152), M(156, 160, 172), M(176, 184, 196), M(204, 208, 220), - M( 48, 44, 4), M( 64, 60, 12), M( 80, 76, 20), M( 96, 92, 28), - M(120, 120, 64), M(148, 148, 100), M(176, 176, 132), M(204, 204, 168), - M(100, 100, 100), M(116, 116, 116), M(104, 80, 44), M(124, 104, 72), - M(152, 132, 92), M(184, 160, 120), M(212, 188, 148), M(244, 220, 176), - M(132, 132, 132), M( 88, 4, 16), M(112, 16, 32), M(136, 32, 52), - M(160, 56, 76), M(188, 84, 108), M(204, 104, 124), M(220, 132, 144), - M(236, 156, 164), M(252, 188, 192), M(252, 212, 0), M(252, 232, 60), - M(252, 248, 128), M( 76, 40, 0), M( 96, 60, 8), M(116, 88, 28), - M(136, 116, 56), M(156, 136, 80), M(176, 156, 108), M(196, 180, 136), - M( 68, 24, 0), M( 96, 44, 4), M(128, 68, 8), M(156, 96, 16), - M(184, 120, 24), M(212, 156, 32), M(232, 184, 16), M(252, 212, 0), - M(252, 248, 128), M(252, 252, 192), M( 32, 4, 0), M( 64, 20, 8), - M( 84, 28, 16), M(108, 44, 28), M(128, 56, 40), M(148, 72, 56), - M(168, 92, 76), M(184, 108, 88), M(196, 128, 108), M(212, 148, 128), - M( 8, 52, 0), M( 16, 64, 0), M( 32, 80, 4), M( 48, 96, 4), - M( 64, 112, 12), M( 84, 132, 20), M(104, 148, 28), M(128, 168, 44), - M( 64, 64, 64), M( 44, 68, 32), M( 60, 88, 48), M( 80, 104, 60), - M(104, 124, 76), M(128, 148, 92), M(152, 176, 108), M(180, 204, 124), - M( 16, 52, 24), M( 32, 72, 44), M( 56, 96, 72), M( 76, 116, 88), - M( 96, 136, 108), M(120, 164, 136), M(152, 192, 168), M(184, 220, 200), - M( 32, 24, 0), M( 56, 28, 0), M( 80, 80, 80), M( 88, 52, 12), - M(104, 64, 24), M(124, 84, 44), M(140, 108, 64), M(160, 128, 88), - M( 76, 40, 16), M( 96, 52, 24), M(116, 68, 40), M(136, 84, 56), - M(164, 96, 64), M(184, 112, 80), M(204, 128, 96), M(212, 148, 112), - M(224, 168, 128), M(236, 188, 148), M( 80, 28, 4), M(100, 40, 20), - M(120, 56, 40), M(140, 76, 64), M(160, 100, 96), M(184, 136, 136), - M( 36, 40, 68), M( 48, 52, 84), M( 64, 64, 100), M( 80, 80, 116), - M(100, 100, 136), M(132, 132, 164), M(172, 172, 192), M(212, 212, 224), - M( 48, 48, 48), M( 64, 44, 144), M( 88, 64, 172), M(104, 76, 196), - M(120, 88, 224), M(140, 104, 252), M(160, 136, 252), M(188, 168, 252), - M( 0, 24, 108), M( 0, 36, 132), M( 0, 52, 160), M( 0, 72, 184), - M( 0, 96, 212), M( 24, 120, 220), M( 56, 144, 232), M( 88, 168, 240), - M(128, 196, 252), M(188, 224, 252), M( 16, 64, 96), M( 24, 80, 108), - M( 40, 96, 120), M( 52, 112, 132), M( 80, 140, 160), M(116, 172, 192), - M(156, 204, 220), M(204, 240, 252), M(172, 52, 52), M(212, 52, 52), - M(252, 52, 52), M(252, 100, 88), M(252, 144, 124), M(252, 184, 160), - M(252, 216, 200), M(252, 244, 236), M( 72, 20, 112), M( 92, 44, 140), - M(112, 68, 168), M(140, 100, 196), M(168, 136, 224), M(204, 180, 252), - M(204, 180, 252), M(232, 208, 252), M( 60, 0, 0), M( 92, 0, 0), - M(128, 0, 0), M(160, 0, 0), M(196, 0, 0), M(224, 0, 0), - M(252, 0, 0), M(252, 80, 0), M(252, 108, 0), M(252, 136, 0), - M(252, 164, 0), M(252, 192, 0), M(252, 220, 0), M(252, 252, 0), - M(204, 136, 8), M(228, 144, 4), M(252, 156, 0), M(252, 176, 48), - M(252, 196, 100), M(252, 216, 152), M( 8, 24, 88), M( 12, 36, 104), - M( 20, 52, 124), M( 28, 68, 140), M( 40, 92, 164), M( 56, 120, 188), - M( 72, 152, 216), M(100, 172, 224), M( 92, 156, 52), M(108, 176, 64), - M(124, 200, 76), M(144, 224, 92), M(224, 244, 252), M(204, 240, 252), - M(180, 220, 236), M(132, 188, 216), M( 88, 152, 172), M( 16, 16, 16), - M( 32, 32, 32), M( 8, 92, 104), M( 16, 100, 112), M( 24, 108, 120), - M( 32, 116, 128), M( 44, 124, 140), M( 92, 164, 184), M(116, 180, 196), - M(148, 200, 216), M(180, 220, 232), M(216, 244, 252), M( 0, 0, 0), - M( 0, 0, 0), M( 0, 0, 0), M( 0, 0, 0), M( 0, 0, 0), - M(252, 60, 0), M(252, 80, 0), M(252, 104, 0), M(252, 128, 0), - M(252, 148, 0), M(252, 172, 0), M(252, 196, 0), M(252, 0, 0), - M(252, 0, 0), M( 0, 0, 0), M( 0, 0, 0), M( 0, 0, 0), - M(252, 228, 0), M(148, 148, 148), M(212, 0, 212), M(212, 0, 212), - M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), - M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), M(252, 252, 252) - } }; -#define GET_PALETTE(x) _palettes[x] - /** Description of the length of the palette cycle animations */ static const uint EPV_CYCLES_DARK_WATER = 5; ///< length of the dark blue water animation static const uint EPV_CYCLES_LIGHTHOUSE = 4; ///< length of the lighthouse/stadium animation @@ -207,8 +135,7 @@ static const ExtraPaletteValues _extra_palette_values = { #undef M /** Colour mapping for the TextColours. */ -static const byte _string_colourmap[][17] = { - { // DOS palette. +static const byte _string_colourmap[17] = { 150, // TC_BLUE 12, // TC_SILVER 189, // TC_GOLD @@ -226,24 +153,4 @@ static const byte _string_colourmap[][17] = { 6, // TC_GREY 133, // TC_DARK_BLUE 1, // TC_BLACK - }, - { // Windows palette. - 150, // TC_BLUE - 12, // TC_SILVER - 189, // TC_GOLD - 184, // TC_RED - 174, // TC_PURPLE - 30, // TC_LIGHT_BROWN - 195, // TC_ORANGE - 209, // TC_GREEN - 68, // TC_YELLOW - 95, // TC_DARK_GREEN - 79, // TC_CREAM - 116, // TC_BROWN - 15, // TC_WHITE - 152, // TC_LIGHT_BLUE - 32, // TC_GREY - 133, // TC_DARK_BLUE - 215, // TC_BLACK - } }; |