[Scummvm-git-logs] scummvm master -> 9cb400e05c160ffcca643a6273769d55aefb26b3

stevenhoefel stevenhoefel at hotmail.com
Fri Jan 13 12:40:08 CET 2017


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:
9cb400e05c DIRECTOR: Style fixes plus 1/8bpp corrections.


Commit: 9cb400e05c160ffcca643a6273769d55aefb26b3
    https://github.com/scummvm/scummvm/commit/9cb400e05c160ffcca643a6273769d55aefb26b3
Author: stevenhoefel (stevenhoefel at hotmail.com)
Date: 2017-01-13T22:39:58+11:00

Commit Message:
DIRECTOR: Style fixes plus 1/8bpp corrections.

Changed paths:
    engines/director/cast.cpp
    engines/director/frame.cpp
    engines/director/images.cpp
    engines/director/score.h


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index f49d0b5..0db59cb 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -50,7 +50,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint16 version) {
 		regY = stream.readUint16();
 
 		bitsPerPixel = stream.readUint16();
-		if (bitsPerPixel == 0) bitsPerPixel = 1;
+		if (bitsPerPixel == 0) 
+			bitsPerPixel = 1;
 
 		int tail = 0;
 
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 0af6358..9725234 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -819,11 +819,6 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, uint1
 		textStream = _vm->getSharedSTXT()->getVal(spriteId + 1024);
 	}
 
-	byte buf[1024];
-	textStream->read(buf, textStream->size());
-	textStream->seek(0);
-	Common::hexdump(buf, textStream->size());
-
 	renderText(surface, spriteId, textStream, false);
 }
 
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index c2a3c4a..7d5e089 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -300,19 +300,24 @@ bool BITDDecoderV4::loadStream(Common::SeekableReadStream &stream) {
 			stream.readUint16BE();
 	}
 
+	int offset = 0;
+	if (_surface->w < (pixels.size() / _surface->h)) 
+		offset = (pixels.size() / _surface->h) - _surface->w;
+
 	if (pixels.size() > 0) {
 		for (y = 0; y < _surface->h; y++) {
 			for (x = 0; x < _surface->w;) {
 				switch (_bitsPerPixel) {
 				case 1: {
-					for (int c = 0; c < 8; c++, x++)
-						*((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->w) + x) / 8) + y] & (1 << (7 - c))) ? 0 : 0xff;
+					for (int c = 0; c < 8; c++, x++) {
+						*((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->pitch) + x) / 8)] & (1 << (7 - c))) ? 0 : 0xff;
+					}
 					break;
 				}
 
 				case 8:
 					//this calculation is wrong.. need a demo with colours.
-					*((byte *)_surface->getBasePtr(x, y)) = 0xff - pixels[(y * _surface->w) + x];
+					*((byte *)_surface->getBasePtr(x, y)) = 0xff - pixels[(y * _surface->w) + x + (y * offset)];
 					x++;
 					break;
 
diff --git a/engines/director/score.h b/engines/director/score.h
index cc3289e..9b92e48 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -75,6 +75,7 @@ public:
 	Common::String getMacName() const { return _macName; }
 	Sprite *getSpriteById(uint16 id);
 	void setSpriteCasts();
+	Graphics::ManagedSurface *getSurface() { return _surface; }
 
 private:
 	void update();





More information about the Scummvm-git-logs mailing list