diff options
author | Filippos Karapetis | 2014-12-07 14:37:51 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-07 14:40:53 +0200 |
commit | 6ec077e1b9f766da0a74bfb85b4ee2cc891cb348 (patch) | |
tree | d67bf557ad5f1818c09b4c4ce89c13e14bd6a115 /engines/agi | |
parent | c9e6db6571bd1c69d1a08bcc7d371cc68c3b53a0 (diff) | |
download | scummvm-rg350-6ec077e1b9f766da0a74bfb85b4ee2cc891cb348.tar.gz scummvm-rg350-6ec077e1b9f766da0a74bfb85b4ee2cc891cb348.tar.bz2 scummvm-rg350-6ec077e1b9f766da0a74bfb85b4ee2cc891cb348.zip |
AGI: Set the correct palette to use for each Amiga game
The Amiga palettes were added in 16529e58e6, but were never used.
A new game-specific option has been added for the old Amiga palette
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 1 | ||||
-rw-r--r-- | engines/agi/detection.cpp | 9 | ||||
-rw-r--r-- | engines/agi/graphics.cpp | 21 |
3 files changed, 28 insertions, 3 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 6bdbabd33e..73233d4f4c 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -500,6 +500,7 @@ static const GameSettings agiSettings[] = { AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("originalsaveload", "false"); + ConfMan.registerDefault("altamigapalette", "false"); _noSaveLoadAllowed = false; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 1d58900056..e7285d8112 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -145,6 +145,13 @@ static const ExtraGuiOption agiExtraGuiOption = { false }; +static const ExtraGuiOption agiExtraGuiOptionAmiga = { + _s("Use an alternative palette"), + _s("Use an alternative palette, common for all Amiga games. This was the old behavior"), + "altamigapalette", + false +}; + #include "agi/detection_tables.h" using namespace Agi; @@ -230,6 +237,8 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD const ExtraGuiOptions AgiMetaEngine::getExtraGuiOptions(const Common::String &target) const { ExtraGuiOptions options; options.push_back(agiExtraGuiOption); + if (target.contains("-amiga")) + options.push_back(agiExtraGuiOptionAmiga); return options; } diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 34651c70b2..317e747cdd 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -20,6 +20,7 @@ * */ +#include "common/config-manager.h" #include "common/file.h" #include "common/textconsole.h" @@ -220,7 +221,7 @@ static const uint8 amigaAgiPaletteV3[16 * 3] = { /** * 16 color amiga-ish palette. */ -static const uint8 newPalette[16 * 3] = { +static const uint8 altAmigaPalette[16 * 3] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x2A, 0x00, @@ -1030,8 +1031,22 @@ int GfxMgr::initVideo() { initPalette(vgaPalette, 256, 8); else if (_vm->_renderMode == Common::kRenderEGA) initPalette(egaPalette); - else - initPalette(newPalette); + else if (_vm->_renderMode == Common::kRenderAmiga) { + if (!ConfMan.getBool("altamigapalette")) { + // Set the correct Amiga palette + if (_vm->getVersion() < 0x2936) + // TODO: This palette isn't used for Apple IIGS games yet, as + // we don't set a separate render mode for them yet + initPalette(amigaAgiPaletteV1, 16, 4); + else if (_vm->getVersion() == 0x2936) + initPalette(amigaAgiPaletteV2, 16, 4); + else if (_vm->getVersion() > 0x2936) + initPalette(amigaAgiPaletteV3, 16, 4); + } else + // Set the old common alternative Amiga palette + initPalette(altAmigaPalette); + } else + error("initVideo: Unhandled render mode"); if ((_agiScreen = (uint8 *)calloc(GFX_WIDTH, GFX_HEIGHT)) == NULL) return errNotEnoughMemory; |