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

mgerhardy noreply at scummvm.org
Tue Sep 10 10:18:22 UTC 2024


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f0e9fe38ab TWINE: changed rotMatIndex2 to be closer to the original sources
8b12d69e42 TWINE: fixed typos in comments
a423c93b9b TWINE: fixed warnings


Commit: f0e9fe38aba66e831d0891fdb28a864316baaa3c
    https://github.com/scummvm/scummvm/commit/f0e9fe38aba66e831d0891fdb28a864316baaa3c
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-09-10T12:18:15+02:00

Commit Message:
TWINE: changed rotMatIndex2 to be closer to the original sources

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 9059ba61e61..d1c986545ee 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -233,8 +233,7 @@ IVec2 Renderer::rotate(int32 side, int32 forward, int32 angle) const {
 }
 
 void Renderer::rotMatIndex2(IMatrix3x3 *pDest, const IMatrix3x3 *pSrc, const IVec3 &angleVec) {
-	IMatrix3x3 matrix1;
-	IMatrix3x3 matrix2;
+	IMatrix3x3 tmp;
 	const int32 lAlpha = angleVec.x;
 	const int32 lBeta = angleVec.y;
 	const int32 lGamma = angleVec.z;
@@ -243,55 +242,61 @@ void Renderer::rotMatIndex2(IMatrix3x3 *pDest, const IMatrix3x3 *pSrc, const IVe
 		int32 nSin = sinTab[ClampAngle(lAlpha)];
 		int32 nCos = sinTab[ClampAngle(lAlpha + LBAAngles::ANGLE_90)];
 
-		matrix1.row1.x = pSrc->row1.x;
-		matrix1.row2.x = pSrc->row2.x;
-		matrix1.row3.x = pSrc->row3.x;
-
-		matrix1.row1.y = (pSrc->row1.z * nSin + pSrc->row1.y * nCos) / SCENE_SIZE_HALF;
-		matrix1.row1.z = (pSrc->row1.z * nCos - pSrc->row1.y * nSin) / SCENE_SIZE_HALF;
-		matrix1.row2.y = (pSrc->row2.z * nSin + pSrc->row2.y * nCos) / SCENE_SIZE_HALF;
-		matrix1.row2.z = (pSrc->row2.z * nCos - pSrc->row2.y * nSin) / SCENE_SIZE_HALF;
-		matrix1.row3.y = (pSrc->row3.z * nSin + pSrc->row3.y * nCos) / SCENE_SIZE_HALF;
-		matrix1.row3.z = (pSrc->row3.z * nCos - pSrc->row3.y * nSin) / SCENE_SIZE_HALF;
-	} else {
-		matrix1 = *pSrc;
+		pDest->row1.x = pSrc->row1.x;
+		pDest->row2.x = pSrc->row2.x;
+		pDest->row3.x = pSrc->row3.x;
+
+		pDest->row1.y = (pSrc->row1.z * nSin + pSrc->row1.y * nCos) / SCENE_SIZE_HALF;
+		pDest->row1.z = (pSrc->row1.z * nCos - pSrc->row1.y * nSin) / SCENE_SIZE_HALF;
+		pDest->row2.y = (pSrc->row2.z * nSin + pSrc->row2.y * nCos) / SCENE_SIZE_HALF;
+		pDest->row2.z = (pSrc->row2.z * nCos - pSrc->row2.y * nSin) / SCENE_SIZE_HALF;
+		pDest->row3.y = (pSrc->row3.z * nSin + pSrc->row3.y * nCos) / SCENE_SIZE_HALF;
+		pDest->row3.z = (pSrc->row3.z * nCos - pSrc->row3.y * nSin) / SCENE_SIZE_HALF;
+		pSrc = pDest;
 	}
 
 	if (lGamma) {
 		int32 nSin = sinTab[ClampAngle(lGamma)];
 		int32 nCos = sinTab[ClampAngle(lGamma + LBAAngles::ANGLE_90)];
 
-		matrix2.row1.z = matrix1.row1.z;
-		matrix2.row2.z = matrix1.row2.z;
-		matrix2.row3.z = matrix1.row3.z;
+		tmp.row1.z = pSrc->row1.z;
+		tmp.row2.z = pSrc->row2.z;
+		tmp.row3.z = pSrc->row3.z;
 
-		matrix2.row1.x = (matrix1.row1.y * nSin + matrix1.row1.x * nCos) / SCENE_SIZE_HALF;
-		matrix2.row1.y = (matrix1.row1.y * nCos - matrix1.row1.x * nSin) / SCENE_SIZE_HALF;
-		matrix2.row2.x = (matrix1.row2.y * nSin + matrix1.row2.x * nCos) / SCENE_SIZE_HALF;
-		matrix2.row2.y = (matrix1.row2.y * nCos - matrix1.row2.x * nSin) / SCENE_SIZE_HALF;
-		matrix2.row3.x = (matrix1.row3.y * nSin + matrix1.row3.x * nCos) / SCENE_SIZE_HALF;
-		matrix2.row3.y = (matrix1.row3.y * nCos - matrix1.row3.x * nSin) / SCENE_SIZE_HALF;
-	} else {
-		matrix2 = matrix1;
+		tmp.row1.x = (pSrc->row1.y * nSin + pSrc->row1.x * nCos) / SCENE_SIZE_HALF;
+		tmp.row1.y = (pSrc->row1.y * nCos - pSrc->row1.x * nSin) / SCENE_SIZE_HALF;
+		tmp.row2.x = (pSrc->row2.y * nSin + pSrc->row2.x * nCos) / SCENE_SIZE_HALF;
+		tmp.row2.y = (pSrc->row2.y * nCos - pSrc->row2.x * nSin) / SCENE_SIZE_HALF;
+		tmp.row3.x = (pSrc->row3.y * nSin + pSrc->row3.x * nCos) / SCENE_SIZE_HALF;
+		tmp.row3.y = (pSrc->row3.y * nCos - pSrc->row3.x * nSin) / SCENE_SIZE_HALF;
 	}
 
 	if (lBeta) {
 		int32 nSin = sinTab[ClampAngle(lBeta)];
 		int32 nCos = sinTab[ClampAngle(lBeta + LBAAngles::ANGLE_90)];
 
-		pDest->row1.y = matrix2.row1.y;
-		pDest->row2.y = matrix2.row2.y;
-		pDest->row3.y = matrix2.row3.y;
-
-		pDest->row1.x = (matrix2.row1.x * nCos - matrix2.row1.z * nSin) / SCENE_SIZE_HALF;
-		pDest->row1.z = (matrix2.row1.x * nSin + matrix2.row1.z * nCos) / SCENE_SIZE_HALF;
-		pDest->row2.x = (matrix2.row2.x * nCos - matrix2.row2.z * nSin) / SCENE_SIZE_HALF;
-		pDest->row2.z = (matrix2.row2.x * nSin + matrix2.row2.z * nCos) / SCENE_SIZE_HALF;
+		if (pSrc == pDest) {
+			tmp.row1.x = pSrc->row1.x;
+			tmp.row1.z = pSrc->row1.z;
+			tmp.row2.x = pSrc->row2.x;
+			tmp.row2.z = pSrc->row2.z;
+			tmp.row3.x = pSrc->row3.x;
+			tmp.row3.z = pSrc->row3.z;
+			pSrc = &tmp;
+		} else {
+			pDest->row1.y = pSrc->row1.y;
+			pDest->row2.y = pSrc->row2.y;
+			pDest->row3.y = pSrc->row3.y;
+		}
 
-		pDest->row3.x = (matrix2.row3.x * nCos - matrix2.row3.z * nSin) / SCENE_SIZE_HALF;
-		pDest->row3.z = (matrix2.row3.x * nSin + matrix2.row3.z * nCos) / SCENE_SIZE_HALF;
-	} else {
-		*pDest = matrix2;
+		pDest->row1.x = (pSrc->row1.x * nCos - pSrc->row1.z * nSin) / SCENE_SIZE_HALF;
+		pDest->row1.z = (pSrc->row1.x * nSin + pSrc->row1.z * nCos) / SCENE_SIZE_HALF;
+		pDest->row2.x = (pSrc->row2.x * nCos - pSrc->row2.z * nSin) / SCENE_SIZE_HALF;
+		pDest->row2.z = (pSrc->row2.x * nSin + pSrc->row2.z * nCos) / SCENE_SIZE_HALF;
+		pDest->row3.x = (pSrc->row3.x * nCos - pSrc->row3.z * nSin) / SCENE_SIZE_HALF;
+		pDest->row3.z = (pSrc->row3.x * nSin + pSrc->row3.z * nCos) / SCENE_SIZE_HALF;
+	} else if (pSrc != pDest) {
+		*pDest = *pSrc;
 	}
 }
 


