diff options
author | Colin Snover | 2016-01-18 00:12:47 -0600 |
---|---|---|
committer | Colin Snover | 2016-02-18 13:18:02 -0600 |
commit | 75ccabc325d56876dd34d4a55e2034ee66d33d0b (patch) | |
tree | 01961ae148804e0206aa8c7858ac879471da04dd /engines/sci/graphics/palette32.cpp | |
parent | 4ba0ff8deb57aba3b034462c6c00ecf13ee281c9 (diff) | |
download | scummvm-rg350-75ccabc325d56876dd34d4a55e2034ee66d33d0b.tar.gz scummvm-rg350-75ccabc325d56876dd34d4a55e2034ee66d33d0b.tar.bz2 scummvm-rg350-75ccabc325d56876dd34d4a55e2034ee66d33d0b.zip |
SCI: Implement accurate renderer architecture for SCI32
Diffstat (limited to 'engines/sci/graphics/palette32.cpp')
-rw-r--r-- | engines/sci/graphics/palette32.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index e61ac5dac6..40e4021e72 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -47,11 +47,10 @@ GfxPalette32::GfxPalette32(ResourceManager *resMan, GfxScreen *screen) _version(1), _versionUpdated(false) { _varyPercent = _varyTargetPercent; memset(_fadeTable, 100, sizeof(_fadeTable)); - // NOTE: In SCI engine, the palette manager constructor loads // the default palette, but in ScummVM this initialisation // is performed by SciEngine::run; see r49523 for details - } +} GfxPalette32::~GfxPalette32() { unloadClut(); @@ -67,6 +66,10 @@ inline void mergePaletteInternal(Palette *const to, const Palette *const from) { } } +const Palette *GfxPalette32::getNextPalette() const { + return &_nextPalette; +} + void GfxPalette32::submit(Palette &palette) { // TODO: The resource manager in SCI32 retains raw data of palettes from // the ResourceManager (ResourceMgr) through SegManager (MemoryMgr), and @@ -206,10 +209,20 @@ int16 GfxPalette32::matchColor(const byte r, const byte g, const byte b, const i return bestIndex; } -void GfxPalette32::updateForFrame() { +bool GfxPalette32::updateForFrame() { applyAll(); _versionUpdated = false; // TODO: Implement remapping + // return g_sci->_gfxFrameout->remapAllTables(_nextPalette != _sysPalette); + return false; +} + +void GfxPalette32::updateFFrame() { + for (int i = 0; i < ARRAYSIZE(_nextPalette.colors); ++i) { + _nextPalette.colors[i] = _sourcePalette.colors[i]; + } + _versionUpdated = false; + // TODO: Implement remapping // g_sci->_gfxFrameout->remapAllTables(_nextPalette != _sysPalette); } @@ -410,7 +423,7 @@ void GfxPalette32::setVaryPercent(const int16 percent, const int time, const int } int16 GfxPalette32::getVaryPercent() const { - return abs(_varyPercent); + return ABS(_varyPercent); } void GfxPalette32::varyOff() { @@ -773,6 +786,12 @@ void GfxPalette32::applyCycles() { // Palette fading // +// NOTE: There are some game scripts (like SQ6 Sierra logo and main menu) that call +// setFade with numColorsToFade set to 256, but other parts of the engine like +// processShowStyleNone use 255 instead of 256. It is not clear if this is because +// the last palette entry is intentionally left unmodified, or if this is a bug +// in the engine. It certainly seems confused because all other places that accept +// colour ranges typically receive values in the range of 0–255. void GfxPalette32::setFade(uint8 percent, uint8 fromColor, uint16 numColorsToFade) { if (fromColor > numColorsToFade) { return; |