[Scummvm-git-logs] scummvm master -> 40d1308d72133a86741c40445d43d47a8fc24a1d

sev- noreply at scummvm.org
Sun Sep 1 18:10:30 UTC 2024


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

Summary:
bc4b9c0b9b QDENGINE: Code unwinding in arkada_automat minigame
165c81d291 QDENGINE: Further code improvements for arkada_avtomat.dll
7883a0a24a QDENGINE: Fix arkada_avtomat logic
40d1308d72 QDENGINE: Further renames and simplifications to arkada_avtomat


Commit: bc4b9c0b9ba7e17743a820705e3671483fb70f74
    https://github.com/scummvm/scummvm/commit/bc4b9c0b9ba7e17743a820705e3671483fb70f74
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-01T20:10:12+02:00

Commit Message:
QDENGINE: Code unwinding in arkada_automat minigame

Changed paths:
    engines/qdengine/minigames/arkada_avtomat.h


diff --git a/engines/qdengine/minigames/arkada_avtomat.h b/engines/qdengine/minigames/arkada_avtomat.h
index 7ca2d1759e5..29b2816eebc 100644
--- a/engines/qdengine/minigames/arkada_avtomat.h
+++ b/engines/qdengine/minigames/arkada_avtomat.h
@@ -82,9 +82,6 @@ public:
 		debugC(3, kDebugMinigames, "ArkadaAvtomat::quant(%f)", dt);
 
 		mgVect2i menCoords;
-		mgVect2i pos;
-		bool v61 = false;
-		bool v97 = false;
 		int tmp = 0;
 
 		menCoords = _scene->world2screen_coords(_menObj->R());
@@ -355,7 +352,7 @@ LABEL_80:
 					goto LABEL_107;
 				}
 				if (_shoteEggCounter <= 0) {
-			LABEL_107:
+LABEL_107:
 					updateStats();
 					goto LABEL_108;
 				}
@@ -367,7 +364,7 @@ LABEL_80:
 			--_shoteEggCounter;
 			goto LABEL_107;
 		}
-		LABEL_108:
+LABEL_108:
 		if (_engine->is_mouse_event_active(qdmg::qdEngineInterfaceImpl::MOUSE_EV_LEFT_DOWN)
 				&& !_bloodObj->is_state_active("\xe5\xf1\xf2\xfc")						// "есть"
 				&& !_patronTomatoObj->is_state_active("\xef\xee\xec\xe8\xe4\xee\xf0")	// "помидор"
@@ -424,45 +421,25 @@ LABEL_80:
 			}
 		}
 
