[Scummvm-git-logs] scummvm master -> 739c608829a4abdc1fa77ad87345d477f47ced52

bluegr bluegr at gmail.com
Thu Oct 21 22:12:48 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:
739c608829 GROOVIE: Separate game logic for 11h and Clan, and reuse it for UHP


Commit: 739c608829a4abdc1fa77ad87345d477f47ced52
    https://github.com/scummvm/scummvm/commit/739c608829a4abdc1fa77ad87345d477f47ced52
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-10-22T01:12:39+03:00

Commit Message:
GROOVIE: Separate game logic for 11h and Clan, and reuse it for UHP

Changed paths:
    engines/groovie/logic/clangame.cpp
    engines/groovie/logic/clangame.h
    engines/groovie/logic/t11hgame.cpp
    engines/groovie/script.cpp
    engines/groovie/script.h


diff --git a/engines/groovie/logic/clangame.cpp b/engines/groovie/logic/clangame.cpp
index c5aaecf5c9..1ab5c86f85 100644
--- a/engines/groovie/logic/clangame.cpp
+++ b/engines/groovie/logic/clangame.cpp
@@ -20,6 +20,8 @@
  *
  */
 
+#include "common/debug.h"
+#include "groovie/groovie.h"
 #include "groovie/logic/clangame.h"
 
 namespace Groovie {
@@ -40,4 +42,23 @@ const char *ClanGame::getClanMusicFilename(int musicId) {
 	return kClanMusicFiles[musicId];
 }
 
+ClanGame::ClanGame(byte *scriptVariables)
+	: _scriptVariables(scriptVariables) {
+}
+
+ClanGame::~ClanGame() {
+}
+
+void ClanGame::handleOp(uint8 op) {
+	switch (op) {
+	case 8:
+		debugC(1, kDebugScript, "Groovie::Script Op42 (0x%02X): Clandestiny Othello", op);
+		// TODO: Clandestiny Othello/Reversi puzzle (opOthello)
+		break;
+
+	default:
+		debugC(1, kDebugScript, "Groovie::Script: Op42 (0x%02X): Clandestiny Invalid -> NOP", op);
+	}
+}
+
 } // namespace Groovie
diff --git a/engines/groovie/logic/clangame.h b/engines/groovie/logic/clangame.h
index 91b9254cd4..df0bd52534 100644
--- a/engines/groovie/logic/clangame.h
+++ b/engines/groovie/logic/clangame.h
@@ -23,11 +23,21 @@
 #ifndef GROOVIE_LOGIC_CLANGAME_H
 #define GROOVIE_LOGIC_CLANGAME_H
 
+#include "common/scummsys.h"
+
 namespace Groovie {
 
 class ClanGame {
 public:
+	ClanGame(byte *scriptVariables);
+	~ClanGame();
+
+	void handleOp(uint8 op);
+
 	static const char *getClanMusicFilename(int musicId);
+
+private:
+	byte *_scriptVariables;
 };
 
 } // namespace Groovie
diff --git a/engines/groovie/logic/t11hgame.cpp b/engines/groovie/logic/t11hgame.cpp
index 92d50df575..81cc2e9156 100644
--- a/engines/groovie/logic/t11hgame.cpp
+++ b/engines/groovie/logic/t11hgame.cpp
@@ -44,7 +44,7 @@ T11hGame::~T11hGame() {
 void T11hGame::handleOp(uint8 op) {
 	switch (op) {
 	case 1:
-		debugC(1, kDebugScript, "Groovie::Script Op42 (0x%02X): T11H Connect four in the dining room. (tb.grv) TODO", op);
+		debugC(1, kDebugScript, "Groovie::Script Op42 (0x%02X): T11H Connect four in the dining room. (tb.grv)", op);
 		opConnectFour();
 		break;
 
@@ -73,11 +73,6 @@ void T11hGame::handleOp(uint8 op) {
 		opPente();
 		break;
 
-	case 8:	// used in UHP
-		debugC(1, kDebugScript, "Groovie::Script Op42 (0x%02X): UHP Othello", op);
-		// TODO: Same as the Clandestiny Othello/Reversi puzzle (opOthello)
-		break;
-
 	default:
 		debugC(1, kDebugScript, "Groovie::Script: Op42 (0x%02X): T11H Invalid -> NOP", op);
 	}
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index e56932385f..7006e826c8 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -32,8 +32,9 @@
 #include "groovie/resource.h"
 #include "groovie/saveload.h"
 #include "groovie/logic/cell.h"
-#include "groovie/logic/tlcgame.h"
+#include "groovie/logic/clangame.h"
 #include "groovie/logic/t11hgame.h"
+#include "groovie/logic/tlcgame.h"
 
 #include "gui/saveload.h"
 
@@ -2086,15 +2087,34 @@ void Script::o_gamelogic() {
 		break;
 
 	case kGroovieT11H:
-	case kGroovieUHP:
 		if (!_t11hGame)
 			_t11hGame = new T11hGame(_variables);
 
-		// TODO: Separate UHP game logic in 11th Hour / Clandestiny
 		_t11hGame->handleOp(param);
 		break;
 
+	case kGroovieCDY:
+		if (!_clanGame)
+			_clanGame = new ClanGame(_variables);
+
+		_clanGame->handleOp(param);
+		break;
+
+	case kGroovieUHP:
+		if (param != 8) {
+			if (!_t11hGame)
+				_t11hGame = new T11hGame(_variables);
+			
+			_t11hGame->handleOp(param);
+		} else {
+			if (!_clanGame)
+				_clanGame = new ClanGame(_variables);
+
+			_clanGame->handleOp(param);
+		}
+		break;
 #endif
+
 	default:
 		debugC(1, kDebugScript, "Groovie::Script: GameSpecial (0x%02X)", param);
 		warning("Groovie::Script: OpCode 0x42 for (GameSpecial) current game not implemented yet.");
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index 7023f52b63..2d535ff46c 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -43,6 +43,7 @@ class Debugger;
 class GroovieEngine;
 class TlcGame;
 class T11hGame;
+class ClanGame;
 
 class Script {
 	friend class Debugger;
@@ -135,6 +136,7 @@ private:
 	CellGame *_cellGame;
 	TlcGame *_tlcGame;
 	T11hGame *_t11hGame;
+	ClanGame *_clanGame;
 
 	// Helper functions
 	uint8 getCodeByte(uint16 address);




More information about the Scummvm-git-logs mailing list