[Scummvm-git-logs] scummvm branch-2-9 -> 8eda8a506d798618db582886108671e5d8aa4f41

sdelamarre noreply at scummvm.org
Wed Nov 27 20:50:21 UTC 2024


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

Summary:
34d937b910 GOB: Remove unnecessary nesting levels in setGoblinState (Adibou2)
8eda8a506d GOB: Fix an uninitialized member variable in Draw object


Commit: 34d937b91070a62942b8f2067eba68ba52e64b29
    https://github.com/scummvm/scummvm/commit/34d937b91070a62942b8f2067eba68ba52e64b29
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2024-11-27T21:45:39+01:00

Commit Message:
GOB: Remove unnecessary nesting levels in setGoblinState (Adibou2)

Changed paths:
    engines/gob/goblin_v7.cpp


diff --git a/engines/gob/goblin_v7.cpp b/engines/gob/goblin_v7.cpp
index 8aa228a0eb1..78747c03fa7 100644
--- a/engines/gob/goblin_v7.cpp
+++ b/engines/gob/goblin_v7.cpp
@@ -74,64 +74,64 @@ void Goblin_v7::setGoblinState(Mult::Mult_Object *obj, int16 animState) {
 		if (animState <= 0 || animState > obj->animVariables[2]) {
 			obj->pAnimData->animType = 11;
 			return;
-		} else {
-			int16 *animVariablesForState = obj->animVariables + animState * obj->animVariables[1];
-			if (animVariablesForState[0] == 0) {
-				newXCorrection = animVariablesForState[1];
-				newYCorrection = animVariablesForState[2];
-				break;
-			} else {
-				if (animVariablesForState[0] == -2) {
-					// Reflexion relative to Y axis:
-					// Some videos exist only for "west" directions (W, NW, SW, N S),
-					// "east" directions (E, NE, SE) are then obtained by symmetry
-					switch (animState) {
-					case 1:
-						animState = 5;
-						break;
-					case 2:
-						animState = 4;
-						break;
-					case 4:
-						animState = 2;
-						break;
-					case 5:
-						animState = 1;
-						break;
-					case 6:
-						animState = 8;
-						break;
-					case 8:
-						animState = 6;
-						break;
-					case 31:
-					case 32:
-					case 33:
-					case 34:
-					case 35:
-					case 36:
-					case 37:
-						animState -= 10;
-						break;
-					default: // 3, 7, 9-30, > 36
-						obj->pAnimData->animType = 11;
-						return;
-					}
+		}
 
-					obj->pAnimData->layer |= 0x80;
-					newXCorrection = animVariablesForState[1];
-					newYCorrection = animVariablesForState[2];
-				} else if (animVariablesForState[0] == -1) {
-					obj->pAnimData->animType = 11;
-					return;
-				} else {
-					animState = animVariablesForState[0];
-					continue;
-				}
+		int16 *animVariablesForState = obj->animVariables + animState * obj->animVariables[1];
+		if (animVariablesForState[0] == 0) {
+			newXCorrection = animVariablesForState[1];
+			newYCorrection = animVariablesForState[2];
+			break;
+		}
+
+		if (animVariablesForState[0] == -2) {
+			// Reflexion relative to Y axis:
+			// Some videos exist only for "west" directions (W, NW, SW, N S),
+			// "east" directions (E, NE, SE) are then obtained by symmetry
+			switch (animState) {
+			case 1:
+				animState = 5;
+				break;
+			case 2:
+				animState = 4;
+				break;
+			case 4:
+				animState = 2;
+				break;
+			case 5:
+				animState = 1;
+				break;
+			case 6:
+				animState = 8;
+				break;
+			case 8:
+				animState = 6;
+				break;
+			case 31:
+			case 32:
+			case 33:
+			case 34:
+			case 35:
+			case 36:
+			case 37:
+				animState -= 10;
+				break;
+			default: // 3, 7, 9-30, > 36
+				obj->pAnimData->animType = 11;
+				return;
 			}
+
+			obj->pAnimData->layer |= 0x80;
+			newXCorrection = animVariablesForState[1];
+			newYCorrection = animVariablesForState[2];
+			break;
 		}
 
-		break;
+		if (animVariablesForState[0] == -1) {
+			obj->pAnimData->animType = 11;
+			return;
+		}
+
+		animState = animVariablesForState[0];
 	}
 
 	if (obj->pAnimData->stateType == 1) {


Commit: 8eda8a506d798618db582886108671e5d8aa4f41
    https://github.com/scummvm/scummvm/commit/8eda8a506d798618db582886108671e5d8aa4f41
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2024-11-27T21:45:44+01:00

Commit Message:
GOB: Fix an uninitialized member variable in Draw object

Changed paths:
    engines/gob/draw.cpp


diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index fdd5cd2d4da..2cff9c08e20 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -133,6 +133,7 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
 	_scrollOffsetY = 0;
 
 	_pattern = 0;
+	_cursorDrawnFromScripts = false;
 }
 
 Draw::~Draw() {




More information about the Scummvm-git-logs mailing list