[Scummvm-cvs-logs] scummvm master -> 8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642
bluegr
bluegr at gmail.com
Fri Mar 11 06:54:59 CET 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8f7ab881ee SCI32: Add remap counters and hook them up to frameOut
Commit: 8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642
https://github.com/scummvm/scummvm/commit/8f7ab881ee17ac784f20cd1597ed0bdf5d6b8642
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-03-11T07:54:45+02:00
Commit Message:
SCI32: Add remap counters and hook them up to frameOut
Changed paths:
engines/sci/graphics/frameout.cpp
engines/sci/graphics/remap.cpp
engines/sci/graphics/remap.h
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 2477574..b124573 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 d614a57..dbda35c 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 eb7718d..8eb64c0 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);
More information about the Scummvm-git-logs
mailing list