aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/celobj32.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2016-03-16 01:45:36 +0200
committerFilippos Karapetis2016-03-16 01:51:09 +0200
commit5a547bd242e3d09e34a4aa170f138d721120e155 (patch)
tree93503518dd0bf95844d39aed2ca2746ed95525d4 /engines/sci/graphics/celobj32.cpp
parent5be798c92f31dade1e59ca7279a022eff605c9ca (diff)
downloadscummvm-rg350-5a547bd242e3d09e34a4aa170f138d721120e155.tar.gz
scummvm-rg350-5a547bd242e3d09e34a4aa170f138d721120e155.tar.bz2
scummvm-rg350-5a547bd242e3d09e34a4aa170f138d721120e155.zip
SCI32: Implement analyzeForRemap()
Diffstat (limited to 'engines/sci/graphics/celobj32.cpp')
-rw-r--r--engines/sci/graphics/celobj32.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index de5bf02ecb..693bc5f196 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -834,7 +834,7 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
bool CelObjView::analyzeUncompressedForRemap() const {
byte *pixels = getResPointer() + READ_SCI11ENDIAN_UINT32(getResPointer() + _celHeaderOffset + 24);
for (int i = 0; i < _width * _height; ++i) {
- uint8 pixel = pixels[i];
+ byte pixel = pixels[i];
if (pixel >= g_sci->_gfxRemap32->getStartColor() && pixel <= g_sci->_gfxRemap32->getEndColor() && pixel != _transparentColor) {
return true;
}
@@ -843,7 +843,16 @@ bool CelObjView::analyzeUncompressedForRemap() const {
}
bool CelObjView::analyzeForRemap() const {
- // TODO: Implement decompression and analysis
+ READER_Compressed reader(*this, _width);
+ for (int y = 0; y < _height; y++) {
+ const byte *curRow = reader.getRow(y);
+ for (int x = 0; x < _width; x++) {
+ byte pixel = curRow[x];
+ if (pixel >= g_sci->_gfxRemap32->getStartColor() && pixel <= g_sci->_gfxRemap32->getEndColor() && pixel != _transparentColor) {
+ return true;
+ }
+ }
+ }
return false;
}