aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/palette.cpp20
-rw-r--r--engines/sci/graphics/palette.h3
-rw-r--r--engines/sci/sci.cpp2
3 files changed, 15 insertions, 10 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 3c4cf7e964..f9d320122b 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -36,7 +36,7 @@
namespace Sci {
-GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool autoSetPalette)
+GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen)
: _resMan(resMan), _screen(screen) {
int16 color;
@@ -57,19 +57,21 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool autoSetP
_sysPalette.colors[255].b = 255;
_sysPaletteChanged = false;
- if (autoSetPalette) {
- if (_resMan->getViewType() == kViewEga)
- setEGA();
- else if (_resMan->isAmiga32color())
- setAmiga();
- else
- kernelSetFromResource(999, true);
- }
}
GfxPalette::~GfxPalette() {
}
+// meant to get called only once during init of engine
+void GfxPalette::setDefault() {
+ if (_resMan->getViewType() == kViewEga)
+ setEGA();
+ else if (_resMan->isAmiga32color())
+ setAmiga();
+ else
+ kernelSetFromResource(999, true);
+}
+
#define SCI_PAL_FORMAT_CONSTANT 1
#define SCI_PAL_FORMAT_VARIABLE 0
diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h
index 46fec48739..d84436d708 100644
--- a/engines/sci/graphics/palette.h
+++ b/engines/sci/graphics/palette.h
@@ -36,9 +36,10 @@ class Screen;
*/
class GfxPalette {
public:
- GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool autoSetPalette = true);
+ GfxPalette(ResourceManager *resMan, GfxScreen *screen);
~GfxPalette();
+ void setDefault();
void createFromData(byte *data, Palette *paletteOut);
bool setAmiga();
void modifyAmigaPalette(byte *data);
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 8d23d5481c..888e72783c 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -254,6 +254,8 @@ Common::Error SciEngine::run() {
else
#endif
_gui->init(_features->usesOldGfxFunctions());
+ // Set default (EGA, amiga or resource 999) palette
+ _gfxPalette->setDefault();
debug("Emulating SCI version %s\n", getSciVersionDesc(getSciVersion()));