Commit: 8b12d69e42c8d8dadba5651db8d6555fb4c6fd8e
    https://github.com/scummvm/scummvm/commit/8b12d69e42c8d8dadba5651db8d6555fb4c6fd8e
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-09-10T12:18:15+02:00

Commit Message:
TWINE: fixed typos in comments

Changed paths:
    engines/twine/renderer/screens.h


diff --git a/engines/twine/renderer/screens.h b/engines/twine/renderer/screens.h
index 1cfc81a1284..41b2c6c7dd8 100644
--- a/engines/twine/renderer/screens.h
+++ b/engines/twine/renderer/screens.h
@@ -95,7 +95,7 @@ public:
 	void loadMenuImage(bool fadeIn = true);
 
 	/**
-	 * Load and display a particulary image on \a RESS.HQR file with cross fade effect
+	 * Load and display a particularly image on \a RESS.HQR file with cross fade effect
 	 * @param index \a RESS.HQR entry index (starting from 0)
 	 * @param paletteIndex \a RESS.HQR entry index of the palette for the given image. This is often the @c index + 1
 	 * @param fadeIn if we fade in before using the palette
@@ -103,7 +103,7 @@ public:
 	void loadImage(TwineImage image, bool fadeIn = true);
 
 	/**
-	 * Load and display a particulary image on \a RESS.HQR file with cross fade effect and delay
+	 * Load and display a particularly image on \a RESS.HQR file with cross fade effect and delay
 	 * @param index \a RESS.HQR entry index (starting from 0)
 	 * @param paletteIndex \a RESS.HQR entry index of the palette for the given image. This is often the @c index + 1
 	 * @param seconds number of seconds to delay


Commit: a423c93b9b44b3365d33a3f664542042037514ef
    https://github.com/scummvm/scummvm/commit/a423c93b9b44b3365d33a3f664542042037514ef
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-09-10T12:18:15+02:00

Commit Message:
TWINE: fixed warnings

Changed paths:
    engines/twine/parser/entity.cpp


diff --git a/engines/twine/parser/entity.cpp b/engines/twine/parser/entity.cpp
index 45e390cb9c2..d2eca34dcbd 100644
--- a/engines/twine/parser/entity.cpp
+++ b/engines/twine/parser/entity.cpp
@@ -27,7 +27,7 @@ namespace TwinE {
 bool EntityData::loadBody(Common::SeekableReadStream &stream) {
 	EntityBody body;
 	body.index = stream.readByte();
-	const int32 pos = stream.pos();
+	const int64 pos = stream.pos();
 	uint8 size = stream.readByte();
 	body.hqrBodyIndex = (int16)stream.readUint16LE();
 	const uint8 numActions = stream.readByte();
@@ -50,7 +50,7 @@ bool EntityData::loadBody(Common::SeekableReadStream &stream) {
 bool EntityData::loadAnim(Common::SeekableReadStream &stream) {
 	EntityAnim anim;
 	anim.animation = (AnimationTypes)stream.readByte();
-	const int32 pos = stream.pos();
+	const int64 pos = stream.pos();
 	uint8 size = stream.readByte();
 	anim.animIndex = stream.readSint16LE();
 	const uint8 numActions = stream.readByte();




More information about the Scummvm-git-logs mailing list