-		if (!_fazaObj->is_state_active("\xe4\xe0")		// "да"
-				|| _bloodObj->is_state_active("\xe5\xf1\xf2\xfc")) {	// "есть"
-			goto LABEL_156;
-		}
-
-		pos = _menObj->screen_R();
-
-		if (pos.x <= _cursorPos.x) {
-			if (_cursorPos.x - pos.x > 15)
-				goto LABEL_147;
-		} else if (pos.x - _cursorPos.x > 15) {
-			goto LABEL_147;
-		}
-		v61 = true;
-
-LABEL_147:
-		v97 = false;
+		// Hit check
+		if (_fazaObj->is_state_active("\xe4\xe0")		// "да"
+				&& !_bloodObj->is_state_active("\xe5\xf1\xf2\xfc")) {	// "есть"
+			mgVect2i pos = _menObj->screen_R();
 
-		if (pos.y <= _cursorPos.y) {
-			if (_cursorPos.y - pos.y <= 35)
-LABEL_151:
-			v97 = true;
-		} else if (pos.y - _cursorPos.y <= 35) {
-			goto LABEL_151;
-		}
-
-		if (v61) {
-			if (v97) {
+			if (ABS(pos.x - _cursorPos.x) <= 15 && ABS(pos.y - _cursorPos.y) <= 35) {
 				_killObj->set_state("\xe4\xe0");		// "да"
 				--_livesCounter;
+
 				updateStats();
+
 				_flag3 = 0;
 				_field_64 = 7 - _livesCounter;
+
 				if (_field_64 > 4)
 					_field_64 = 4;
 			}
 		}
 
-LABEL_156:
 		if (!_livesCounter) {
 			_someFlag5 = 1;
 			_doneObj->set_state("\xe4\xe0");		// "да"


Commit: 165c81d291048eb9daf721fff42a834f0ca73ec1
    https://github.com/scummvm/scummvm/commit/165c81d291048eb9daf721fff42a834f0ca73ec1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-01T20:10:16+02:00

Commit Message:
QDENGINE: Further code improvements for arkada_avtomat.dll

Changed paths:
    engines/qdengine/minigames/arkada_avtomat.h


diff --git a/engines/qdengine/minigames/arkada_avtomat.h b/engines/qdengine/minigames/arkada_avtomat.h
index 29b2816eebc..dcd27be18af 100644
--- a/engines/qdengine/minigames/arkada_avtomat.h
+++ b/engines/qdengine/minigames/arkada_avtomat.h
@@ -57,10 +57,10 @@ public:
 		_walkFlagObj     = _scene->object_interface(_scene->minigame_parameter("walk_flag"));
 		_jumpFlagObj     = _scene->object_interface(_scene->minigame_parameter("jump_flag"));
 
-		_flag1 = 0;
-		_flag2 = 0;
+		_goingLeft = false;
+		_goingRight = false;
 		_field_64 = 2;
-		_flag3 = 0;
+		_doingJump = false;
 		_field_54 = -1;
 
 		// stand(time(0));
@@ -70,10 +70,10 @@ public:
 		_shotsBananaCounter = 10;
 		_shoteEggCounter = 10;
 		_livesCounter = 5;
-		_someFlag5 = 0;
+		_isFinal = false;
 		_someSwitch = 2;
-		_someFlag6 = 0;
-		_jumpFlag = 0;
+		_doingWalk = false;
+		_jumpFlag = false;
 
    		return true;
 	}
@@ -87,8 +87,10 @@ public:
 		menCoords = _scene->world2screen_coords(_menObj->R());
 		_bublObj->set_R(_scene->screen2world_coords(menCoords, -5000.0));
 
-		if (_someFlag5)
-			goto LABEL_158;
+		if (_isFinal) {
+			updateWalkState();
+			return true;
+		}
 
 		if (!_shotsTomatoCounter && !_shotsBananaCounter && !_shoteEggCounter) {
 			_shotsTomatoCounter = 9;
@@ -103,7 +105,7 @@ public:
 			_field_64 = 2;
 		}
 
-		if (!_flag3) {
+		if (!_doingJump) {
 			if (_scene->world2screen_coords(_menObj->R()).x < _field_8C
 					&& _menObj->is_state_active("\xf1\xf2\xee\xe8\xf2")) { // "стоит"
 				_menObj->set_R(_menCoords);
@@ -114,15 +116,15 @@ public:
 		}
 
 		if (_menObj->is_state_active("\xf1\xf2\xee\xe8\xf2")) { // "стоит"
-			_flag1 = 0;
-			_flag2 = 0;
-			_flag3 = 0;
+			_goingLeft = false;
+			_goingRight = false;
+			_doingJump = false;
 		}
 
-		if (!_flag2) {
-			if (_flag1 || _flag3 || _menObj->is_state_active("\xf1\xf2\xee\xe8\xf2")) { // "стоит"
+		if (!_goingRight) {
+			if (_goingLeft || _doingJump || _menObj->is_state_active("\xf1\xf2\xee\xe8\xf2")) { // "стоит"
 LABEL_44:
-				if (!_flag2)
+				if (!_goingRight)
 					goto LABEL_47;
 				goto LABEL_45;
 			}
@@ -132,7 +134,7 @@ LABEL_44:
 			switch (qd_rnd(5)) {
 			case 0:
 			case 3: {
-					_flag2 = 1;
+					_goingRight = true;
 					int v21 = (500 - _menObj->screen_R().x) / _field_64;
 
 					if (v21 < 10)
@@ -144,7 +146,7 @@ LABEL_44:
 				}
 			case 1:
 			case 4: {
-					_flag1 = 1;
+					_goingLeft = true;
 					int v25 = (_menObj->screen_R().x - 300) / _field_64;
 					if (v25 < 10)
 						v25 = 10;
@@ -154,7 +156,7 @@ LABEL_44:
 					goto LABEL_44;
 			}
 			case 2:
-				_flag3 = 1;
+				_doingJump = true;
 				_field_54 = 30;
 				_menCoords = _menObj->R();
 				{
@@ -230,20 +232,20 @@ LABEL_45:
 		_field_50--;
 
 		if (_field_50 <= 0)
-			_flag2 = 0;
+			_goingRight = false;
 
 LABEL_47:
-		if (_flag1) {
+		if (_goingLeft) {
 			mgVect2i v45 = _scene->world2screen_coords(_menObj->R());
 			v45.y -= _field_64;
 			_menObj->set_R(_scene->screen2world_coords(v45, 0.0));
 			_field_4C--;
 
 			if (_field_4C <= 0)
-				_flag1 = 0;
+				_goingLeft = false;
 		}
 
-		if (_flag3) {
+		if (_doingJump) {
 			mgVect2i v53 = _scene->world2screen_coords(_menObj->R());
 
 			if (v53.y >= _field_84 - 10) {
@@ -275,7 +277,7 @@ LABEL_79:
 				}
 LABEL_77:
 				if (_flag4) {
-					_flag3 = 0;
+					_doingJump = false;
 					_someSwitch = _someSwitchBackup;
 				}
 				goto LABEL_79;
@@ -432,7 +434,7 @@ LABEL_108:
 
 				updateStats();
 
-				_flag3 = 0;
+				_doingJump = false;
 				_field_64 = 7 - _livesCounter;
 
 				if (_field_64 > 4)
@@ -441,43 +443,47 @@ LABEL_108:
 		}
 
 		if (!_livesCounter) {
-			_someFlag5 = 1;
+			_isFinal = true;
 			_doneObj->set_state("\xe4\xe0");		// "да"
-			_flag1 = 0;
-			_flag2 = 0;
-			_flag3 = 0;
+			_goingLeft = false;
+			_goingRight = false;
+			_doingJump = false;
 		}
 
-LABEL_158:
-		if ((_flag1 || _flag2) && !_someFlag6) {
-			_someFlag6 = 1;
+		updateWalkState();
+
+		return true;
+	}
+
+	void updateWalkState() {
+		if ((_goingLeft || _goingRight) && !_doingWalk) {
+			_doingWalk = true;
 			_walkFlagObj->set_state("\xe4\xe0");		// "да"
 		}
 
-		if ((_flag1 || _flag2) && !_flag3)
+		if ((_goingLeft || _goingRight) && !_doingJump)
 			goto LABEL_177;
 
-		if (_someFlag6) {
-			_someFlag6 = 0;
+		if (_doingWalk) {
+			_doingWalk = false;
 			_walkFlagObj->set_state("\xed\xe5\xf2");	// "нет"
 		}
 
-		if (!_flag3)
+		if (_doingJump)
 			goto LABEL_177;
 
-		if (!_someFlag6) {
-			_jumpFlag = 1;
+		if (!_doingWalk) {
+			_jumpFlag = true;
 			_jumpFlagObj->set_state("\xe4\xe0");		// "да"
 		}
-		if (!_flag3) {
+
+		if (!_doingJump) {
 LABEL_177:
-			if (_someFlag6) {
-				_jumpFlag = 0;
+			if (_doingWalk) {
+				_jumpFlag = false;
 				_jumpFlagObj->set_state("\xed\xe5\xf2");	// "нет"
 			}
 		}
-
-		return true;
 	}
 
 	bool finit() {
@@ -535,10 +541,10 @@ private:
 	qdMinigameObjectInterface *_walkFlagObj;
 	qdMinigameObjectInterface *_jumpFlagObj;
 
-	bool _flag1 = false;
-	bool _flag2 = false;
-	bool _flag3 = false;
-	bool _someFlag6 = false;
+	bool _goingLeft = false;
+	bool _goingRight = false;
+	bool _doingJump = false;
+	bool _doingWalk = false;
 	bool _jumpFlag = false;
 
 	int _field_4C = 0;
@@ -553,7 +559,7 @@ private:
 	int _shoteEggCounter = 10;
 	int _livesCounter = 5;
 
-	bool _someFlag5 = false;
+	bool _isFinal = false;
 
 	mgVect2i _cursorPos;
 


Commit: 7883a0a24aa6e57eb311d911fad556292c59e03d
    https://github.com/scummvm/scummvm/commit/7883a0a24aa6e57eb311d911fad556292c59e03d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-01T20:10:16+02:00

Commit Message:
QDENGINE: Fix arkada_avtomat logic

Changed paths:
    engines/qdengine/minigames/arkada_avtomat.h


diff --git a/engines/qdengine/minigames/arkada_avtomat.h b/engines/qdengine/minigames/arkada_avtomat.h
index dcd27be18af..ee753bd297b 100644
--- a/engines/qdengine/minigames/arkada_avtomat.h
+++ b/engines/qdengine/minigames/arkada_avtomat.h
@@ -226,7 +226,7 @@ LABEL_44:
 LABEL_45:
 		{
 			mgVect2i v37 = _scene->world2screen_coords(_menObj->R());
-			v37.y += _field_64;
+			v37.x += _field_64;
 			_menObj->set_R(_scene->screen2world_coords(v37, 0.0));
 		}
 		_field_50--;
@@ -237,7 +237,7 @@ LABEL_45:
 LABEL_47:
 		if (_goingLeft) {
 			mgVect2i v45 = _scene->world2screen_coords(_menObj->R());
-			v45.y -= _field_64;
+			v45.x -= _field_64;
 			_menObj->set_R(_scene->screen2world_coords(v45, 0.0));
 			_field_4C--;
 


Commit: 40d1308d72133a86741c40445d43d47a8fc24a1d
    https://github.com/scummvm/scummvm/commit/40d1308d72133a86741c40445d43d47a8fc24a1d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-01T20:10:16+02:00

Commit Message:
QDENGINE: Further renames and simplifications to arkada_avtomat

Changed paths:
    engines/qdengine/minigames/arkada_avtomat.h


diff --git a/engines/qdengine/minigames/arkada_avtomat.h b/engines/qdengine/minigames/arkada_avtomat.h
index ee753bd297b..163a208332f 100644
--- a/engines/qdengine/minigames/arkada_avtomat.h
+++ b/engines/qdengine/minigames/arkada_avtomat.h
@@ -59,19 +59,19 @@ public:
 
 		_goingLeft = false;
 		_goingRight = false;
-		_field_64 = 2;
+		_manSpeed = 2;
 		_doingJump = false;
-		_field_54 = -1;
+		_stepsToJump = -1;
 
 		// stand(time(0));
 
-		_someSwitchBackup = -1;
+		_jumpNextPhase = -1;
 		_shotsTomatoCounter = 9;
 		_shotsBananaCounter = 10;
 		_shoteEggCounter = 10;
 		_livesCounter = 5;
 		_isFinal = false;
-		_someSwitch = 2;
+		_jumpPhase = 2;
 		_doingWalk = false;
 		_jumpFlag = false;
 
@@ -82,7 +82,7 @@ public:
 		debugC(3, kDebugMinigames, "ArkadaAvtomat::quant(%f)", dt);
 
 		mgVect2i menCoords;
-		int tmp = 0;
+		int randomCond = 0;
 
 		menCoords = _scene->world2screen_coords(_menObj->R());
 		_bublObj->set_R(_scene->screen2world_coords(menCoords, -5000.0));
@@ -102,16 +102,16 @@ public:
 
 			updateStats();
 
-			_field_64 = 2;
+			_manSpeed = 2;
 		}
 
 		if (!_doingJump) {
-			if (_scene->world2screen_coords(_menObj->R()).x < _field_8C
+			if (_scene->world2screen_coords(_menObj->R()).x < _jumpingPhase3Y
 					&& _menObj->is_state_active("\xf1\xf2\xee\xe8\xf2")) { // "стоит"
 				_menObj->set_R(_menCoords);
 
 				_bloodObj->set_R(_scene->screen2world_coords(_scene->world2screen_coords(_menCoords), 0.0)); // check 0.0 v96
-				_field_54 = -1;
+				_stepsToJump = -1;
 			}
 		}
 
@@ -128,95 +128,95 @@ LABEL_44:
 					goto LABEL_47;
 				goto LABEL_45;
 			}
-			_field_4C = -1;
-			_field_50 = -1;
+			_stepsToLeft = -1;
+			_stepsToRight = -1;
 
 			switch (qd_rnd(5)) {
 			case 0:
 			case 3: {
 					_goingRight = true;
-					int v21 = (500 - _menObj->screen_R().x) / _field_64;
+					int maxSteps = (500 - _menObj->screen_R().x) / _manSpeed;
 
-					if (v21 < 10)
-						v21 = 10;
+					if (maxSteps < 10)
+						maxSteps = 10;
 
-					_field_50 = qd_rnd(v21);
+					_stepsToRight = qd_rnd(maxSteps);
 					_menObj->set_state("\xe8\xe4\xe5\xf2 \xe2\xef\xf0\xe0\xe2\xee"); // "идет вправо"
 					goto LABEL_44;
 				}
 			case 1:
 			case 4: {
 					_goingLeft = true;
-					int v25 = (_menObj->screen_R().x - 300) / _field_64;
-					if (v25 < 10)
-						v25 = 10;
+					int maxSteps = (_menObj->screen_R().x - 300) / _manSpeed;
+					if (maxSteps < 10)
+						maxSteps = 10;
 
-					_field_4C = qd_rnd(v25);
+					_stepsToLeft = qd_rnd(maxSteps);
 					_menObj->set_state("\xe8\xe4\xe5\xf2 \xe2\xeb\xe5\xe2\xee"); // "идет влево"
 					goto LABEL_44;
 			}
 			case 2:
 				_doingJump = true;
-				_field_54 = 30;
+				_stepsToJump = 30;
 				_menCoords = _menObj->R();
 				{
 					int y = _scene->world2screen_coords(_menObj->R()).y;
 
-					_field_84 = y;
-					_field_8C = y;
-					_field_88 = y - 60;
+					_manOrigPosY = y;
+					_jumpingPhase3Y = y;
+					_jumpHeight = y - 60;
 				}
 
-				tmp = qd_rnd(3);
+				randomCond = qd_rnd(3);
 
-				switch (_someSwitch) {
+				switch (_jumpPhase) {
 				case 1:
-					if (!tmp) {
-						_field_8C = _field_84;
+					if (!randomCond) {
+						_jumpingPhase3Y = _manOrigPosY;
 						goto LABEL_43;
 					}
-					if (tmp == 1)
+					if (randomCond == 1)
 						goto LABEL_29;
-					if (tmp != 2)
+					if (randomCond != 2)
 						goto LABEL_43;
 					break;
 				case 2:
-					if (!tmp) {
-						_field_8C = _field_84;
+					if (!randomCond) {
+						_jumpingPhase3Y = _manOrigPosY;
 						goto LABEL_43;
 					}
-					if (tmp == 1) {
-						_field_8C = 307;
-						_someSwitchBackup = 1;
+					if (randomCond == 1) {
+						_jumpingPhase3Y = 307;
+						_jumpNextPhase = 1;
 						goto LABEL_43;
 					}
-					if (tmp != 2)
+					if (randomCond != 2)
 						goto LABEL_43;
 					break;
 				case 3:
-					if (!tmp) {
-						_field_8C = _field_84;
+					if (!randomCond) {
+						_jumpingPhase3Y = _manOrigPosY;
 						goto LABEL_43;
 					}
-					if (tmp != 1) {
-						if (tmp == 2) {
-							_field_8C = 307;
-							_someSwitchBackup = 1;
+					if (randomCond != 1) {
+						if (randomCond == 2) {
+							_jumpingPhase3Y = 307;
+							_jumpNextPhase = 1;
 						}
 						goto LABEL_43;
 					}
 		LABEL_29:
-					_field_8C = 332;
-					_someSwitchBackup = 2;
+					_jumpingPhase3Y = 332;
+					_jumpNextPhase = 2;
 					goto LABEL_43;
 				default:
 		LABEL_43:
-					_flag4 = 0;
+					_jumpPhaseIsGoingDown = false;
 					goto LABEL_44;
 				}
 
-				_field_8C = 357;
-				_someSwitchBackup = 3;
+				_jumpingPhase3Y = 357;
+				_jumpNextPhase = 3;
 				goto LABEL_43;
 			default:
 				goto LABEL_44;
@@ -225,77 +225,77 @@ LABEL_44:
 
 LABEL_45:
 		{
-			mgVect2i v37 = _scene->world2screen_coords(_menObj->R());
-			v37.x += _field_64;
-			_menObj->set_R(_scene->screen2world_coords(v37, 0.0));
+			mgVect2i pos = _scene->world2screen_coords(_menObj->R());
+			pos.x += _manSpeed;
+			_menObj->set_R(_scene->screen2world_coords(pos, 0.0));
 		}
-		_field_50--;
+		_stepsToRight--;
 
-		if (_field_50 <= 0)
+		if (_stepsToRight <= 0)
 			_goingRight = false;
 
 LABEL_47:
 		if (_goingLeft) {
-			mgVect2i v45 = _scene->world2screen_coords(_menObj->R());
-			v45.x -= _field_64;
-			_menObj->set_R(_scene->screen2world_coords(v45, 0.0));
-			_field_4C--;
+			mgVect2i pos = _scene->world2screen_coords(_menObj->R());
+			pos.x -= _manSpeed;
+			_menObj->set_R(_scene->screen2world_coords(pos, 0.0));
+			_stepsToLeft--;
 
-			if (_field_4C <= 0)
+			if (_stepsToLeft <= 0)
 				_goingLeft = false;
 		}
 
 		if (_doingJump) {
-			mgVect2i v53 = _scene->world2screen_coords(_menObj->R());
+			mgVect2i pos = _scene->world2screen_coords(_menObj->R());
 
-			if (v53.y >= _field_84 - 10) {
-				if (!_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x31") && !_flag4)		// "прыгает1"
+			if (pos.y >= _manOrigPosY - 10) {
+				if (!_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x31") && !_jumpPhaseIsGoingDown)		// "прыгает1"
 					_menObj->set_state("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x31");	// "прыгает1"
 			}
 
-			if (v53.y <= _field_84 - 10) {
-				if (_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x31") && !_flag4)		// "прыгает1"
+			if (pos.y <= _manOrigPosY - 10) {
+				if (_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x31") && !_jumpPhaseIsGoingDown)		// "прыгает1"
 					_menObj->set_state("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x32");							// "прыгает2"
 			}
 
-			if (v53.y >= _field_8C - 10) {
-				if (_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x32") && _flag4)			// "прыгает2"
+			if (pos.y >= _jumpingPhase3Y - 10) {
+				if (_menObj->is_state_active("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x32") && _jumpPhaseIsGoingDown)			// "прыгает2"
 					_menObj->set_state("\xef\xf0\xfb\xe3\xe0\xe5\xf2\x33");							// "прыгает3"
 			}
 
-			if (v53.y <= _field_88)
+			if (pos.y <= _jumpHeight)
 				goto LABEL_176;
 
-			if (!_flag4) {
-				v53.y -= 4;
+			if (!_jumpPhaseIsGoingDown) {
+				pos.y -= 4;
 LABEL_75:
 LABEL_76:
-				if (v53.y < _field_8C) {
+				if (pos.y < _jumpingPhase3Y) {
 LABEL_79:
-					_menObj->set_R(_scene->screen2world_coords(v53, 0.0));
+					_menObj->set_R(_scene->screen2world_coords(pos, 0.0));
 					goto LABEL_80;
 				}
 LABEL_77:
-				if (_flag4) {
+				if (_jumpPhaseIsGoingDown) {
 					_doingJump = false;
-					_someSwitch = _someSwitchBackup;
+					_jumpPhase = _jumpNextPhase;
 				}
 				goto LABEL_79;
 			}
-			if (v53.y > _field_88) {
-				if (!_flag4)
+			if (pos.y > _jumpHeight) {
+				if (!_jumpPhaseIsGoingDown)
 					goto LABEL_76;
 				} else {
 LABEL_176:
-				if (!_flag4) {
-					_flag4 = 1;
+				if (!_jumpPhaseIsGoingDown) {
+					_jumpPhaseIsGoingDown = true;
 					goto LABEL_76;
 				}
 			}
-			if (v53.y > _field_8C)
+			if (pos.y > _jumpingPhase3Y)
 				goto LABEL_77;
 
-			v53.y += 4;
+			pos.y += 4;
 			goto LABEL_75;
 		}
 LABEL_80:
@@ -435,10 +435,10 @@ LABEL_108:
 				updateStats();
 
 				_doingJump = false;
-				_field_64 = 7 - _livesCounter;
+				_manSpeed = 7 - _livesCounter;
 
-				if (_field_64 > 4)
-					_field_64 = 4;
+				if (_manSpeed > 4)
+					_manSpeed = 4;
 			}
 		}
 
@@ -459,31 +459,29 @@ LABEL_108:
 		if ((_goingLeft || _goingRight) && !_doingWalk) {
 			_doingWalk = true;
 			_walkFlagObj->set_state("\xe4\xe0");		// "да"
-		}
 
-		if ((_goingLeft || _goingRight) && !_doingJump)
-			goto LABEL_177;
+			_jumpFlag = false;
+			_jumpFlagObj->set_state("\xed\xe5\xf2");	// "нет"
 
-		if (_doingWalk) {
-			_doingWalk = false;
-			_walkFlagObj->set_state("\xed\xe5\xf2");	// "нет"
+			return;
 		}
 
-		if (_doingJump)
-			goto LABEL_177;
+		if (_doingJump) {
+			_doingWalk = false;
+			_walkFlagObj->set_state("\xed\xe5\xf2");	// "нет"
 
-		if (!_doingWalk) {
 			_jumpFlag = true;
 			_jumpFlagObj->set_state("\xe4\xe0");		// "да"
-		}
 
-		if (!_doingJump) {
-LABEL_177:
-			if (_doingWalk) {
-				_jumpFlag = false;
-				_jumpFlagObj->set_state("\xed\xe5\xf2");	// "нет"
-			}
+			return;
 		}
+
+
+		_doingWalk = false;
+		_walkFlagObj->set_state("\xed\xe5\xf2");	// "нет"
+
+		_jumpFlag = false;
+		_jumpFlagObj->set_state("\xed\xe5\xf2");	// "нет"
 	}
 
 	bool finit() {
@@ -547,12 +545,12 @@ private:
 	bool _doingWalk = false;
 	bool _jumpFlag = false;
 
-	int _field_4C = 0;
-	int _field_50 = 0;
-	int _field_54 = -1;
+	int _stepsToLeft = 0;
+	int _stepsToRight = 0;
+	int _stepsToJump = -1;
 
 	mgVect3f _menCoords;
-	int _field_64 = 2;
+	int _manSpeed = 2;
 
 	int _shotsTomatoCounter = 9;
 	int _shotsBananaCounter = 10;
@@ -563,15 +561,14 @@ private:
 
 	mgVect2i _cursorPos;
 
-	int _field_84 = 0;
-	int _field_88 = 0;
-	int _field_8C = 0;
-
-	bool _flag4 = false;
+	int _manOrigPosY = 0;
+	int _jumpHeight = 0;
+	int _jumpingPhase3Y = 0;
 
-	int _someSwitch = 2;
-	int _someSwitchBackup = -1;
+	bool _jumpPhaseIsGoingDown = false;
 
+	int _jumpPhase = 2;
+	int _jumpNextPhase = -1;
 };
 
 } // namespace QDEngine




More information about the Scummvm-git-logs mailing list