[Scummvm-git-logs] scummvm master -> 53932b82f41014fe9401ccda8c574dc84a0a6fbe

sev- noreply at scummvm.org
Wed Oct 16 12:20:43 UTC 2024


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

Summary:
686efba885 QDENGINE: Fix 3mice2_testo.dll minigame
f6ec521a4c QDENINGE: Initial code for 3mice2_plate.dll minigame
eb2676778c QDENINGE: Implemented all methods for 3mice2_plate.dll minigame
4c68593ab3 QDENGINE: Debugged 3mice2_plate.h mnigame
4876098065 QDENGINE: Init method for 3mice2_raskr1.dll minigame
62c24fc100 QDENGINE: Optimized logic implementation for 3mice2_raskr1.dll minigame
634331c068 QDENGINE: Fix 3Mice2_raskr1.dll minigame. Now it is completable
04310ba5f4 QDENGINE: Implement 3mice2_babochka.dll minigame
a14b40acc4 QDENGINE: Renamed minigame Raskr1 to Raskr_All
b396d62552 QDENGiNE: Made 3mice2_raskr_all minigame configurable
53932b82f4 QDENGINE: Added data from 3mice2_raskr2..4.dll. These minigames are unused


Commit: 686efba8857fbf0f007c0a10755150c310776341
    https://github.com/scummvm/scummvm/commit/686efba8857fbf0f007c0a10755150c310776341
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:08+02:00

Commit Message:
QDENGINE: Fix 3mice2_testo.dll minigame

Changed paths:
    engines/qdengine/minigames/3mice2_testo.h


