aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2016-03-11 07:54:45 +0200
committerFilippos Karapetis2016-03-11 07:54:45 +0200
commit8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642 (patch)
tree70c1414018295e3d36db61bcb4976ae4a1429eb0
parent48b53aa4c6aa01ec113fa0342eb77bc3f0c3abbe (diff)
downloadscummvm-rg350-8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642.tar.gz
scummvm-rg350-8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642.tar.bz2
scummvm-rg350-8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642.zip
SCI32: Add remap counters and hook them up to frameOut
-rw-r--r--engines/sci/graphics/frameout.cpp23
-rw-r--r--engines/sci/graphics/remap.cpp8
-rw-r--r--engines/sci/graphics/remap.h2
3 files changed, 21 insertions, 12 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 2477574c03..b124573ba1 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -47,6 +47,7 @@
#include "sci/graphics/paint32.h"
#include "sci/graphics/palette32.h"
#include "sci/graphics/picture.h"
+#include "sci/graphics/remap.h"
#include "sci/graphics/text32.h"
#include "sci/graphics/plane32.h"
#include "sci/graphics/screen_item32.h"
@@ -446,8 +447,8 @@ void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &rect)
screenItemLists.resize(_planes.size());
eraseLists.resize(_planes.size());
- // _numActiveRemaps was a global in SCI engine
- if (/* TODO Remap::_numActiveRemaps > 0 */ false && _remapOccurred) {
+ if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
+ // TODO
// remapMarkRedraw();
}
@@ -844,11 +845,10 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
screenItemLists.resize(_planes.size());
eraseLists.resize(_planes.size());
- // TODO: Remap
- // _numActiveRemaps was a global in SCI engine
- // if (Remap::_numActiveRemaps > 0 && _remapOccurred) {
- // _screen->remapMarkRedraw();
- // }
+ if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
+ // TODO
+ //_screen->remapMarkRedraw();
+ }
calcLists(screenItemLists, eraseLists, calcRect);
for (ScreenItemListList::iterator list = screenItemLists.begin(); list != screenItemLists.end(); ++list) {
@@ -907,11 +907,10 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
// plane->updateRedrawAllCount();
}
- // TODO: Remap
- // _numActiveRemaps was a global in SCI engine
- // if (Remap::_numActiveRemaps > 0 && _remapOccurred) {
- // _screen->remapMarkRedraw();
- // }
+ if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
+ // TODO
+ //_screen->remapMarkRedraw();
+ }
calcLists(screenItemLists, eraseLists, calcRect);
for (ScreenItemListList::iterator list = screenItemLists.begin(); list != screenItemLists.end(); ++list) {
diff --git a/engines/sci/graphics/remap.cpp b/engines/sci/graphics/remap.cpp
index d614a57a0f..dbda35c938 100644
--- a/engines/sci/graphics/remap.cpp
+++ b/engines/sci/graphics/remap.cpp
@@ -115,6 +115,7 @@ GfxRemap32::GfxRemap32(GfxPalette32 *palette) : _palette(palette) {
_remaps[i] = RemapParams(0, 0, 0, 0, 100, kRemappingNone);
_noMapStart = _noMapCount = 0;
_update = false;
+ _remapCount = 0;
// The remap range was 245 - 254 in SCI2, but was changed to 235 - 244 in SCI21 middle
_remapEndColor = (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) ? 244 : 254;
@@ -124,10 +125,13 @@ void GfxRemap32::remapOff(byte color) {
if (!color) {
for (int i = 0; i < REMAP_COLOR_COUNT; i++)
_remaps[i] = RemapParams(0, 0, 0, 0, 100, kRemappingNone);
+
+ _remapCount = 0;
} else {
assert(_remapEndColor - color >= 0 && _remapEndColor - color < REMAP_COLOR_COUNT);
const byte index = _remapEndColor - color;
_remaps[index] = RemapParams(0, 0, 0, 0, 100, kRemappingNone);
+ _remapCount--;
}
_update = true;
@@ -137,6 +141,7 @@ void GfxRemap32::setRemappingRange(byte color, byte from, byte to, byte base) {
assert(_remapEndColor - color >= 0 && _remapEndColor - color < REMAP_COLOR_COUNT);
_remaps[_remapEndColor - color] = RemapParams(from, to, base, 0, 100, kRemappingByRange);
initColorArrays(_remapEndColor - color);
+ _remapCount++;
_update = true;
}
@@ -144,6 +149,7 @@ void GfxRemap32::setRemappingPercent(byte color, byte percent) {
assert(_remapEndColor - color >= 0 && _remapEndColor - color < REMAP_COLOR_COUNT);
_remaps[_remapEndColor - color] = RemapParams(0, 0, 0, 0, percent, kRemappingByPercent);
initColorArrays(_remapEndColor - color);
+ _remapCount++;
_update = true;
}
@@ -151,6 +157,7 @@ void GfxRemap32::setRemappingToGray(byte color, byte gray) {
assert(_remapEndColor - color >= 0 && _remapEndColor - color < REMAP_COLOR_COUNT);
_remaps[_remapEndColor - color] = RemapParams(0, 0, 0, gray, 100, kRemappingToGray);
initColorArrays(_remapEndColor - color);
+ _remapCount++;
_update = true;
}
@@ -158,6 +165,7 @@ void GfxRemap32::setRemappingToPercentGray(byte color, byte gray, byte percent)
assert(_remapEndColor - color >= 0 && _remapEndColor - color < REMAP_COLOR_COUNT);
_remaps[_remapEndColor - color] = RemapParams(0, 0, 0, gray, percent, kRemappingToPercentGray);
initColorArrays(_remapEndColor - color);
+ _remapCount++;
_update = true;
}
diff --git a/engines/sci/graphics/remap.h b/engines/sci/graphics/remap.h
index eb7718d507..8eb64c00f0 100644
--- a/engines/sci/graphics/remap.h
+++ b/engines/sci/graphics/remap.h
@@ -128,6 +128,7 @@ public:
void setRemappingToPercentGray(byte color, byte gray, byte percent);
void setNoMatchRange(byte from, byte count);
bool remapAllTables(bool palChanged);
+ int getRemapCount() const { return _remapCount; }
private:
GfxPalette32 *_palette;
@@ -136,6 +137,7 @@ private:
byte _noMapStart, _noMapCount;
bool _targetChanged[236];
byte _remapEndColor;
+ int _remapCount;
void initColorArrays(byte index);
bool applyRemap(byte index);