From bc362e5b7cf5867946adc45c3a961050323e14b5 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 9 Jul 2016 19:36:17 -0500 Subject: SCI32: Minor cleanup of GfxPalette32 --- engines/sci/graphics/palette32.cpp | 14 ++++++-------- engines/sci/graphics/palette32.h | 10 +++++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index a43ac27e2e..4ee33bdd38 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -145,12 +145,12 @@ GfxPalette32::GfxPalette32(ResourceManager *resMan) // Palette cycling _cyclers(), _cycleMap() { - _varyPercent = _varyTargetPercent; - for (int i = 0, len = ARRAYSIZE(_fadeTable); i < len; ++i) { - _fadeTable[i] = 100; - } + _varyPercent = _varyTargetPercent; + for (int i = 0, len = ARRAYSIZE(_fadeTable); i < len; ++i) { + _fadeTable[i] = 100; + } - loadPalette(999); + loadPalette(999); } GfxPalette32::~GfxPalette32() { @@ -356,7 +356,7 @@ inline Palette GfxPalette32::getPaletteFromResourceInternal(const GuiResourceId Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), false); if (!palResource) { - error("Could not load vary target %d", resourceId); + error("Could not load vary palette %d", resourceId); } HunkPalette rawPalette(palResource->data); @@ -384,8 +384,6 @@ inline void GfxPalette32::setVaryTimeInternal(const int16 percent, const int tim } } -// TODO: This gets called *a lot* in at least the first scene -// of SQ6. Optimisation would not be the worst idea in the world. void GfxPalette32::kernelPalVarySet(const GuiResourceId paletteId, const int16 percent, const int time, const int16 fromColor, const int16 toColor) { Palette palette = getPaletteFromResourceInternal(paletteId); setVary(&palette, percent, time, fromColor, toColor); diff --git a/engines/sci/graphics/palette32.h b/engines/sci/graphics/palette32.h index 6c773cc5c0..d06541fc47 100644 --- a/engines/sci/graphics/palette32.h +++ b/engines/sci/graphics/palette32.h @@ -192,11 +192,6 @@ public: private: ResourceManager *_resMan; - /** - * The currently displayed palette. - */ - Palette _currentPalette; - /** * The palette revision version. Increments once per game * loop that changes the source palette. @@ -208,6 +203,11 @@ private: */ bool _needsUpdate; + /** + * The currently displayed palette. + */ + Palette _currentPalette; + /** * The unmodified source palette loaded by kPalette. Additional * palette entries may be mixed into the source palette by -- cgit v1.2.3