[Scummvm-git-logs] scummvm master -> d6a747dfa248060ea98ea635641136514cb14c22

mgerhardy martin.gerhardy at gmail.com
Wed Mar 24 19:49:06 UTC 2021


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:
d6a747dfa2 TWINE: fixed parts of the holomap rotation


Commit: d6a747dfa248060ea98ea635641136514cb14c22
    https://github.com/scummvm/scummvm/commit/d6a747dfa248060ea98ea635641136514cb14c22
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-24T20:49:01+01:00

Commit Message:
TWINE: fixed parts of the holomap rotation

Changed paths:
    engines/twine/holomap.cpp
    engines/twine/renderer/renderer.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 741652cebe..48616de5e4 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -115,7 +115,7 @@ void Holomap::loadHolomapGFX() {
 }
 
 static int sortHolomapSurfaceCoordsByDepth(const void *a1, const void *a2) {
-	return *(const int16 *)a1 - *(const int16 *)a2;
+	return (int)*(const int16 *)a1 - (int)*(const int16 *)a2;
 }
 
 // verified with disassembly
@@ -167,7 +167,6 @@ void Holomap::prepareHolomapPolygons() {
 	int holomapSortArrayIdx = 0;
 	int holomapSurfaceArrayIdx = 0;
 	_projectedSurfaceIndex = 0;
-	_engine->_renderer->setBaseRotation(0, 0, 0);
 	for (int32 angle = -ANGLE_90; angle <= ANGLE_90; angle += ANGLE_11_25) {
 		int rotation = 0;
 		for (int32 stepWidth = 0; stepWidth < ANGLE_11_25; ++stepWidth) {
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 2ffde2e119..c7dd869e67 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1560,7 +1560,7 @@ void Renderer::computeHolomapPolygon(int32 top, int32 x1, int32 bottom, int32 x2
 	if (minX < x2) {
 		const uint32 deltaX = (x2 - minX) * 0x10000;
 		const uint32 deltaRatio = deltaX / deltaY;
-		uint32 iVar01 = (deltaRatio % deltaY >> 1) + 0x7fff;
+		uint32 iVar01 = (deltaRatio % deltaY >> 1) + 0x7fffU;
 		for (uint32 y = 0; y <= deltaY; ++y) {
 			if (currentPolygonTabEntry < _polyTab || currentPolygonTabEntry >= _polyTab + _polyTabSize) {
 				currentPolygonTabEntry++;
@@ -1568,16 +1568,16 @@ void Renderer::computeHolomapPolygon(int32 top, int32 x1, int32 bottom, int32 x2
 			}
 			*currentPolygonTabEntry++ = (int16)x2;
 			x2 -= (deltaRatio >> 0x10);
-			if ((iVar01 & 0xffff0000) != 0) {
+			if ((iVar01 & 0xffff0000U) != 0) {
 				x2 += (iVar01 >> 0x10);
-				iVar01 = iVar01 & 0xffff;
+				iVar01 = iVar01 & 0xffffU;
 			}
-			iVar01 -= (deltaRatio & 0xffff);
+			iVar01 -= (deltaRatio & 0xffffU);
 		}
 	} else {
 		const uint32 deltaX = (minX - x2) * 0x10000;
 		const uint32 deltaRatio = deltaX / deltaY;
-		uint32 iVar01 = (deltaX % deltaY >> 1) + 0x7fff;
+		uint32 iVar01 = (deltaX % deltaY >> 1) + 0x7fffU;
 		for (uint32 y = 0; y <= deltaY; ++y) {
 			if (currentPolygonTabEntry < _polyTab || currentPolygonTabEntry >= _polyTab + _polyTabSize) {
 				currentPolygonTabEntry++;
@@ -1585,11 +1585,11 @@ void Renderer::computeHolomapPolygon(int32 top, int32 x1, int32 bottom, int32 x2
 			}
 			*currentPolygonTabEntry++ = (int16)x2;
 			x2 += (deltaRatio >> 0x10);
-			if ((iVar01 & 0xffff0000) != 0) {
+			if ((iVar01 & 0xffff0000U) != 0) {
 				x2 += (iVar01 >> 0x10);
-				iVar01 = iVar01 & 0xffff;
+				iVar01 = iVar01 & 0xffffU;
 			}
-			iVar01 += (deltaRatio & 0xffff);
+			iVar01 += (deltaRatio & 0xffffU);
 		}
 	}
 }




More information about the Scummvm-git-logs mailing list