[Scummvm-git-logs] scummvm master -> 062bf46ee56b3d50558a578a8fcb2514d89a6439

rvanlaar roland at rolandvanlaar.nl
Sun Aug 16 19:51:51 UTC 2020


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:
062bf46ee5 DIRECTOR: Integer comparison fixes


Commit: 062bf46ee56b3d50558a578a8fcb2514d89a6439
    https://github.com/scummvm/scummvm/commit/062bf46ee56b3d50558a578a8fcb2514d89a6439
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-08-16T21:51:36+02:00

Commit Message:
DIRECTOR: Integer comparison fixes

Changed paths:
    engines/director/cast.cpp
    engines/director/lingo/lingo-bytecode.cpp
    engines/director/window.cpp
    engines/director/window.h


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 34bf4bca7d..abc0c3f223 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -1136,7 +1136,7 @@ void Cast::loadCastInfo(Common::SeekableReadStreamEndian &stream, uint16 id) {
 
 			int16 count = entryStream->readUint16();
 
-			for (uint i = 0; i < count; i++)
+			for (int16 i = 0; i < count; i++)
 				ci->scriptStyle.read(*entryStream);
 			delete entryStream;
 		}
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index ff4da5f92a..33e1bfc65a 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -1517,7 +1517,7 @@ void LingoArchive::addNamesV4(Common::SeekableReadStreamEndian &stream) {
 	uint16 offset = stream.readUint16();
 	uint16 count = stream.readUint16();
 
-	if (stream.size() != size) {
+	if ((uint32)stream.size() != size) {
 		warning("Lnam content missing");
 		return;
 	}
@@ -1526,7 +1526,7 @@ void LingoArchive::addNamesV4(Common::SeekableReadStreamEndian &stream) {
 
 	names.clear();
 
-	for (uint32 i = 0; i < count; i++) {
+	for (uint16 i = 0; i < count; i++) {
 		Common::String name = stream.readPascalString();
 
 		names.push_back(name);
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 35c0f71ae8..f5d8319bf0 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -254,7 +254,7 @@ void Window::inkBlitSurface(DirectorPlotData *pd, Common::Rect &srcRect, const G
 			for (int j = 0; j < pd->destRect.width(); j++, pd->srcPoint.x++) {
 				if (!mask || (msk && (pd->ink == kInkTypeMask ? *msk++ : !(*msk++)))) {
 					(g_director->getInkDrawPixel())(pd->destRect.left + j, pd->destRect.top + i,
-											preprocessColor(pd, *((uint32 *)pd->srf->getBasePtr(pd->srcPoint.x, pd->srcPoint.y))), pd);
+											preprocessColor(pd, *((int *)pd->srf->getBasePtr(pd->srcPoint.x, pd->srcPoint.y))), pd);
 				}
 			}
 		}
@@ -292,14 +292,14 @@ void Window::inkBlitStretchSurface(DirectorPlotData *pd, Common::Rect &srcRect,
 			for (int xCtr = 0, scaleXCtr = 0; xCtr < pd->destRect.width(); xCtr++, scaleXCtr += scaleX, pd->srcPoint.x++) {
 				if (!mask || (msk && (pd->ink == kInkTypeMask ? *msk++ : !(*msk++)))) {
 				(g_director->getInkDrawPixel())(pd->destRect.left + xCtr, pd->destRect.top + i,
-										preprocessColor(pd, *((uint32 *)pd->srf->getBasePtr(scaleXCtr / SCALE_THRESHOLD, scaleYCtr / SCALE_THRESHOLD))), pd);
+										preprocessColor(pd, *((int *)pd->srf->getBasePtr(scaleXCtr / SCALE_THRESHOLD, scaleYCtr / SCALE_THRESHOLD))), pd);
 				}
 			}
 		}
 	}
 }
 
-int Window::preprocessColor(DirectorPlotData *p, uint32 src) {
+int Window::preprocessColor(DirectorPlotData *p, int src) {
 	// HACK: Right now this method is just used for adjusting the colourization on text
 	// sprites, as it would be costly to colourize the chunks on the fly each
 	// time a section needs drawing. It's ugly but mostly works.
diff --git a/engines/director/window.h b/engines/director/window.h
index 79dc8b04c8..34383dc2ea 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -185,7 +185,7 @@ private:
 	bool _titleVisible;
 
 private:
-	int preprocessColor(DirectorPlotData *p, uint32 src);
+	int preprocessColor(DirectorPlotData *p, int src);
 
 	void inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::ManagedSurface *blitTo = nullptr);
 	void inkBlitShape(DirectorPlotData *pd, Common::Rect &srcRect);




More information about the Scummvm-git-logs mailing list