diff --git a/engines/qdengine/minigames/3mice2_testo.h b/engines/qdengine/minigames/3mice2_testo.h
index 8e612e0c018..220914713b3 100644
--- a/engines/qdengine/minigames/3mice2_testo.h
+++ b/engines/qdengine/minigames/3mice2_testo.h
@@ -283,6 +283,7 @@ private:
 
 	int hitTest() {
 		mgVect2i pos = _engine->mouse_cursor_position();
+		pos.x += _noDoughX;
 
 		for (int i = 0; i < 8; i++) {
 			if (_figures[i + 8]->hit_test(pos))
@@ -305,7 +306,7 @@ private:
 
 			for (int j = 0; j < 8; j++) {
 				if (j != num) {
-					if (_figures[8 + i]->hit_test(npos))
+					if (_figures[8 + j]->hit_test(npos))
 						return true;
 
 					if (_objNoDoughFake->hit_test(npos))


Commit: f6ec521a4cad6d7442c03b7113cdeac5e5750801
    https://github.com/scummvm/scummvm/commit/f6ec521a4cad6d7442c03b7113cdeac5e5750801
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:08+02:00

Commit Message:
QDENINGE: Initial code for 3mice2_plate.dll minigame

Changed paths:
  A engines/qdengine/minigames/3mice2_plate.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_plate.h b/engines/qdengine/minigames/3mice2_plate.h
new file mode 100644
index 00000000000..9761e3fd000
--- /dev/null
+++ b/engines/qdengine/minigames/3mice2_plate.h
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef QDENGINE_MINIGAMES_3MICE2_PLATE_H
+#define QDENGINE_MINIGAMES_3MICE2_PLATE_H
+
+#include "common/debug.h"
+
+#include "qdengine/qd_fwd.h"
+#include "qdengine/qdcore/qd_minigame_interface.h"
+
+namespace QDEngine {
+
+class qd3mice2PlateMiniGame : public qdMiniGameInterface {
+public:
+	qd3mice2PlateMiniGame() {}
+	~qd3mice2PlateMiniGame() {}
+
+	bool init(const qdEngineInterface *engine_interface) {
+		debugC(1, kDebugMinigames, "3mice2Plate::init()");
+
+		for (int i = 1; i <= 5; i++) {
+			_figures[i] = _scene->object_interface(Common::String::format("object@%i#", i).c_str());
+			_figures[i + 6] = _scene->object_interface(Common::String::format("inv_object@%i#", i).c_str());
+		}
+
+		_objDone = _scene->object_interface("$done");
+		_objZoneTarget = _scene->object_interface("zone_target");
+		_objZoneFull = _scene->object_interface("zone_full");
+		_objeFading = _scene->object_interface("затемнение");
+		_objHasStarted = _scene->object_interface("$запуск был");
+
+		_initialCoords[1] = 54;
+		_initialCoords[2] = 99;
+		_initialCoords[3] = 693;
+		_initialCoords[4] = 673;
+		_initialCoords[5] = 706;
+		_initialCoords[7] = 452;
+		_initialCoords[8] = 98;
+		_initialCoords[9] = 436;
+		_initialCoords[10] = 93;
+		_initialCoords[11] = 254;
+
+		mgVect2i pos;
+
+		if (_objHasStarted->is_state_active("нет")) {
+			for (int i = 0; i < 5; i++) {
+				pos.x = _initialCoords[i + 1];
+				pos.y = _initialCoords[i + 7];
+
+				_figures[i + 1]->set_R(_scene->screen2world_coords(pos, 0.0));
+			}
+
+			_zoneDepth = -100;
+			_objHasStarted->set_state("да");
+		} else {
+			float depth = 0.0;
+
+			for (int i = 0; i < 5; i++) {
+				if (_scene->screen_depth(_figures[i + 1]->R()) < depth)
+					depth = _scene->screen_depth(_figures[i + 1]->R());
+			}
+
+			_zoneDepth = depth - 100;
+		}
+
+		return true;
+	}
+
+	bool quant(float dt) {
+		debugC(3, kDebugMinigames, "3mice2Plate::quant(%f)", dt);
+
+		return true;
+	}
+
+	bool finit() {
+		debugC(1, kDebugMinigames, "3mice2Plate::finit()");
+
+		if (_scene)  {
+			_engine->release_scene_interface(_scene);
+			_scene = 0;
+		}
+
+ 		return true;
+	}
+
+	bool new_game(const qdEngineInterface *engine_interface) {
+		return true;
+	}
+
+	int save_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	int load_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, const char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	enum { INTERFACE_VERSION = 112 };
+	int version() const {
+		return INTERFACE_VERSION;
+	}
+
+private:
+	const qdEngineInterface *_engine = nullptr;
+	qdMinigameSceneInterface *_scene = nullptr;
+
+	qdMinigameObjectInterface *_figures[12] = { nullptr };
+	qdMinigameObjectInterface *_objDone = nullptr;
+	qdMinigameObjectInterface *_objZoneTarget = nullptr;
+	qdMinigameObjectInterface *_objZoneFull = nullptr;
+	qdMinigameObjectInterface *_objeFading = nullptr;
+	qdMinigameObjectInterface *_objHasStarted = nullptr;
+	int _initialCoords[12] = { 0 };
+	int _zoneDepth = 0;
+};
+
+} // namespace QDEngine
+
+#endif // QDENGINE_MINIGAMES_3MICE2_PLATE_H
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index c3f24426ae5..7b767d10833 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -57,6 +57,7 @@
 #include "qdengine/minigames/3mice2_sudoku.h"
 #include "qdengine/minigames/3mice2_states.h"
 #include "qdengine/minigames/3mice2_testo.h"
+#include "qdengine/minigames/3mice2_plate.h"
 
 namespace QDEngine {
 


Commit: eb2676778c3d4b6bece4d81e64159736a3f57691
    https://github.com/scummvm/scummvm/commit/eb2676778c3d4b6bece4d81e64159736a3f57691
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:08+02:00

Commit Message:
QDENINGE: Implemented all methods for 3mice2_plate.dll minigame

Changed paths:
    engines/qdengine/minigames/3mice2_plate.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_plate.h b/engines/qdengine/minigames/3mice2_plate.h
index 9761e3fd000..d4adcea675d 100644
--- a/engines/qdengine/minigames/3mice2_plate.h
+++ b/engines/qdengine/minigames/3mice2_plate.h
@@ -45,8 +45,8 @@ public:
 		_objDone = _scene->object_interface("$done");
 		_objZoneTarget = _scene->object_interface("zone_target");
 		_objZoneFull = _scene->object_interface("zone_full");
-		_objeFading = _scene->object_interface("затемнение");
-		_objHasStarted = _scene->object_interface("$запуск был");
+		_objFading = _scene->object_interface("\xE7\xE0\xF2\xE5\xEC\xED\xE5\xED\xE8\xE5"); // "затемнение"
+		_objHasStarted = _scene->object_interface("$\xE7\xE0\xEF\xF3\xF1\xEA \xE1\xFB\xEB"); // "$запуск был"
 
 		_initialCoords[1] = 54;
 		_initialCoords[2] = 99;
@@ -61,7 +61,7 @@ public:
 
 		mgVect2i pos;
 
-		if (_objHasStarted->is_state_active("нет")) {
+		if (_objHasStarted->is_state_active("\xed\xe5\xf2")) { // "нет"
 			for (int i = 0; i < 5; i++) {
 				pos.x = _initialCoords[i + 1];
 				pos.y = _initialCoords[i + 7];
@@ -70,7 +70,7 @@ public:
 			}
 
 			_zoneDepth = -100;
-			_objHasStarted->set_state("да");
+			_objHasStarted->set_state("\xe4\xe0");	// "да"
 		} else {
 			float depth = 0.0;
 
@@ -88,6 +88,113 @@ public:
 	bool quant(float dt) {
 		debugC(3, kDebugMinigames, "3mice2Plate::quant(%f)", dt);
 
+		qdMinigameObjectInterface *mouseObj = _scene->mouse_object_interface();
+		qdMinigameObjectInterface *clickObj = _scene->mouse_click_object_interface();
+		qdMinigameObjectInterface *hoverObj = _scene->mouse_hover_object_interface();
+
+		const char *name;
+
+		if (clickObj && !mouseObj) {
+			name = clickObj->name();
+
+			if (strstr(name, "object@") && clickObj->is_state_active("base")) {
+				int num = getObjNum(name);
+
+				clickObj->set_state("hide");
+				_figures[num + 5]->set_state("to_inv");
+				_objZoneFull->set_state("\xD4\xEE\xED - \xEC\xE0\xF1\xEA\xE0"); // "Фон - маска"
+
+				_objZoneFull->set_R(_scene->screen2world_coords(_objZoneFull->screen_R(), _zoneDepth - 500));
+				_objZoneTarget->set_R(_scene->screen2world_coords(_objZoneTarget->screen_R(), _zoneDepth - 1500));
+				_objFading->set_R(_scene->screen2world_coords(_objFading->screen_R(), _zoneDepth - 3500));
+			} else if (!strcmp(name, "zone_target")) {
+				int minDepth = 32768.0;
+				int num = -1;
+
+				for (int i = 0; i < 5; i++) {
+					float depth = _scene->screen_depth(_figures[i + 1]->R());
+					if (depth < minDepth && _figures[i + 1]->is_state_active("plate")) {
+						minDepth = depth;
+						num = i + 1;
+					}
+				}
+
+				if (num > -1) {
+					_figures[num]->set_state("hide");
+					_figures[num + 5]->set_state("to_inv");
+					_objZoneFull->set_state("\xD4\xEE\xED - \xEC\xE0\xF1\xEA\xE0"); // "Фон - маска"
+
+					_objZoneFull->set_R(_scene->screen2world_coords(_objZoneFull->screen_R(), _zoneDepth - 1500));
+					_objZoneTarget->set_R(_scene->screen2world_coords(_objZoneTarget->screen_R(), _zoneDepth - 2500));
+				}
+			}
+
+			_objFading->set_R(_scene->screen2world_coords(_objFading->screen_R(), _zoneDepth - 3500));
+
+			_scene->release_object_interface(clickObj);
+		}
+
+		if (_engine->is_mouse_event_active(qdmg::qdEngineInterfaceImpl::MOUSE_EV_RIGHT_DOWN) && mouseObj) {
+			name = mouseObj->name();
+
+			int num = getObjNum(name);
+
+			mouseObj->set_state("del");
+
+			_figures[num]->set_state("base");
+
+			mgVect2i pos;
+
+			pos.x = _initialCoords[num];
+			pos.y = _initialCoords[num + 6];
+
+			_figures[num]->set_R(_scene->screen2world_coords(pos, 0));
+
+			_scene->release_object_interface(mouseObj);
+
+			_objZoneFull->set_state("no");
+
+			_objFading->set_R(_scene->screen2world_coords(_objFading->screen_R(), _zoneDepth - 3500));
+		}
+
+		if (_engine->is_mouse_event_active(qdmg::qdEngineInterfaceImpl::MOUSE_EV_LEFT_DOWN) && mouseObj && hoverObj) {
+			name = mouseObj->name();
+
+			int num = getObjNum(name);
+
+			if (!strcmp(hoverObj->name(), "zone_target")) {
+				mouseObj->set_state("del");
+
+				_figures[num]->set_state("plate");
+
+				_figures[num]->set_R(_scene->screen2world_coords(mgVect2i(400, 300), 0));
+
+				_zoneDepth -= 500;
+			} else if (!strcmp(hoverObj->name(), "zone_full")) {
+				mouseObj->set_state("del");
+
+				_figures[num]->set_state("base");
+
+				mgVect2i pos;
+
+				pos.x = _initialCoords[num];
+				pos.y = _initialCoords[num + 6];
+
+				_figures[num]->set_R(_scene->screen2world_coords(pos, 0));
+			}
+
+			_objFading->set_R(_scene->screen2world_coords(_objFading->screen_R(), _zoneDepth - 3500));
+
+			_scene->release_object_interface(mouseObj);
+
+			_objZoneFull->set_state("no");
+		}
+
+		if (checkSolution())
+			_objDone->set_state("\xe4\xe0");	// "да"
+		else
+			_objDone->set_state("\xed\xe5\xf2"); // "нет"
+
 		return true;
 	}
 
@@ -119,6 +226,33 @@ public:
 		return INTERFACE_VERSION;
 	}
 
+private:
+	bool checkSolution() {
+		for (int i = 0; i < 5; i++) {
+			if (!_figures[i + 1]->is_state_active("plate"))
+				return false;
+
+			if (i == 4)
+				break;
+
+			if (_scene->screen_depth(_figures[i + 1]->R()) < _scene->screen_depth(_figures[i + 2]->R()))
+				return false;
+		}
+
+		return true;
+	}
+
+	int getObjNum(const char *name) {
+		const char *from = strstr(name, "@");
+		const char *to = strstr(name, "#");
+		char tmp[20];
+
+		Common::strlcpy(tmp, from + 1, to - from);
+
+		return atol(tmp);
+	}
+
+
 private:
 	const qdEngineInterface *_engine = nullptr;
 	qdMinigameSceneInterface *_scene = nullptr;
@@ -127,7 +261,7 @@ private:
 	qdMinigameObjectInterface *_objDone = nullptr;
 	qdMinigameObjectInterface *_objZoneTarget = nullptr;
 	qdMinigameObjectInterface *_objZoneFull = nullptr;
-	qdMinigameObjectInterface *_objeFading = nullptr;
+	qdMinigameObjectInterface *_objFading = nullptr;
 	qdMinigameObjectInterface *_objHasStarted = nullptr;
 	int _initialCoords[12] = { 0 };
 	int _zoneDepth = 0;
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index 7b767d10833..d92c6eb0721 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -348,8 +348,10 @@ bool qdMiniGame::load_interface() {
 		} else if (_dll_name == "DLL\\3Mice2_testo.dll") {
 			_interface = new qd3mice2TestoMiniGame();
 			return true;
+		} else if (_dll_name == "DLL\\3Mice2_plate.dll") {
+			_interface = new qd3mice2PlateMiniGame();
+			return true;
 		// 3Mice2_babochka.dll
-		// 3Mice2_plate.dll
 		// 3Mice2_raskr1.dll
 		// 3Mice2_raskr2.dll
 		// 3Mice2_raskr3.dll


Commit: 4c68593ab35db0c0bbbb6897fba12808fbc680d5
    https://github.com/scummvm/scummvm/commit/4c68593ab35db0c0bbbb6897fba12808fbc680d5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:09+02:00

Commit Message:
QDENGINE: Debugged 3mice2_plate.h mnigame

Changed paths:
    engines/qdengine/minigames/3mice2_plate.h


diff --git a/engines/qdengine/minigames/3mice2_plate.h b/engines/qdengine/minigames/3mice2_plate.h
index d4adcea675d..f6d4ed68c91 100644
--- a/engines/qdengine/minigames/3mice2_plate.h
+++ b/engines/qdengine/minigames/3mice2_plate.h
@@ -37,9 +37,14 @@ public:
 	bool init(const qdEngineInterface *engine_interface) {
 		debugC(1, kDebugMinigames, "3mice2Plate::init()");
 
+		_engine = engine_interface;
+		_scene = engine_interface->current_scene_interface();
+		if (!_scene)
+			return false;
+
 		for (int i = 1; i <= 5; i++) {
 			_figures[i] = _scene->object_interface(Common::String::format("object@%i#", i).c_str());
-			_figures[i + 6] = _scene->object_interface(Common::String::format("inv_object@%i#", i).c_str());
+			_figures[i + 5] = _scene->object_interface(Common::String::format("inv_object@%i#", i).c_str());
 		}
 
 		_objDone = _scene->object_interface("$done");
@@ -101,6 +106,9 @@ public:
 				int num = getObjNum(name);
 
 				clickObj->set_state("hide");
+
+				debugC(2, kDebugMinigames, "to_inv: num is: %d for name: '%s'", num, name);
+
 				_figures[num + 5]->set_state("to_inv");
 				_objZoneFull->set_state("\xD4\xEE\xED - \xEC\xE0\xF1\xEA\xE0"); // "Фон - маска"
 
@@ -119,6 +127,8 @@ public:
 					}
 				}
 
+				debugC(2, kDebugMinigames, "zone_target: num is: %d", num);
+
 				if (num > -1) {
 					_figures[num]->set_state("hide");
 					_figures[num + 5]->set_state("to_inv");
@@ -139,6 +149,8 @@ public:
 
 			int num = getObjNum(name);
 
+			debugC(2, kDebugMinigames, "base: num is: %d for name: '%s'", num, name);
+
 			mouseObj->set_state("del");
 
 			_figures[num]->set_state("base");
@@ -162,12 +174,14 @@ public:
 
 			int num = getObjNum(name);
 
+			debugC(2, kDebugMinigames, "plate: num is: %d for name: '%s'", num, name);
+
 			if (!strcmp(hoverObj->name(), "zone_target")) {
 				mouseObj->set_state("del");
 
 				_figures[num]->set_state("plate");
 
-				_figures[num]->set_R(_scene->screen2world_coords(mgVect2i(400, 300), 0));
+				_figures[num]->set_R(_scene->screen2world_coords(mgVect2i(400, 300), _zoneDepth));
 
 				_zoneDepth -= 500;
 			} else if (!strcmp(hoverObj->name(), "zone_full")) {


Commit: 4876098065e64ae7169df91c331742bafa984ff5
    https://github.com/scummvm/scummvm/commit/4876098065e64ae7169df91c331742bafa984ff5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:09+02:00

Commit Message:
QDENGINE: Init method for 3mice2_raskr1.dll minigame

Changed paths:
  A engines/qdengine/minigames/3mice2_raskr1.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_raskr1.h b/engines/qdengine/minigames/3mice2_raskr1.h
new file mode 100644
index 00000000000..d0b14f434a6
--- /dev/null
+++ b/engines/qdengine/minigames/3mice2_raskr1.h
@@ -0,0 +1,116 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef QDENGINE_MINIGAMES_3MICE2_RASKR1_H
+#define QDENGINE_MINIGAMES_3MICE2_RASKR1_H
+
+#include "common/debug.h"
+
+#include "qdengine/qd_fwd.h"
+#include "qdengine/qdcore/qd_minigame_interface.h"
+
+namespace QDEngine {
+
+class qd3mice2Raskr1MiniGame : public qdMiniGameInterface {
+public:
+	qd3mice2Raskr1MiniGame() {}
+	~qd3mice2Raskr1MiniGame() {}
+
+	bool init(const qdEngineInterface *engine_interface) {
+		debugC(1, kDebugMinigames, "3mice2Raskr1::init()");
+
+		_engine = engine_interface;
+		_scene = engine_interface->current_scene_interface();
+		if (!_scene)
+			return false;
+
+		for (int i = 1; i <= 311; i++)
+			_zones[i] = _scene->object_interface(Common::String::format("zone@%i#", i).c_str());
+
+		_objColor = _scene->object_interface("$color");
+		_objColorSel = _scene->object_interface("$color_sel");
+		_objLoaded = _scene->object_interface("$loaded");
+		_objDone = _scene->object_interface("$done");
+
+		if (_objLoaded->is_state_active("no")) {
+			for (int i = 1; i <= 311; i++)
+				_zones[i]->set_shadow(0xFEFEFF, 0);
+
+			_objColorSel->set_state("!\xEC\xE0\xF1\xEA\xE0"); // "!маска"
+			_objColor->set_shadow(0xFEFEFE, 0);
+			_objLoaded->set_state("yes");
+		}
+
+		_timePassed = 0;
+
+  		return true;
+	}
+
+	bool quant(float dt) {
+		debugC(3, kDebugMinigames, "3mice2Raskr1::quant(%f)", dt);
+
+		return true;
+	}
+
+	bool finit() {
+		debugC(1, kDebugMinigames, "3mice2Raskr1::finit()");
+
+		if (_scene)  {
+			_engine->release_scene_interface(_scene);
+			_scene = 0;
+		}
+
+ 		return true;
+	}
+
+	bool new_game(const qdEngineInterface *engine_interface) {
+		return true;
+	}
+
+	int save_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	int load_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, const char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	enum { INTERFACE_VERSION = 112 };
+	int version() const {
+		return INTERFACE_VERSION;
+	}
+
+private:
+	const qdEngineInterface *_engine = nullptr;
+	qdMinigameSceneInterface *_scene = nullptr;
+
+	qdMinigameObjectInterface *_zones[312] = { nullptr };
+	qdMinigameObjectInterface *_objColor = nullptr;
+	qdMinigameObjectInterface *_objColorSel = nullptr;
+	qdMinigameObjectInterface *_objLoaded = nullptr;
+	qdMinigameObjectInterface *_objDone = nullptr;
+
+	float _timePassed = 0;
+};
+
+} // namespace QDEngine
+
+#endif // QDENGINE_MINIGAMES_3MICE2_RASKR1_H
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index d92c6eb0721..0895495bdba 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -58,6 +58,7 @@
 #include "qdengine/minigames/3mice2_states.h"
 #include "qdengine/minigames/3mice2_testo.h"
 #include "qdengine/minigames/3mice2_plate.h"
+#include "qdengine/minigames/3mice2_raskr1.h"
 
 namespace QDEngine {
 


Commit: 62c24fc100049bd9b849af96d6c7d9560612b616
    https://github.com/scummvm/scummvm/commit/62c24fc100049bd9b849af96d6c7d9560612b616
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:09+02:00

Commit Message:
QDENGINE: Optimized logic implementation for 3mice2_raskr1.dll minigame

Changed paths:
    engines/qdengine/minigames/3mice2_raskr1.h


diff --git a/engines/qdengine/minigames/3mice2_raskr1.h b/engines/qdengine/minigames/3mice2_raskr1.h
index d0b14f434a6..454862ff049 100644
--- a/engines/qdengine/minigames/3mice2_raskr1.h
+++ b/engines/qdengine/minigames/3mice2_raskr1.h
@@ -29,6 +29,94 @@
 
 namespace QDEngine {
 
+const int zoneCountInit[] = {
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+	22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 64, 89, 90, 91,
+	92, 93, 94, 96, 97, 98, 99, 129, 130, 132, 134, 135, 136, 138, 139, 140, 141,
+	142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 153, 154, 155, 156, 157, 158,
+	159, 160, 161, 162, 163, 164, 166, 167, 170, 172, 173, 174, 178, 179, 180, 182,
+	184, 185, 186, 187, 190, 192, 196, 197, 198, 199, 204, 205, 211, 212, 213, 214,
+	216, 217, 218, 219, 220, 221, 222, 223, 225, 226, 227, 229, 230, 231, 232, 234,
+	242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 254, 255, 260, 261, 263,
+	265, 267, 268, 271, 272, 273, 274, 280, 283, 284, 287, 288, 289, 290, 292, 294,
+	296, 308, 309,
+};
+
+const int colorRegions[] = {
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+	27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 89, 308, 309, 311, 0,
+
+	64, 65, 0,
+
+	90, 91, 92, 190, 207, 0,
+
+	93, 94, 95, 0,
+
+	96, 97, 98, 99, 103, 0,
+
+	129, 132, 133, 0,
+
+	130, 131, 0,
+
+	134, 135, 136, 137, 0,
+
+	138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
+
+	153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 0,
+
+	166, 167, 194, 0,
+
+	170, 171, 0,
+
+	172, 173, 174, 175, 0,
+
+	178, 179, 180, 182, 184, 185, 186, 187, 229, 230, 231, 232, 233, 0,
+
+	192, 282, 0,
+
+	196, 208, 0,
+
+	197, 198, 199, 200, 0,
+
+	204, 205, 206, 0,
+
+	211, 212, 213, 214, 215, 0,
+
+	216, 217, 218, 219, 220, 221, 222, 223, 224, 0,
+
+	225, 226, 227, 228, 0,
+
+	234, 235, 0,
+
+	242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 0,
+
+	254, 255, 256, 0,
+
+	260, 261, 262, 0,
+
+	263, 264, 0,
+
+	265, 266, 0,
+
+	267, 268, 269, 0,
+
+	271, 272, 273, 274, 275, 0,
+
+	280, 281, 0,
+
+	283, 306, 0,
+
+	284, 287, 288, 289, 290, 307, 0,
+
+	292, 293, 0,
+
+	294, 295, 0,
+
+	296, 297, 0,
+
+	0,
+};
+
 class qd3mice2Raskr1MiniGame : public qdMiniGameInterface {
 public:
 	qd3mice2Raskr1MiniGame() {}
@@ -42,8 +130,13 @@ public:
 		if (!_scene)
 			return false;
 
-		for (int i = 1; i <= 311; i++)
+		for (int i = 1; i <= 311; i++) {
 			_zones[i] = _scene->object_interface(Common::String::format("zone@%i#", i).c_str());
+			_zoneCount[i] = true;
+		}
+
+		for (int i = 1; i < ARRAYSIZE(zoneCountInit); i++)
+			_zoneCount[zoneCountInit[i]] = false;
 
 		_objColor = _scene->object_interface("$color");
 		_objColorSel = _scene->object_interface("$color_sel");
@@ -67,6 +160,49 @@ public:
 	bool quant(float dt) {
 		debugC(3, kDebugMinigames, "3mice2Raskr1::quant(%f)", dt);
 
+		_timePassed += dt;
+
+		if (_timePassed > 0.5) {
+			if (checkSolution())
+				_objDone->set_state("да");
+
+			_timePassed = 0.0;
+		}
+
+		qdMinigameObjectInterface *mouseObj = _scene->mouse_click_object_interface();
+
+		if (!mouseObj)
+			return true;
+
+		const char *name = mouseObj->name();
+
+		if (strstr(name, "@color@")) {
+			_objColor->set_shadow(mouseObj->shadow_color(), mouseObj->shadow_alpha());
+
+			Common::String color;
+			for (int i = 8; name[i] != '#'; i++)
+				color += name[i];
+
+			_objColorSel->set_state(color.c_str());
+		} else {
+			if (strstr(name, "zone@")) {
+				int num = getObjNum(name);
+
+				int start = 0;
+				for (int i = 0; i < ARRAYSIZE(colorRegions); i++) {
+					if (colorRegions[i] == 0)
+						start = i + 1;
+
+					if (colorRegions[i] == num)
+						break;
+				}
+
+				for (int i = start; colorRegions[i] != 0; i++)
+					_zones[colorRegions[i]]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
+			}
+		}
+		_scene->release_object_interface(mouseObj);
+
 		return true;
 	}
 
@@ -98,6 +234,29 @@ public:
 		return INTERFACE_VERSION;
 	}
 
+private:
+	bool checkSolution() {
+		int count = 0;
+
+		for (int i = 1; i < 312; i++) {
+			if (_zones[i]->shadow_color() != 0xFEFEFF)
+				if (_zoneCount[i])
+					count++;
+		}
+
+		return count > 50;
+	}
+
+	int getObjNum(const char *name) {
+		const char *from = strstr(name, "@");
+		const char *to = strstr(name, "#");
+		char tmp[20];
+
+		Common::strlcpy(tmp, from + 1, to - from);
+
+		return atol(tmp);
+	}
+
 private:
 	const qdEngineInterface *_engine = nullptr;
 	qdMinigameSceneInterface *_scene = nullptr;
@@ -108,6 +267,8 @@ private:
 	qdMinigameObjectInterface *_objLoaded = nullptr;
 	qdMinigameObjectInterface *_objDone = nullptr;
 
+	bool _zoneCount[312] = { false };
+
 	float _timePassed = 0;
 };
 


Commit: 634331c0682eebe75820a0370cf5e63899ec25d8
    https://github.com/scummvm/scummvm/commit/634331c0682eebe75820a0370cf5e63899ec25d8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T11:35:09+02:00

Commit Message:
QDENGINE: Fix 3Mice2_raskr1.dll minigame. Now it is completable

Changed paths:
    engines/qdengine/minigames/3mice2_raskr1.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_raskr1.h b/engines/qdengine/minigames/3mice2_raskr1.h
index 454862ff049..385c932a658 100644
--- a/engines/qdengine/minigames/3mice2_raskr1.h
+++ b/engines/qdengine/minigames/3mice2_raskr1.h
@@ -135,7 +135,7 @@ public:
 			_zoneCount[i] = true;
 		}
 
-		for (int i = 1; i < ARRAYSIZE(zoneCountInit); i++)
+		for (int i = 0; i < ARRAYSIZE(zoneCountInit); i++)
 			_zoneCount[zoneCountInit[i]] = false;
 
 		_objColor = _scene->object_interface("$color");
@@ -164,7 +164,7 @@ public:
 
 		if (_timePassed > 0.5) {
 			if (checkSolution())
-				_objDone->set_state("да");
+				_objDone->set_state("\xe4\xe0");	// "да"
 
 			_timePassed = 0.0;
 		}
@@ -190,15 +190,23 @@ public:
 
 				int start = 0;
 				for (int i = 0; i < ARRAYSIZE(colorRegions); i++) {
-					if (colorRegions[i] == 0)
+					if (colorRegions[i] == 0) {
 						start = i + 1;
+						continue;
+					}
 
 					if (colorRegions[i] == num)
 						break;
 				}
 
-				for (int i = start; colorRegions[i] != 0; i++)
-					_zones[colorRegions[i]]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
+				debugC(2, kDebugMinigames, "zone: %d", num);
+
+				if (start < ARRAYSIZE(colorRegions)) {
+					for (int i = start; colorRegions[i] != 0; i++)
+						_zones[colorRegions[i]]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
+				} else {
+					_zones[num]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
+				}
 			}
 		}
 		_scene->release_object_interface(mouseObj);
@@ -239,11 +247,13 @@ private:
 		int count = 0;
 
 		for (int i = 1; i < 312; i++) {
-			if (_zones[i]->shadow_color() != 0xFEFEFF)
+			if (_zones[i]->shadow_color() != 0)
 				if (_zoneCount[i])
 					count++;
 		}
 
+		debugC(2, kDebugMinigames, "Solution count: %d  zone234: %06x", count, _zones[234]->shadow_color());
+
 		return count > 50;
 	}
 
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index 0895495bdba..93e04fa3196 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -352,6 +352,9 @@ bool qdMiniGame::load_interface() {
 		} else if (_dll_name == "DLL\\3Mice2_plate.dll") {
 			_interface = new qd3mice2PlateMiniGame();
 			return true;
+		} else if (_dll_name == "DLL\\3Mice2_raskr1.dll") {
+			_interface = new qd3mice2Raskr1MiniGame();
+			return true;
 		// 3Mice2_babochka.dll
 		// 3Mice2_raskr1.dll
 		// 3Mice2_raskr2.dll


Commit: 04310ba5f40df17442e2b113cef2518960e45772
    https://github.com/scummvm/scummvm/commit/04310ba5f40df17442e2b113cef2518960e45772
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T12:12:18+02:00

Commit Message:
QDENGINE: Implement 3mice2_babochka.dll minigame

Changed paths:
  A engines/qdengine/minigames/3mice2_babochka.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_babochka.h b/engines/qdengine/minigames/3mice2_babochka.h
new file mode 100644
index 00000000000..d81f6950271
--- /dev/null
+++ b/engines/qdengine/minigames/3mice2_babochka.h
@@ -0,0 +1,191 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef QDENGINE_MINIGAMES_3MICE2_BABOCHKA_H
+#define QDENGINE_MINIGAMES_3MICE2_BABOCHKA_H
+
+#include "common/debug.h"
+
+#include "qdengine/qd_fwd.h"
+#include "qdengine/qdcore/qd_minigame_interface.h"
+
+namespace QDEngine {
+
+class qd3mice2BabochkaMiniGame : public qdMiniGameInterface {
+public:
+	qd3mice2BabochkaMiniGame() {}
+	~qd3mice2BabochkaMiniGame() {}
+
+	bool init(const qdEngineInterface *engine_interface) {
+		debugC(1, kDebugMinigames, "3mice2Babochka::init()");
+
+		_engine = engine_interface;
+		_scene = engine_interface->current_scene_interface();
+		if (!_scene)
+			return false;
+
+		for (int i = 1; i <= 25; i++)
+			_objects[i] = _scene->object_interface(Common::String::format("object@%i#", i).c_str());
+
+		for (int i = 1; i <= 25; i++)
+			_objects[26 + i] = _scene->object_interface(Common::String::format("inv_object@%i#", i).c_str());
+
+		_objDone = _scene->object_interface("$done");
+		_timePassed = 0.0;
+
+		return true;
+	}
+
+	bool quant(float dt) {
+		debugC(3, kDebugMinigames, "3mice2Babochka::quant(%f)", dt);
+
+		_timePassed += dt;
+
+		qdMinigameObjectInterface *obj = _scene->mouse_click_object_interface();
+
+		if (obj) {
+			const char *name = obj->name();
+
+			if (strstr(name, "object@") && obj->is_state_active("base") && !_scene->mouse_object_interface()) {
+				obj->set_state("hide");
+
+				int num = getObjNum(name);
+				debugC(4, kDebugMinigames, "to_inv: num is: %d for name: '%s'", num, name);
+				_objects[num + 26]->set_state("to_inv");
+			}
+
+			_scene->release_object_interface(obj);
+		}
+
+		if (_engine->is_mouse_event_active(qdmg::qdEngineInterfaceImpl::MOUSE_EV_RIGHT_DOWN)) {
+			obj = _scene->mouse_object_interface();
+
+			if (obj) {
+				const char *name = obj->name();
+				obj->set_state("del");
+
+				int num = getObjNum(name);
+				debugC(4, kDebugMinigames, "base: num is: %d for name: '%s'", num, name);
+
+				_objects[num]->set_state("base");
+
+				_scene->release_object_interface(obj);
+			}
+		}
+
+		if (_engine->is_mouse_event_active(qdmg::qdEngineInterfaceImpl::MOUSE_EV_LEFT_DOWN)) {
+			obj = _scene->mouse_object_interface();
+
+			if (obj) {
+				qdMinigameObjectInterface *obj2 = _scene->mouse_hover_object_interface();
+
+				if (obj2) {
+					const char *name = obj->name();
+
+					if (strstr(name, "@") && strstr(obj2->name(), "@")) {
+						int num = getObjNum(name);
+						debugC(2, kDebugMinigames, "part1: num is: %d for name: '%s'", num, name);
+
+						name = obj2->name();
+						int num2 = getObjNum(name);
+						debugC(2, kDebugMinigames, "part2: num2 is: %d for name: '%s'", num2, name);
+
+						if (num == num2) {
+							obj->set_state("del");
+							_objects[num]->set_state("babochka");
+						}
+
+						_scene->release_object_interface(obj);
+					}
+				}
+			}
+		}
+
+		if (_timePassed > 1.0) {
+			if (checkSolution())
+				_objDone->set_state("\xe4\xe0");	// "да"
+
+			_timePassed = 0.0;
+		}
+
+		return true;
+	}
+
+	bool finit() {
+		debugC(1, kDebugMinigames, "3mice2Babochka::finit()");
+
+		if (_scene)  {
+			_engine->release_scene_interface(_scene);
+			_scene = 0;
+		}
+
+ 		return true;
+	}
+
+	bool new_game(const qdEngineInterface *engine_interface) {
+		return true;
+	}
+
+	int save_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	int load_game(const qdEngineInterface *engine_interface, const qdMinigameSceneInterface *scene_interface, const char *buffer, int buffer_size) {
+		return 0;
+	}
+
+	enum { INTERFACE_VERSION = 112 };
+	int version() const {
+		return INTERFACE_VERSION;
+	}
+
+private:
+	bool checkSolution() {
+		for (int i = 1; i <= 25; i++)
+			if (!_objects[i]->is_state_active("babochka"))
+				return false;
+
+		return true;
+	}
+
+	int getObjNum(const char *name) {
+		const char *from = strstr(name, "@");
+		const char *to = strstr(name, "#");
+		char tmp[20];
+
+		Common::strlcpy(tmp, from + 1, to - from);
+
+		return atol(tmp);
+	}
+
+private:
+	const qdEngineInterface *_engine = nullptr;
+	qdMinigameSceneInterface *_scene = nullptr;
+
+	qdMinigameObjectInterface *_objects[52] = { nullptr };
+	qdMinigameObjectInterface *_objDone = nullptr;
+
+	float _timePassed = 0.0;
+};
+
+} // namespace QDEngine
+
+#endif // QDENGINE_MINIGAMES_3MICE2_BABOCHKA_H
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index 93e04fa3196..e7eef4b33ac 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -59,6 +59,7 @@
 #include "qdengine/minigames/3mice2_testo.h"
 #include "qdengine/minigames/3mice2_plate.h"
 #include "qdengine/minigames/3mice2_raskr1.h"
+#include "qdengine/minigames/3mice2_babochka.h"
 
 namespace QDEngine {
 
@@ -355,7 +356,9 @@ bool qdMiniGame::load_interface() {
 		} else if (_dll_name == "DLL\\3Mice2_raskr1.dll") {
 			_interface = new qd3mice2Raskr1MiniGame();
 			return true;
-		// 3Mice2_babochka.dll
+		} else if (_dll_name == "DLL\\3Mice2_babochka.dll") {
+			_interface = new qd3mice2BabochkaMiniGame();
+			return true;
 		// 3Mice2_raskr1.dll
 		// 3Mice2_raskr2.dll
 		// 3Mice2_raskr3.dll


Commit: a14b40acc49be570ac7991145e0b35d8933122f9
    https://github.com/scummvm/scummvm/commit/a14b40acc49be570ac7991145e0b35d8933122f9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T12:28:00+02:00

Commit Message:
QDENGINE: Renamed minigame Raskr1 to Raskr_All

Changed paths:
  A engines/qdengine/minigames/3mice2_raskr_all.h
  R engines/qdengine/minigames/3mice2_raskr1.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_raskr1.h b/engines/qdengine/minigames/3mice2_raskr_all.h
similarity index 93%
rename from engines/qdengine/minigames/3mice2_raskr1.h
rename to engines/qdengine/minigames/3mice2_raskr_all.h
index 385c932a658..d30fa6c14b8 100644
--- a/engines/qdengine/minigames/3mice2_raskr1.h
+++ b/engines/qdengine/minigames/3mice2_raskr_all.h
@@ -19,8 +19,8 @@
  *
  */
 
-#ifndef QDENGINE_MINIGAMES_3MICE2_RASKR1_H
-#define QDENGINE_MINIGAMES_3MICE2_RASKR1_H
+#ifndef QDENGINE_MINIGAMES_3MICE2_RASKR_ALL_H
+#define QDENGINE_MINIGAMES_3MICE2_RASKR_ALL_H
 
 #include "common/debug.h"
 
@@ -117,13 +117,13 @@ const int colorRegions[] = {
 	0,
 };
 
-class qd3mice2Raskr1MiniGame : public qdMiniGameInterface {
+class qd3mice2RaskrAllMiniGame : public qdMiniGameInterface {
 public:
-	qd3mice2Raskr1MiniGame() {}
-	~qd3mice2Raskr1MiniGame() {}
+	qd3mice2RaskrAllMiniGame() {}
+	~qd3mice2RaskrAllMiniGame() {}
 
 	bool init(const qdEngineInterface *engine_interface) {
-		debugC(1, kDebugMinigames, "3mice2Raskr1::init()");
+		debugC(1, kDebugMinigames, "3mice2RaskrAll::init()");
 
 		_engine = engine_interface;
 		_scene = engine_interface->current_scene_interface();
@@ -158,7 +158,7 @@ public:
 	}
 
 	bool quant(float dt) {
-		debugC(3, kDebugMinigames, "3mice2Raskr1::quant(%f)", dt);
+		debugC(3, kDebugMinigames, "3mice2RaskrAll::quant(%f)", dt);
 
 		_timePassed += dt;
 
@@ -215,7 +215,7 @@ public:
 	}
 
 	bool finit() {
-		debugC(1, kDebugMinigames, "3mice2Raskr1::finit()");
+		debugC(1, kDebugMinigames, "3mice2RaskrAll::finit()");
 
 		if (_scene)  {
 			_engine->release_scene_interface(_scene);
@@ -284,4 +284,4 @@ private:
 
 } // namespace QDEngine
 
-#endif // QDENGINE_MINIGAMES_3MICE2_RASKR1_H
+#endif // QDENGINE_MINIGAMES_3MICE2_RASKR_ALL_H
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index e7eef4b33ac..d67655b3022 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -58,7 +58,7 @@
 #include "qdengine/minigames/3mice2_states.h"
 #include "qdengine/minigames/3mice2_testo.h"
 #include "qdengine/minigames/3mice2_plate.h"
-#include "qdengine/minigames/3mice2_raskr1.h"
+#include "qdengine/minigames/3mice2_raskr_all.h"
 #include "qdengine/minigames/3mice2_babochka.h"
 
 namespace QDEngine {
@@ -354,7 +354,7 @@ bool qdMiniGame::load_interface() {
 			_interface = new qd3mice2PlateMiniGame();
 			return true;
 		} else if (_dll_name == "DLL\\3Mice2_raskr1.dll") {
-			_interface = new qd3mice2Raskr1MiniGame();
+			_interface = new qd3mice2RaskrAllMiniGame();
 			return true;
 		} else if (_dll_name == "DLL\\3Mice2_babochka.dll") {
 			_interface = new qd3mice2BabochkaMiniGame();


Commit: b396d62552bc9b0321c7f6fbda841e3ae4a62c56
    https://github.com/scummvm/scummvm/commit/b396d62552bc9b0321c7f6fbda841e3ae4a62c56
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T12:38:53+02:00

Commit Message:
QDENGiNE: Made 3mice2_raskr_all minigame configurable

Changed paths:
    engines/qdengine/minigames/3mice2_raskr_all.h
    engines/qdengine/qdcore/qd_minigame.cpp


diff --git a/engines/qdengine/minigames/3mice2_raskr_all.h b/engines/qdengine/minigames/3mice2_raskr_all.h
index d30fa6c14b8..38cefbe3852 100644
--- a/engines/qdengine/minigames/3mice2_raskr_all.h
+++ b/engines/qdengine/minigames/3mice2_raskr_all.h
@@ -29,7 +29,7 @@
 
 namespace QDEngine {
 
-const int zoneCountInit[] = {
+const int zoneCountInit1[] = {
 	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
 	22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 64, 89, 90, 91,
 	92, 93, 94, 96, 97, 98, 99, 129, 130, 132, 134, 135, 136, 138, 139, 140, 141,
@@ -39,10 +39,10 @@ const int zoneCountInit[] = {
 	216, 217, 218, 219, 220, 221, 222, 223, 225, 226, 227, 229, 230, 231, 232, 234,
 	242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 254, 255, 260, 261, 263,
 	265, 267, 268, 271, 272, 273, 274, 280, 283, 284, 287, 288, 289, 290, 292, 294,
-	296, 308, 309,
+	296, 308, 309, 0
 };
 
-const int colorRegions[] = {
+const int colorRegions1[] = {
 	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
 	27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 89, 308, 309, 311, 0,
 
@@ -119,7 +119,7 @@ const int colorRegions[] = {
 
 class qd3mice2RaskrAllMiniGame : public qdMiniGameInterface {
 public:
-	qd3mice2RaskrAllMiniGame() {}
+	qd3mice2RaskrAllMiniGame(int gameNum) : _gameNum(gameNum) {}
 	~qd3mice2RaskrAllMiniGame() {}
 
 	bool init(const qdEngineInterface *engine_interface) {
@@ -130,12 +130,22 @@ public:
 		if (!_scene)
 			return false;
 
-		for (int i = 1; i <= 311; i++) {
+		const int *zoneCountInit = nullptr;
+
+		if (_gameNum == 1) {
+			_numZones = 311;
+			_colorRegions = colorRegions1;
+			_colorRegionsSize = ARRAYSIZE(colorRegions1);
+
+			zoneCountInit = zoneCountInit1;
+		}
+
+		for (int i = 1; i <= _numZones; i++) {
 			_zones[i] = _scene->object_interface(Common::String::format("zone@%i#", i).c_str());
 			_zoneCount[i] = true;
 		}
 
-		for (int i = 0; i < ARRAYSIZE(zoneCountInit); i++)
+		for (int i = 0; zoneCountInit[i] != 0; i++)
 			_zoneCount[zoneCountInit[i]] = false;
 
 		_objColor = _scene->object_interface("$color");
@@ -144,7 +154,7 @@ public:
 		_objDone = _scene->object_interface("$done");
 
 		if (_objLoaded->is_state_active("no")) {
-			for (int i = 1; i <= 311; i++)
+			for (int i = 1; i <= _numZones; i++)
 				_zones[i]->set_shadow(0xFEFEFF, 0);
 
 			_objColorSel->set_state("!\xEC\xE0\xF1\xEA\xE0"); // "!маска"
@@ -189,21 +199,21 @@ public:
 				int num = getObjNum(name);
 
 				int start = 0;
-				for (int i = 0; i < ARRAYSIZE(colorRegions); i++) {
-					if (colorRegions[i] == 0) {
+				for (int i = 0; i < _colorRegionsSize; i++) {
+					if (_colorRegions[i] == 0) {
 						start = i + 1;
 						continue;
 					}
 
-					if (colorRegions[i] == num)
+					if (_colorRegions[i] == num)
 						break;
 				}
 
 				debugC(2, kDebugMinigames, "zone: %d", num);
 
-				if (start < ARRAYSIZE(colorRegions)) {
-					for (int i = start; colorRegions[i] != 0; i++)
-						_zones[colorRegions[i]]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
+				if (start < _colorRegionsSize) {
+					for (int i = start; _colorRegions[i] != 0; i++)
+						_zones[_colorRegions[i]]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
 				} else {
 					_zones[num]->set_shadow(_objColor->shadow_color(), _objColor->shadow_alpha());
 				}
@@ -246,7 +256,7 @@ private:
 	bool checkSolution() {
 		int count = 0;
 
-		for (int i = 1; i < 312; i++) {
+		for (int i = 1; i <= _numZones; i++) {
 			if (_zones[i]->shadow_color() != 0)
 				if (_zoneCount[i])
 					count++;
@@ -278,8 +288,14 @@ private:
 	qdMinigameObjectInterface *_objDone = nullptr;
 
 	bool _zoneCount[312] = { false };
+	int _numZones = 0;
 
 	float _timePassed = 0;
+
+	int _gameNum = 0;
+
+	const int *_colorRegions;
+	int _colorRegionsSize = 0;
 };
 
 } // namespace QDEngine
diff --git a/engines/qdengine/qdcore/qd_minigame.cpp b/engines/qdengine/qdcore/qd_minigame.cpp
index d67655b3022..7ec1a96b3fe 100644
--- a/engines/qdengine/qdcore/qd_minigame.cpp
+++ b/engines/qdengine/qdcore/qd_minigame.cpp
@@ -354,7 +354,7 @@ bool qdMiniGame::load_interface() {
 			_interface = new qd3mice2PlateMiniGame();
 			return true;
 		} else if (_dll_name == "DLL\\3Mice2_raskr1.dll") {
-			_interface = new qd3mice2RaskrAllMiniGame();
+			_interface = new qd3mice2RaskrAllMiniGame(1);
 			return true;
 		} else if (_dll_name == "DLL\\3Mice2_babochka.dll") {
 			_interface = new qd3mice2BabochkaMiniGame();


Commit: 53932b82f41014fe9401ccda8c574dc84a0a6fbe
    https://github.com/scummvm/scummvm/commit/53932b82f41014fe9401ccda8c574dc84a0a6fbe
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-16T14:19:51+02:00

Commit Message:
QDENGINE: Added data from 3mice2_raskr2..4.dll. These minigames are unused

The game is completable now

Changed paths:
    engines/qdengine/minigames/3mice2_raskr_all.h


diff --git a/engines/qdengine/minigames/3mice2_raskr_all.h b/engines/qdengine/minigames/3mice2_raskr_all.h
index 38cefbe3852..cb4aa58a5be 100644
--- a/engines/qdengine/minigames/3mice2_raskr_all.h
+++ b/engines/qdengine/minigames/3mice2_raskr_all.h
@@ -44,79 +44,107 @@ const int zoneCountInit1[] = {
 
 const int colorRegions1[] = {
 	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
-	27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 89, 308, 309, 311, 0,
-
+		27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 89, 308, 309, 311, 0,
 	64, 65, 0,
-
 	90, 91, 92, 190, 207, 0,
-
 	93, 94, 95, 0,
-
 	96, 97, 98, 99, 103, 0,
-
 	129, 132, 133, 0,
-
 	130, 131, 0,
-
 	134, 135, 136, 137, 0,
-
 	138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 0,
-
 	153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 0,
-
 	166, 167, 194, 0,
-
 	170, 171, 0,
-
 	172, 173, 174, 175, 0,
-
 	178, 179, 180, 182, 184, 185, 186, 187, 229, 230, 231, 232, 233, 0,
-
 	192, 282, 0,
-
 	196, 208, 0,
-
 	197, 198, 199, 200, 0,
-
 	204, 205, 206, 0,
-
 	211, 212, 213, 214, 215, 0,
-
 	216, 217, 218, 219, 220, 221, 222, 223, 224, 0,
-
 	225, 226, 227, 228, 0,
-
 	234, 235, 0,
-
 	242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 0,
-
 	254, 255, 256, 0,
-
 	260, 261, 262, 0,
-
 	263, 264, 0,
-
 	265, 266, 0,
-
 	267, 268, 269, 0,
-
 	271, 272, 273, 274, 275, 0,
-
 	280, 281, 0,
-
 	283, 306, 0,
-
 	284, 287, 288, 289, 290, 307, 0,
-
 	292, 293, 0,
-
 	294, 295, 0,
-
 	296, 297, 0,
+	0,
+};
 
+const int zoneCountInit2[] = {
+	1, 2, 3, 4, 5, 6, 8, 16, 17, 18, 37, 46, 48, 49, 50, 51, 52, 53, 54, 55,
+	56, 57, 58, 59, 60, 61, 66, 69, 70, 71, 72, 73, 74, 75, 76, 78, 80, 81,
+	82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
+	101, 102, 106, 107, 108, 109, 111, 113, 114, 115, 116, 117, 118, 119, 121,
+	124, 126, 128, 130, 131, 132, 143, 146, 154, 156, 157, 191, 192, 193, 194,
+	195, 205, 0,
+};
+
+int colorRegions2[] = {
+	1, 2, 3, 4, 5, 55, 56, 57, 58, 59, 60, 93, 94, 95, 96, 97, 98, 99, 100, 101, 134, 0,
+	6, 7, 0,
+	8, 9, 0,
+	16, 17, 18, 19, 0,
+	37, 38, 0,
+	46, 47, 0,
+	48, 49, 50, 51, 52, 53, 54, 102, 103, 0,
+	61, 68, 0,
+	66, 67, 0,
+	69, 70, 71, 72, 73, 74, 75, 76, 81, 152, 0,
+	78, 79, 0,
+	80, 85, 86, 87, 88, 89, 90, 91, 92, 141, 0,
+	82, 83, 84, 0,
+	106, 107, 108, 109, 110, 0,
+	111, 112, 0,
+	113, 114, 115, 116, 117, 118, 119, 120, 0,
+	121, 122, 0,
+	124, 125, 0,
+	126, 127, 0,
+	128, 129, 0,
+	130, 131, 132, 133, 0,
+	143, 144, 0,
+	146, 147, 0,
+	154, 155, 0,
+	156, 159, 0,
+	157, 158, 0,
+	191, 192, 193, 194, 195, 196, 0,
+	205, 206, 0,
 	0,
 };
 
+const int zoneCountInit3[] = {
+	0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+	25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 189, 190, -1
+};
+
+const int colorRegions3[] = {
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+		26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
+	190, 191, 192, 0,
+	0,
+};
+
+const int zoneCountInit4[] = {
+	0
+};
+
+const int colorRegions4[] = {
+	0,
+	0,
+};
+
+
 class qd3mice2RaskrAllMiniGame : public qdMiniGameInterface {
 public:
 	qd3mice2RaskrAllMiniGame(int gameNum) : _gameNum(gameNum) {}
@@ -131,13 +159,42 @@ public:
 			return false;
 
 		const int *zoneCountInit = nullptr;
+		int zoneCountDelta = 0;
 
 		if (_gameNum == 1) {
 			_numZones = 311;
 			_colorRegions = colorRegions1;
 			_colorRegionsSize = ARRAYSIZE(colorRegions1);
+			_neededColors = 50;
 
 			zoneCountInit = zoneCountInit1;
+			zoneCountDelta = 0;
+		} else if (_gameNum == 2) {
+			_numZones = 206;
+			_colorRegions = colorRegions2;
+			_colorRegionsSize = ARRAYSIZE(colorRegions2);
+			_neededColors = 50;
+
+			zoneCountInit = zoneCountInit2;
+			zoneCountDelta = 0;
+		} else if (_gameNum == 3) {
+			_numZones = 265;
+			_colorRegions = colorRegions3;
+			_colorRegionsSize = ARRAYSIZE(colorRegions3);
+			_neededColors = 70;
+
+			zoneCountInit = zoneCountInit3;
+			zoneCountDelta = 1;
+		} else if (_gameNum == 4) {
+			_numZones = 133;
+			_colorRegions = colorRegions4;
+			_colorRegionsSize = ARRAYSIZE(colorRegions4);
+			_neededColors = 50;
+
+			zoneCountInit = zoneCountInit4;
+			zoneCountDelta = 0;
+		} else {
+			error("qd3mice2RaskrAllMiniGame::init(): Unsupported gameNumber: %d", _gameNum);
 		}
 
 		for (int i = 1; i <= _numZones; i++) {
@@ -145,8 +202,8 @@ public:
 			_zoneCount[i] = true;
 		}
 
-		for (int i = 0; zoneCountInit[i] != 0; i++)
-			_zoneCount[zoneCountInit[i]] = false;
+		for (int i = 0; zoneCountInit[i] + zoneCountDelta != 0; i++)
+			_zoneCount[zoneCountInit[i] + zoneCountDelta] = false;
 
 		_objColor = _scene->object_interface("$color");
 		_objColorSel = _scene->object_interface("$color_sel");
@@ -264,7 +321,7 @@ private:
 
 		debugC(2, kDebugMinigames, "Solution count: %d  zone234: %06x", count, _zones[234]->shadow_color());
 
-		return count > 50;
+		return count > _neededColors;
 	}
 
 	int getObjNum(const char *name) {
@@ -296,6 +353,7 @@ private:
 
 	const int *_colorRegions;
 	int _colorRegionsSize = 0;
+	int _neededColors = 0;
 };
 
 } // namespace QDEngine




More information about the Scummvm-git-logs mailing list