[Scummvm-cvs-logs] scummvm master -> 3f1f3c5c1ec3dd8d8507530b3a85b89464389632
sev-
sev at scummvm.org
Thu Aug 25 01:16:13 CEST 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:
3f1f3c5c1e DIRECTOR: More heuristics for 1bpp image decoding. Courtesy of wjp.
Commit: 3f1f3c5c1ec3dd8d8507530b3a85b89464389632
https://github.com/scummvm/scummvm/commit/3f1f3c5c1ec3dd8d8507530b3a85b89464389632
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-25T01:16:03+02:00
Commit Message:
DIRECTOR: More heuristics for 1bpp image decoding. Courtesy of wjp.
Changed paths:
engines/director/frame.cpp
engines/director/images.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 4bae61f..5313103 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -527,7 +527,7 @@ static const int corrections[] = {
1039, 50, 50,
1041, 110, 110, // descr
1042, 120, 121, // descr 2
- 1065, 27, 27, // car
+ 1065, 27, 19, // car
1109, 104, 112, // taxi
1110, 90, 96, // taxi
1111, 74, 80, // taxi
@@ -563,7 +563,7 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
bool c = false;
for (int i = 0; corrections[i]; i += 3)
if (corrections[i] == imgId) {
- w = corrections[i + 2];
+ //w = corrections[i + 2];
c = true;
break;
}
@@ -571,11 +571,16 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
if (!c)
debugC(4, kDebugImages, "%d, %d, %d", imgId, w, h);
- if (bc->flags & 0x20) {
+ if (true || bc->flags & 0x20) {
int w1 = w + 8 - w % 8 + 8;
debugC(3, kDebugImages, "Disabling compression for %d: %d x %d", imgId, w1, h);
- img = new BITDDecoder(w1, h, false);
+ if (pic->size() * 8 == w1 * h)
+ img = new BITDDecoder(w1, h, false);
+ else if (pic->size() * 8 == (w1 + 8) * h)
+ img = new BITDDecoder(w1 + 8, h, false);
+ else
+ img = new BITDDecoder(w /*+ 8*/, h, true);
} else {
img = new BITDDecoder(w, h, true);
}
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index b763603..cd4487d 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -140,7 +140,7 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
if (!_comp) {
debugC(3, kDebugImages, "Skipping compression");
for (y = 0; y < _surface->h; y++) {
- for (x = 0; x < _surface->w; x++) {
+ for (x = 0; x < _surface->w;) {
byte color = stream.readByte();
for (int c = 0; c < 8; c++)
*((byte *)_surface->getBasePtr(x++, y)) = (color & (1 << (7 - c))) ? 0 : 0xff;
More information about the Scummvm-git-logs
mailing list