[Scummvm-git-logs] scummvm master -> 9595183f27393d2671f590188d26633baf802200
mduggan
noreply at scummvm.org
Sun Apr 30 10:13:24 UTC 2023
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:
ad0bf10f28 TETRAEDGE: Fix splash screens in Syberia2
9595183f27 TETRAEDGE: Begin adding Amerzone puzzle support
Commit: ad0bf10f280dc800f32b159d29358c6fcd2991ce
https://github.com/scummvm/scummvm/commit/ad0bf10f280dc800f32b159d29358c6fcd2991ce
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-04-30T19:11:09+09:00
Commit Message:
TETRAEDGE: Fix splash screens in Syberia2
Changed paths:
engines/tetraedge/game/splash_screens.cpp
diff --git a/engines/tetraedge/game/splash_screens.cpp b/engines/tetraedge/game/splash_screens.cpp
index 715d4ecd596..270acf3e626 100644
--- a/engines/tetraedge/game/splash_screens.cpp
+++ b/engines/tetraedge/game/splash_screens.cpp
@@ -27,6 +27,7 @@
#include "tetraedge/game/application.h"
#include "tetraedge/game/game.h"
#include "tetraedge/game/splash_screens.h"
+#include "tetraedge/te/te_core.h"
namespace Tetraedge {
@@ -39,15 +40,16 @@ void SplashScreens::enter() {
_entered = true;
_splashNo = 0;
const char *scriptStr = g_engine->gameIsAmerzone() ? "GUI/PC-MacOSX/Splash0.lua" : "menus/splashes/splash0.lua";
- if (Common::File::exists(scriptStr)) {
- load(scriptStr);
+ Common::FSNode node = g_engine->getCore()->findFile(scriptStr);
+ if (node.exists()) {
+ load(node);
Application *app = g_engine->getApplication();
TeLayout *splash = layoutChecked("splash");
- if (g_engine->gameIsAmerzone()) {
- TeLayout *splashImg = dynamic_cast<TeLayout *>(splash->child(0));
- splashImg->setRatioMode(TeILayout::RATIO_MODE_NONE);
- splashImg->updateSize();
- }
+
+ TeLayout *splashImg = dynamic_cast<TeLayout *>(splash->child(0));
+ splashImg->setRatioMode(TeILayout::RATIO_MODE_NONE);
+ splashImg->updateSize();
+
app->frontLayout().addChild(splash);
app->performRender();
}
@@ -69,19 +71,19 @@ bool SplashScreens::onAlarm() {
return true;
}
- if (!Common::File::exists(scriptName)) {
+ Common::FSNode node = g_engine->getCore()->findFile(scriptName);
+ if (!node.exists()) {
onQuitSplash();
} else {
- load(scriptName);
+ load(node);
TeButtonLayout *splash = buttonLayoutChecked("splash");
splash->onMouseClickValidated().add(this, &SplashScreens::onQuitSplash);
- if (g_engine->gameIsAmerzone()) {
- TeLayout *splashImg = dynamic_cast<TeLayout *>(splash->child(0));
- splashImg->setRatioMode(TeILayout::RATIO_MODE_NONE);
- splashImg->updateSize();
- }
+ TeLayout *splashImg = dynamic_cast<TeLayout *>(splash->child(0));
+ splashImg->setRatioMode(TeILayout::RATIO_MODE_NONE);
+ splashImg->updateSize();
+
app->frontLayout().addChild(splash);
_timer.start();
Commit: 9595183f27393d2671f590188d26633baf802200
https://github.com/scummvm/scummvm/commit/9595183f27393d2671f590188d26633baf802200
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-04-30T19:12:34+09:00
Commit Message:
TETRAEDGE: Begin adding Amerzone puzzle support
Changed paths:
A engines/tetraedge/game/puzzle_cadenas.cpp
A engines/tetraedge/game/puzzle_cadenas.h
A engines/tetraedge/game/puzzle_coffre.cpp
A engines/tetraedge/game/puzzle_coffre.h
A engines/tetraedge/game/puzzle_computer_hydra.cpp
A engines/tetraedge/game/puzzle_computer_hydra.h
A engines/tetraedge/game/puzzle_computer_pwd.cpp
A engines/tetraedge/game/puzzle_computer_pwd.h
A engines/tetraedge/game/puzzle_disjoncteur.cpp
A engines/tetraedge/game/puzzle_disjoncteur.h
A engines/tetraedge/game/puzzle_hanjie.cpp
A engines/tetraedge/game/puzzle_hanjie.h
A engines/tetraedge/game/puzzle_liquides.cpp
A engines/tetraedge/game/puzzle_liquides.h
A engines/tetraedge/game/puzzle_pentacle.cpp
A engines/tetraedge/game/puzzle_pentacle.h
A engines/tetraedge/game/puzzle_transfusion.cpp
A engines/tetraedge/game/puzzle_transfusion.h
engines/tetraedge/game/amerzone_game.cpp
engines/tetraedge/game/amerzone_game.h
engines/tetraedge/module.mk
engines/tetraedge/te/te_name_val_xml_parser.cpp
engines/tetraedge/te/te_name_val_xml_parser.h
engines/tetraedge/te/te_sound_manager.cpp
engines/tetraedge/te/te_sound_manager.h
engines/tetraedge/te/te_xml_gui.cpp
engines/tetraedge/te/te_xml_gui.h
diff --git a/engines/tetraedge/game/amerzone_game.cpp b/engines/tetraedge/game/amerzone_game.cpp
index de2187a0dc8..15483eba128 100644
--- a/engines/tetraedge/game/amerzone_game.cpp
+++ b/engines/tetraedge/game/amerzone_game.cpp
@@ -307,7 +307,7 @@ bool AmerzoneGame::onChangeWarpAnimFinished() {
}
bool AmerzoneGame::onHelpButtonValidated() {
- g_engine->getSoundManager()->playFreeSound("Sounds/SFX/Clic_prec-suiv.ogg", 1.0f, "sfx");
+ g_engine->getSoundManager()->playFreeSound("Sounds/SFX/Clic_prec-suiv.ogg");
bool active = true;
TeWarp::debug = TeWarp::debug == false;
@@ -344,7 +344,50 @@ bool AmerzoneGame::onObjectClick(const Common::String &obj) {
}
bool AmerzoneGame::onPuzzleEnterAnimLoadTime() {
- error("TODO: Implement AmerzoneGame::onPuzzleEnterAnimLoadTime");
+ TeLayout *ingame = _inGameGui.layoutChecked("inGame");
+ float zoff = ingame->zSize();
+ switch(_puzzleNo) {
+ case 0:
+ _puzzleComputerPwd.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleComputerPwd.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleComputerPwd.enter();
+ break;
+ case 1:
+ _puzzleComputerHydra.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleComputerHydra.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleComputerHydra.setTargetCoordinates(1, 4, 5);
+ _puzzleComputerHydra.enter();
+ break;
+ case 2:
+ _puzzleComputerHydra.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleComputerHydra.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleComputerHydra.setTargetCoordinates(2, 7, 2);
+ _puzzleComputerHydra.enter();
+ break;
+ case 3:
+ _puzzleHanjie.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleHanjie.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleHanjie.wakeUp();
+ break;
+ case 4:
+ _puzzlePentacle.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzlePentacle.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzlePentacle.wakeUp(_puzParam1, _puzParam2);
+ break;
+ case 5:
+ _puzzleDisjoncteur.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleDisjoncteur.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleDisjoncteur.wakeUp();
+ break;
+ case 6:
+ _puzzleLiquides.setScale(TeVector3f32(1, 1, 0.0001f));
+ _puzzleLiquides.setPosition(TeVector3f32(0, 0, zoff));
+ _puzzleLiquides.wakeUp();
+ break;
+ default:
+ break;
+ }
+ return false;
}
void AmerzoneGame::optimizeWarpResources() {
diff --git a/engines/tetraedge/game/amerzone_game.h b/engines/tetraedge/game/amerzone_game.h
index 5f24fd6f7f4..4ee7bec0360 100644
--- a/engines/tetraedge/game/amerzone_game.h
+++ b/engines/tetraedge/game/amerzone_game.h
@@ -23,6 +23,17 @@
#define TETRAEDGE_GAME_AMERZONE_GAME_H
#include "tetraedge/game/game.h"
+
+#include "tetraedge/game/puzzle_cadenas.h"
+#include "tetraedge/game/puzzle_coffre.h"
+#include "tetraedge/game/puzzle_computer_hydra.h"
+#include "tetraedge/game/puzzle_computer_pwd.h"
+#include "tetraedge/game/puzzle_disjoncteur.h"
+#include "tetraedge/game/puzzle_hanjie.h"
+#include "tetraedge/game/puzzle_liquides.h"
+#include "tetraedge/game/puzzle_pentacle.h"
+#include "tetraedge/game/puzzle_transfusion.h"
+
#include "tetraedge/te/te_timer.h"
#include "tetraedge/te/te_warp.h"
@@ -93,6 +104,16 @@ private:
TeWarp *_warpY;
TeWarp *_prevWarpY;
Common::String _lastHitObjectName;
+
+ PuzzleCadenas _puzzleCadenas;
+ PuzzleCoffre _puzzleCoffre;
+ PuzzleComputerPwd _puzzleComputerPwd;
+ PuzzleComputerHydra _puzzleComputerHydra;
+ PuzzleDisjoncteur _puzzleDisjoncteur;
+ PuzzleHanjie _puzzleHanjie;
+ PuzzleLiquides _puzzleLiquides;
+ PuzzlePentacle _puzzlePentacle;
+ PuzzleTransfusion _puzzleTransfusion;
};
} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_cadenas.cpp b/engines/tetraedge/game/puzzle_cadenas.cpp
new file mode 100644
index 00000000000..be1c185a968
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_cadenas.cpp
@@ -0,0 +1,31 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_cadenas.h"
+
+namespace Tetraedge {
+
+PuzzleCadenas::PuzzleCadenas() {
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_cadenas.h b/engines/tetraedge/game/puzzle_cadenas.h
new file mode 100644
index 00000000000..7701b45d84f
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_cadenas.h
@@ -0,0 +1,43 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_CADENAS_H
+#define TETRAEDGE_GAME_PUZZLE_CADENAS_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+// Note: this puzzle exists in the game code but seems never used?
+class PuzzleCadenas : public Te3DObject2 {
+public:
+ PuzzleCadenas();
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_CADENAS_H
diff --git a/engines/tetraedge/game/puzzle_coffre.cpp b/engines/tetraedge/game/puzzle_coffre.cpp
new file mode 100644
index 00000000000..d9333451395
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_coffre.cpp
@@ -0,0 +1,35 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_coffre.h"
+
+namespace Tetraedge {
+
+PuzzleCoffre::PuzzleCoffre() {
+}
+
+void PuzzleCoffre::wakeUp() {
+ error("TODO: Implement PuzzleCoffre::wakeUp");
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_coffre.h b/engines/tetraedge/game/puzzle_coffre.h
new file mode 100644
index 00000000000..63cb8601ed4
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_coffre.h
@@ -0,0 +1,46 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_COFFRE_H
+#define TETRAEDGE_GAME_PUZZLE_COFFRE_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+// Note: this puzzle exists in the game code but seems never used?
+
+class PuzzleCoffre : public Te3DObject2 {
+public:
+ PuzzleCoffre();
+
+ void wakeUp();
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_COFFRE_H
diff --git a/engines/tetraedge/game/puzzle_computer_hydra.cpp b/engines/tetraedge/game/puzzle_computer_hydra.cpp
new file mode 100644
index 00000000000..89dc710cb03
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_computer_hydra.cpp
@@ -0,0 +1,407 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/tetraedge.h"
+#include "tetraedge/game/puzzle_computer_hydra.h"
+#include "tetraedge/game/application.h"
+#include "tetraedge/game/amerzone_game.h"
+#include "tetraedge/game/game.h"
+#include "tetraedge/te/te_sound_manager.h"
+
+namespace Tetraedge {
+
+PuzzleComputerHydra::PuzzleComputerHydra() : _checklistStep(0), _axisNo(0) {
+ ARRAYCLEAR(_enteredCoord, 0);
+ ARRAYCLEAR(_targetCoord, 0);
+}
+
+void PuzzleComputerHydra::enter() {
+ _gui.load("GUI/PuzzleComputerHydra.lua");
+ Application *app = g_engine->getApplication();
+ app->frontLayout().addChild(_gui.layoutChecked("puzzleComputerHydra"));
+ _exitTimer.alarmSignal().add(this, &PuzzleComputerHydra::onExitTimer);
+ _exitTimer.start();
+ _transitionTimer.start();
+ initAll();
+ hideScreens();
+ enterChecklistScreen();
+}
+
+bool PuzzleComputerHydra::leave() {
+ _exitTimer.alarmSignal().clear();
+ _transitionTimer.alarmSignal().clear();
+ _gui.unload();
+ AmerzoneGame *game = dynamic_cast<AmerzoneGame *>(g_engine->getGame());
+ assert(game);
+ game->warpY()->setVisible(true, false);
+ return false;
+}
+
+void PuzzleComputerHydra::setTargetCoordinates(int x, int y, int z) {
+ _targetCoord[0] = x;
+ _targetCoord[1] = y;
+ _targetCoord[2] = z;
+}
+
+void PuzzleComputerHydra::clearChecklistScreen() {
+ _gui.layoutChecked("eggText")->setVisible(false);
+ _gui.layoutChecked("fuelText")->setVisible(false);
+ _gui.layoutChecked("capText")->setVisible(false);
+}
+
+bool PuzzleComputerHydra::enterChecklistScreen() {
+ _transitionTimer.alarmSignal().add(this, &PuzzleComputerHydra::onTransitionTimer);
+ exitCoordinatesScreen();
+ exitSelectMode();
+ _checklistStep = 0;
+ _gui.layoutChecked("checklist")->setVisible(true);
+ _gui.spriteLayoutChecked("title")->load("2D/puzzles/Computer_Hydra/CHECKLIST.png");
+ _gui.spriteLayoutChecked("infos")->setVisible(false);
+ clearChecklistScreen();
+ processCheckListScreen();
+ return true;
+}
+
+bool PuzzleComputerHydra::enterCoordinatesScreen() {
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::enterCoordinatesScreen);
+ exitChecklistScreen();
+ _axisNo = 0;
+ _enteredCoord[0] = -1;
+ _enteredCoord[1] = -1;
+ _enteredCoord[2] = -1;
+ _gui.spriteLayoutChecked("coordinates")->setVisible(true);
+ _gui.spriteLayoutChecked("titleCoordinates")->load("2D/puzzles/Computer_Hydra/ENTERDETAILS.png");
+ _gui.spriteLayoutChecked("title")->setVisible(false);
+ _gui.spriteLayoutChecked("infos")->setVisible(false);
+ _gui.spriteLayoutChecked("infosCoordinates")->setVisible(false);
+ _gui.buttonLayoutChecked("button0")->setEnable(true);
+ _gui.buttonLayoutChecked("button1")->setEnable(true);
+ _gui.buttonLayoutChecked("button2")->setEnable(true);
+ _gui.buttonLayoutChecked("button3")->setEnable(true);
+ _gui.buttonLayoutChecked("button4")->setEnable(true);
+ _gui.buttonLayoutChecked("button5")->setEnable(true);
+ _gui.buttonLayoutChecked("button6")->setEnable(true);
+ _gui.buttonLayoutChecked("button7")->setEnable(true);
+ _gui.buttonLayoutChecked("button8")->setEnable(true);
+ _gui.buttonLayoutChecked("button9")->setEnable(true);
+ _gui.buttonLayoutChecked("cancel")->setEnable(true);
+ _gui.buttonLayoutChecked("exit")->setEnable(true);
+ _gui.spriteLayoutChecked("digit1")->setVisible(false);
+ _gui.spriteLayoutChecked("digit2")->setVisible(false);
+ _gui.spriteLayoutChecked("digit3")->setVisible(false);
+ return true;
+}
+
+bool PuzzleComputerHydra::enterSelectMode() {
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::enterSelectMode);
+ exitChecklistScreen();
+ _gui.layoutChecked("modeSelect")->setVisible(true);
+ _gui.spriteLayoutChecked("title")->load("2D/puzzles/Computer_Hydra/CHOOSEMODE.png");
+ _gui.spriteLayoutChecked("infos")->setVisible(false);
+ return true;
+}
+
+bool PuzzleComputerHydra::exitChecklistScreen() {
+ _gui.layoutChecked("checklist")->setVisible(false);
+ return true;
+}
+
+bool PuzzleComputerHydra::exitCoordinatesScreen() {
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::enterChecklistScreen);
+ _gui.spriteLayoutChecked("title")->setVisible(true);
+ _gui.spriteLayoutChecked("infos")->setVisible(false);
+ _gui.buttonLayoutChecked("button0")->setEnable(false);
+ _gui.buttonLayoutChecked("button1")->setEnable(false);
+ _gui.buttonLayoutChecked("button2")->setEnable(false);
+ _gui.buttonLayoutChecked("button3")->setEnable(false);
+ _gui.buttonLayoutChecked("button4")->setEnable(false);
+ _gui.buttonLayoutChecked("button5")->setEnable(false);
+ _gui.buttonLayoutChecked("button6")->setEnable(false);
+ _gui.buttonLayoutChecked("button7")->setEnable(false);
+ _gui.buttonLayoutChecked("button8")->setEnable(false);
+ _gui.buttonLayoutChecked("button9")->setEnable(false);
+ _gui.buttonLayoutChecked("cancel")->setEnable(false);
+ _gui.buttonLayoutChecked("exit")->setEnable(false);
+ _gui.spriteLayoutChecked("digit1")->setVisible(false);
+ _gui.spriteLayoutChecked("digit2")->setVisible(false);
+ _gui.spriteLayoutChecked("digit3")->setVisible(false);
+ return true;
+}
+
+bool PuzzleComputerHydra::exitSelectMode() {
+ _gui.layoutChecked("modeSelect")->setVisible(false);
+ return true;
+}
+
+void PuzzleComputerHydra::hideScreens() {
+ _gui.layoutChecked("checklist")->setVisible(false);
+ _gui.layoutChecked("coordinates")->setVisible(false);
+ _gui.layoutChecked("modeSelect")->setVisible(false);
+
+}
+
+bool PuzzleComputerHydra::hideUnavailableModeMsg() {
+ _gui.layoutChecked("infos")->setVisible(false);
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::hideUnavailableModeMsg);
+ return true;
+}
+
+void PuzzleComputerHydra::initAll() {
+ _gui.spriteLayoutChecked("screenBase")->setVisible(true);
+ _gui.spriteLayoutChecked("title")->setVisible(true);
+ _gui.spriteLayoutChecked("infos")->setVisible(false);
+ _gui.buttonLayoutChecked("confirmDestination")->setVisible(false);
+ _gui.buttonLayoutChecked("confirmDestination")->setEnable(false);
+ _gui.buttonLayoutChecked("button0")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton0Clicked);
+ _gui.buttonLayoutChecked("button1")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton1Clicked);
+ _gui.buttonLayoutChecked("button2")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton2Clicked);
+ _gui.buttonLayoutChecked("button3")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton3Clicked);
+ _gui.buttonLayoutChecked("button4")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton4Clicked);
+ _gui.buttonLayoutChecked("button5")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton5Clicked);
+ _gui.buttonLayoutChecked("button6")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton6Clicked);
+ _gui.buttonLayoutChecked("button7")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton7Clicked);
+ _gui.buttonLayoutChecked("button8")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton8Clicked);
+ _gui.buttonLayoutChecked("button9")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButton9Clicked);
+
+ _gui.buttonLayoutChecked("cancel")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonCancelClicked);
+ _gui.buttonLayoutChecked("exit")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onExitButton);
+
+ _gui.buttonLayoutChecked("buttonBoat")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonBoatClicked);
+ _gui.buttonLayoutChecked("buttonGrapple")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonGrappleClicked);
+ _gui.buttonLayoutChecked("buttonHelicopter")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonHelicopterClicked);
+ _gui.buttonLayoutChecked("buttonSubmarine")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonSubmarineClicked);
+ _gui.buttonLayoutChecked("buttonSailboat")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonSailboatClicked);
+ _gui.buttonLayoutChecked("buttonPlane")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onButtonPlaneClicked);
+ _gui.buttonLayoutChecked("confirmDestination")->onMouseClickValidated().add(this, &PuzzleComputerHydra::onPuzzleCompleted);
+}
+
+bool PuzzleComputerHydra::processCheckListScreen() {
+ Game *game = g_engine->getGame();
+ TeSoundManager *sndMgr = g_engine->getSoundManager();
+
+ switch (_checklistStep) {
+ case 0: {
+ if (game->luaContext().global("Egg_On_Board").toBoolean()) {
+ _gui.spriteLayoutChecked("eggText")->load("2D/puzzles/Computer_Hydra/EGGOK.png");
+ _checklistStep = 1;
+ _transitionTimer.setAlarmIn(1000000);
+ sndMgr->playFreeSound("Sounds/SFX/BipOrdi.ogg");
+ } else {
+ _gui.spriteLayoutChecked("eggText")->load("2D/puzzles/Computer_Hydra/BADEGG.png");
+ _transitionTimer.setAlarmIn(2000000);
+ sndMgr->playFreeSound("Sounds/SFX/N_CodeFaux.ogg");
+ }
+ _gui.spriteLayoutChecked("eggText")->setVisible(true);
+ break;
+ }
+ case 1: {
+ if (game->luaContext().global("Fuel_Tank_Full").toBoolean()) {
+ _gui.spriteLayoutChecked("fuelText")->load("2D/puzzles/Computer_Hydra/FUELOK.png");
+ sndMgr->playFreeSound("Sounds/SFX/BipOrdi.ogg");
+ } else {
+ _gui.spriteLayoutChecked("fuelText")->load("2D/puzzles/Computer_Hydra/BADFUEL.png");
+ sndMgr->playFreeSound("Sounds/SFX/N_CodeFaux.ogg");
+ }
+ _gui.spriteLayoutChecked("fuelText")->setVisible(true);
+ _checklistStep = 3;
+ _transitionTimer.setAlarmIn(1000000);
+ break;
+ }
+ case 3: {
+ if (game->luaContext().global("Destination_Set").toBoolean()) {
+ _gui.spriteLayoutChecked("capText")->load("2D/puzzles/Computer_Hydra/CAPOK.png");
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::onTransitionTimer);
+ _transitionTimer.alarmSignal().add(this, &PuzzleComputerHydra::enterSelectMode);
+ sndMgr->playFreeSound("Sounds/SFX/BipOrdi.ogg");
+ } else {
+ _gui.spriteLayoutChecked("capText")->load("2D/puzzles/Computer_Hydra/BADCAP.png");
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::onTransitionTimer);
+ _transitionTimer.alarmSignal().add(this, &PuzzleComputerHydra::enterCoordinatesScreen);
+ sndMgr->playFreeSound("Sounds/SFX/N_CodeFaux.ogg");
+ }
+ _transitionTimer.setAlarmIn(1000000);
+ _gui.spriteLayoutChecked("capText")->setVisible(true);
+ break;
+ }
+ default:
+ break;
+ }
+ return false;
+}
+
+bool PuzzleComputerHydra::registerNewDigit(int digit) {
+ if (_axisNo >= 3)
+ return false;
+ _enteredCoord[_axisNo] = digit;
+ _axisNo++;
+ const Common::String dname = Common::String::format("digit%d", _axisNo);
+ const Common::String dimg = Common::String::format("2D/puzzles/Computer_Hydra/%d.png", digit);
+ _gui.spriteLayoutChecked(dname)->load(dimg);
+ _gui.spriteLayoutChecked(dname)->setVisible(true);
+ if (_axisNo == 3) {
+ if (_enteredCoord[0] == _targetCoord[0] && _enteredCoord[1] == _targetCoord[1]
+ && _enteredCoord[2] == _targetCoord[2]) {
+ // Correct!
+ Game *game = g_engine->getGame();
+ game->luaContext().setGlobal("Destination_Set", true);
+ _gui.spriteLayoutChecked("infosCoordinates")->load("2D/puzzles/Computer_Hydra/CAPOK.png");
+ _transitionTimer.alarmSignal().add(this, &PuzzleComputerHydra::enterChecklistScreen);
+ _transitionTimer.setAlarmIn(1000000);
+ g_engine->getSoundManager()->playFreeSound("Sounds/SFX/BipOrdi.ogg");
+ } else {
+ // Incorrect.
+ _gui.spriteLayoutChecked("infosCoordinates")->load("2D/puzzles/Computer_Hydra/BADCAP.png");
+ g_engine->getSoundManager()->playFreeSound("Sounds/SFX/N_CodeFaux.ogg");
+ }
+ _gui.spriteLayoutChecked("infosCoordinates")->setVisible(true);
+ }
+ return true;
+}
+
+bool PuzzleComputerHydra::showConfirmDestination() {
+ exitSelectMode();
+ _gui.buttonLayoutChecked("confirmDestination")->setVisible(true);
+ _gui.buttonLayoutChecked("confirmDestination")->setEnable(true);
+ _gui.spriteLayoutChecked("infos")->load("2D/puzzles/Computer_Hydra/CAPOK.png");
+ _gui.spriteLayoutChecked("infos")->setVisible(true);
+ return true;
+}
+
+bool PuzzleComputerHydra::showUnavailableModeMsg() {
+ _gui.spriteLayoutChecked("infos")->load("2D/puzzles/Computer_Hydra/NONDISPO.png");
+ _gui.spriteLayoutChecked("infos")->setVisible(true);
+ _transitionTimer.alarmSignal().remove(this, &PuzzleComputerHydra::hideUnavailableModeMsg);
+ _transitionTimer.alarmSignal().add(this, &PuzzleComputerHydra::hideUnavailableModeMsg);
+ _transitionTimer.setAlarmIn(500000);
+ return true;
+}
+
+bool PuzzleComputerHydra::onButton0Clicked() {
+ return registerNewDigit(0);
+}
+
+bool PuzzleComputerHydra::onButton1Clicked() {
+ return registerNewDigit(1);
+}
+
+bool PuzzleComputerHydra::onButton2Clicked() {
+ return registerNewDigit(2);
+}
+
+bool PuzzleComputerHydra::onButton3Clicked() {
+ return registerNewDigit(3);
+}
+
+bool PuzzleComputerHydra::onButton4Clicked() {
+ return registerNewDigit(4);
+}
+
+bool PuzzleComputerHydra::onButton5Clicked() {
+ return registerNewDigit(5);
+}
+
+bool PuzzleComputerHydra::onButton6Clicked() {
+ return registerNewDigit(6);
+}
+
+bool PuzzleComputerHydra::onButton7Clicked() {
+ return registerNewDigit(7);
+}
+
+bool PuzzleComputerHydra::onButton8Clicked() {
+ return registerNewDigit(8);
+}
+
+bool PuzzleComputerHydra::onButton9Clicked() {
+ return registerNewDigit(9);
+}
+
+bool PuzzleComputerHydra::onModeCheckButton(const Common::String &global) {
+ Game *game = g_engine->getGame();
+ TeSoundManager *sndMgr = g_engine->getSoundManager();
+ bool available = game->luaContext().global(global).toBoolean();
+ if (available) {
+ showConfirmDestination();
+ sndMgr->playFreeSound("Sounds/SFX/BipOrdi.ogg");
+ } else {
+ sndMgr->playFreeSound("Sounds/SFX/N_CodeFaux.ogg");
+ showUnavailableModeMsg();
+ }
+ return true;
+}
+
+bool PuzzleComputerHydra::onButtonBoatClicked() {
+ return onModeCheckButton("Bark_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onButtonCancelClicked() {
+ if (_axisNo <= 0)
+ return false;
+ const Common::String dname = Common::String::format("digit%d", _axisNo);
+ _gui.spriteLayoutChecked(dname)->setVisible(false);
+ _axisNo--;
+ _enteredCoord[_axisNo] = -1;
+ _gui.spriteLayoutChecked("infosCoordinates")->setVisible(false);
+ return false;
+}
+
+bool PuzzleComputerHydra::onButtonGrappleClicked() {
+ return onModeCheckButton("Grapple_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onButtonHelicopterClicked() {
+ return onModeCheckButton("Helicopter_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onButtonSubmarineClicked() {
+ return onModeCheckButton("Submarine_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onButtonSailboatClicked() {
+ return onModeCheckButton("Sailboat_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onButtonPlaneClicked() {
+ return onModeCheckButton("Plane_Mode_Available");
+}
+
+bool PuzzleComputerHydra::onExitButton() {
+ leave();
+ return true;
+}
+
+bool PuzzleComputerHydra::onExitTimer() {
+ leave();
+ return false;
+}
+
+bool PuzzleComputerHydra::onTransitionTimer() {
+ processCheckListScreen();
+ return false;
+}
+
+bool PuzzleComputerHydra::onPuzzleCompleted() {
+ leave();
+ g_engine->getGame()->luaScript().execute("OnComputerHydraPuzzleCompleted");
+ return true;
+}
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_computer_hydra.h b/engines/tetraedge/game/puzzle_computer_hydra.h
new file mode 100644
index 00000000000..589265a5cb0
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_computer_hydra.h
@@ -0,0 +1,89 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_COMPUTER_HYDRA_H
+#define TETRAEDGE_GAME_PUZZLE_COMPUTER_HYDRA_H
+
+#include "tetraedge/te/te_3d_object2.h"
+#include "tetraedge/te/te_lua_gui.h"
+#include "tetraedge/te/te_timer.h"
+
+namespace Tetraedge {
+
+class PuzzleComputerHydra : public Te3DObject2 {
+public:
+ PuzzleComputerHydra();
+
+ void enter();
+ bool leave();
+ void setTargetCoordinates(int x, int y, int z);
+
+private:
+ void clearChecklistScreen();
+ bool enterChecklistScreen();
+ bool enterCoordinatesScreen();
+ bool enterSelectMode();
+ bool exitChecklistScreen();
+ bool exitCoordinatesScreen();
+ bool exitSelectMode();
+ void hideScreens();
+ bool hideUnavailableModeMsg();
+ void initAll();
+ bool processCheckListScreen();
+ bool registerNewDigit(int digit);
+ bool showConfirmDestination();
+ bool showUnavailableModeMsg();
+
+ bool onButton0Clicked();
+ bool onButton1Clicked();
+ bool onButton2Clicked();
+ bool onButton3Clicked();
+ bool onButton4Clicked();
+ bool onButton5Clicked();
+ bool onButton6Clicked();
+ bool onButton7Clicked();
+ bool onButton8Clicked();
+ bool onButton9Clicked();
+ bool onButtonBoatClicked();
+ bool onButtonCancelClicked();
+ bool onButtonGrappleClicked();
+ bool onButtonHelicopterClicked();
+ bool onButtonSubmarineClicked();
+ bool onButtonSailboatClicked();
+ bool onButtonPlaneClicked();
+ bool onExitButton();
+ bool onExitTimer();
+ bool onPuzzleCompleted();
+ bool onTransitionTimer();
+ bool onModeCheckButton(const Common::String &global);
+
+ TeLuaGUI _gui;
+ TeTimer _exitTimer;
+ TeTimer _transitionTimer;
+ int _axisNo;
+ int _enteredCoord[3];
+ int _targetCoord[3];
+ int _checklistStep;
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_COMPUTER_HYDRA_H
diff --git a/engines/tetraedge/game/puzzle_computer_pwd.cpp b/engines/tetraedge/game/puzzle_computer_pwd.cpp
new file mode 100644
index 00000000000..28217e4590c
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_computer_pwd.cpp
@@ -0,0 +1,178 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_computer_pwd.h"
+#include "tetraedge/tetraedge.h"
+#include "tetraedge/game/application.h"
+#include "tetraedge/game/amerzone_game.h"
+
+#include "tetraedge/te/te_sound_manager.h"
+
+namespace Tetraedge {
+
+static const int CORRECT_PWD[6] = {2, 8, 0, 6, 0, 4};
+
+PuzzleComputerPwd::PuzzleComputerPwd() : _nDigits(0) {
+ ARRAYCLEAR(_enteredPwd, 0);
+}
+
+void PuzzleComputerPwd::enter() {
+ _gui.load("GUI/PuzzleComputerPwd.lua");
+ g_engine->getApplication()->frontLayout().addChild(_gui.layoutChecked("puzzleComputerPassword"));
+ _gui.spriteLayoutChecked("background")->setVisible(true);
+ _gui.buttonLayoutChecked("button0")->setEnable(true);
+ _gui.buttonLayoutChecked("button1")->setEnable(true);
+ _gui.buttonLayoutChecked("button2")->setEnable(true);
+ _gui.buttonLayoutChecked("button3")->setEnable(true);
+ _gui.buttonLayoutChecked("button4")->setEnable(true);
+ _gui.buttonLayoutChecked("button5")->setEnable(true);
+ _gui.buttonLayoutChecked("button6")->setEnable(true);
+ _gui.buttonLayoutChecked("button7")->setEnable(true);
+ _gui.buttonLayoutChecked("button8")->setEnable(true);
+ _gui.buttonLayoutChecked("button9")->setEnable(true);
+ _gui.buttonLayoutChecked("cancel")->setEnable(true);
+
+ _gui.spriteLayoutChecked("star1")->setVisible(false);
+ _gui.spriteLayoutChecked("star2")->setVisible(false);
+ _gui.spriteLayoutChecked("star3")->setVisible(false);
+ _gui.spriteLayoutChecked("star4")->setVisible(false);
+ _gui.spriteLayoutChecked("star5")->setVisible(false);
+ _gui.spriteLayoutChecked("star6")->setVisible(false);
+
+ _gui.buttonLayoutChecked("button0")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton0Clicked);
+ _gui.buttonLayoutChecked("button1")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton1Clicked);
+ _gui.buttonLayoutChecked("button2")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton2Clicked);
+ _gui.buttonLayoutChecked("button3")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton3Clicked);
+ _gui.buttonLayoutChecked("button4")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton4Clicked);
+ _gui.buttonLayoutChecked("button5")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton5Clicked);
+ _gui.buttonLayoutChecked("button6")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton6Clicked);
+ _gui.buttonLayoutChecked("button7")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton7Clicked);
+ _gui.buttonLayoutChecked("button8")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton8Clicked);
+ _gui.buttonLayoutChecked("button9")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButton9Clicked);
+ _gui.buttonLayoutChecked("cancel")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onButtonCancelClicked);
+ _gui.buttonLayoutChecked("exit")->onMouseClickValidated().add(this, &PuzzleComputerPwd::onExitButton);
+}
+
+bool PuzzleComputerPwd::leave() {
+ resetPwd();
+ _gui.unload();
+
+ AmerzoneGame *game = dynamic_cast<AmerzoneGame *>(g_engine->getGame());
+ assert(game);
+ if (game->warpY()) {
+ game->warpY()->setVisible(true, false);
+ }
+ return false;
+}
+
+bool PuzzleComputerPwd::onButton0Clicked() {
+ return registerNewDigit(0);
+}
+
+bool PuzzleComputerPwd::onButton1Clicked() {
+ return registerNewDigit(1);
+}
+
+bool PuzzleComputerPwd::onButton2Clicked() {
+ return registerNewDigit(2);
+}
+
+bool PuzzleComputerPwd::onButton3Clicked() {
+ return registerNewDigit(3);
+}
+
+bool PuzzleComputerPwd::onButton4Clicked() {
+ return registerNewDigit(4);
+}
+
+bool PuzzleComputerPwd::onButton5Clicked() {
+ return registerNewDigit(5);
+}
+
+bool PuzzleComputerPwd::onButton6Clicked() {
+ return registerNewDigit(6);
+}
+
+bool PuzzleComputerPwd::onButton7Clicked() {
+ return registerNewDigit(7);
+}
+
+bool PuzzleComputerPwd::onButton8Clicked() {
+ return registerNewDigit(8);
+}
+
+bool PuzzleComputerPwd::onButton9Clicked() {
+ return registerNewDigit(9);
+}
+
+bool PuzzleComputerPwd::onButtonCancelClicked() {
+ if (_nDigits)
+ _nDigits--;
+ const Common::String sname = Common::String::format("star%d", _nDigits + 1);
+ _gui.spriteLayoutChecked(sname)->setVisible(false);
+ return false;
+}
+
+bool PuzzleComputerPwd::onExitButton() {
+ leave();
+ return false;
+}
+
+bool PuzzleComputerPwd::registerNewDigit(int digit) {
+ if (_nDigits == 6)
+ return false;
+ _enteredPwd[_nDigits] = digit;
+ _nDigits++;
+ const Common::String sname = Common::String::format("star%d", _nDigits);
+ _gui.spriteLayoutChecked(sname)->setVisible(true);
+ if (_nDigits == 6) {
+ bool match = true;
+ for (uint i = 0; i < 6 && match; i++) {
+ match &= (CORRECT_PWD[i] == _enteredPwd[i]);
+ }
+
+ TeSoundManager *sndMgr = g_engine->getSoundManager();
+ if (match) {
+ const Common::String snd = _gui.value("goodPassword").toString();
+ sndMgr->playFreeSound(snd);
+ leave();
+ Game *game = g_engine->getGame();
+ game->luaScript().execute("OnComputerPwdPuzzleAnswered");
+ return true;
+ } else {
+ const Common::String snd = _gui.value("badPassword").toString();
+ sndMgr->playFreeSound(snd);
+ resetPwd();
+ }
+ }
+ return false;
+}
+
+void PuzzleComputerPwd::resetPwd() {
+ for (int i = 1; i < 7; i++) {
+ const Common::String sname = Common::String::format("star%d", i);
+ _gui.spriteLayoutChecked(sname)->setVisible(false);
+ }
+ _nDigits = 0;
+}
+
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_computer_pwd.h b/engines/tetraedge/game/puzzle_computer_pwd.h
new file mode 100644
index 00000000000..f932e1ae3e2
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_computer_pwd.h
@@ -0,0 +1,61 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_COMPUTER_PWD_H
+#define TETRAEDGE_GAME_PUZZLE_COMPUTER_PWD_H
+
+#include "tetraedge/te/te_3d_object2.h"
+#include "tetraedge/te/te_lua_gui.h"
+
+namespace Tetraedge {
+
+class PuzzleComputerPwd : public Te3DObject2 {
+public:
+ PuzzleComputerPwd();
+
+ void enter();
+ bool leave();
+
+private:
+ bool onButton0Clicked();
+ bool onButton1Clicked();
+ bool onButton2Clicked();
+ bool onButton3Clicked();
+ bool onButton4Clicked();
+ bool onButton5Clicked();
+ bool onButton6Clicked();
+ bool onButton7Clicked();
+ bool onButton8Clicked();
+ bool onButton9Clicked();
+ bool onButtonCancelClicked();
+ bool onExitButton();
+
+ bool registerNewDigit(int digit);
+ void resetPwd();
+
+ TeLuaGUI _gui;
+ int _nDigits;
+ int _enteredPwd[6];
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_COMPUTER_PWD_H
diff --git a/engines/tetraedge/game/puzzle_disjoncteur.cpp b/engines/tetraedge/game/puzzle_disjoncteur.cpp
new file mode 100644
index 00000000000..8d61c74a80a
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_disjoncteur.cpp
@@ -0,0 +1,35 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_disjoncteur.h"
+
+namespace Tetraedge {
+
+PuzzleDisjoncteur::PuzzleDisjoncteur() {
+}
+
+void PuzzleDisjoncteur::wakeUp() {
+ error("TODO: Implement PuzzleDisjoncteur::wakeUp");
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_disjoncteur.h b/engines/tetraedge/game/puzzle_disjoncteur.h
new file mode 100644
index 00000000000..d539631f954
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_disjoncteur.h
@@ -0,0 +1,44 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_DISJONCTEUR_H
+#define TETRAEDGE_GAME_PUZZLE_DISJONCTEUR_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+class PuzzleDisjoncteur : public Te3DObject2 {
+public:
+ PuzzleDisjoncteur();
+
+ void wakeUp();
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_DISJONCTEUR_H
diff --git a/engines/tetraedge/game/puzzle_hanjie.cpp b/engines/tetraedge/game/puzzle_hanjie.cpp
new file mode 100644
index 00000000000..4759af79beb
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_hanjie.cpp
@@ -0,0 +1,115 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_hanjie.h"
+
+#include "tetraedge/tetraedge.h"
+#include "tetraedge/game/amerzone_game.h"
+#include "tetraedge/te/te_input_mgr.h"
+
+namespace Tetraedge {
+
+static const char *BG_NAMES[] = {"Amenta", "Croix", "Echelle", "Sang", "Trident"};
+
+PuzzleHanjie::PuzzleHanjie() : _exitButton(nullptr), _entered(false), _foregroundSprite(nullptr), _backgroundNo(0) {
+ ARRAYCLEAR(_sprites);
+ ARRAYCLEAR(_expectedVals, 0);
+}
+
+void PuzzleHanjie::wakeUp() {
+ _timer.alarmSignal().add(this, &PuzzleHanjie::onWinTimer);
+ _timer.start();
+
+ TeInputMgr *inputMgr = g_engine->getInputMgr();
+ // TODO: Set callback priority value using world transform here?
+ inputMgr->_mouseLUpSignal.add(this, &PuzzleHanjie::onMouseUp);
+
+ _gui.load("Texts/PuzzleHanjie.xml");
+
+ TeButtonLayout *btn = _gui.button("blockButton");
+ btn->setVisible(true);
+ btn->setEnable(true);
+ _foregroundSprite = _gui.sprite("Foreground");
+ _exitButton = _gui.button("Exit");
+ if (_exitButton) {
+ _exitButton->onMouseClickValidated().add(this, &PuzzleHanjie::onExitButton);
+ }
+
+ for (uint i = 0; i < 7; i++) {
+ for (uint j = 0; j < 7; j++) {
+ Common::String sname = Common::String::format("Case%d-%d", i, j);
+ _sprites[i * 7 + j] = _gui.sprite(sname);
+ }
+ }
+ _backgroundNo = g_engine->getRandomNumber(4);
+ _bgImg = Common::String::format("%s%s.png", _gui.value("Background").c_str(), BG_NAMES[_backgroundNo]);
+ _bgSprite.load(_bgImg);
+ _bgSprite.setPosition(TeVector3f32(0, 0, 220));
+ _bgSprite.setVisible(true);
+
+ for (uint row = 0; row < 7; row++) {
+ const Common::String key = Common::String::format("Solution.%s%d", BG_NAMES[_backgroundNo], row);
+ const Common::String data = _gui.value(key);
+ Common::StringArray splitData = TetraedgeEngine::splitString(data, '-');
+ if (splitData.size() != 7)
+ error("Invalid puzzle data for %s: %s", key.c_str(), data.c_str());
+ for (uint col = 0; col < 7; col++) {
+ _expectedVals[row * 7 + col] = (splitData[col] == "1" ? 1 : 0);
+ }
+ }
+
+ if (_gui.group("Sounds")) {
+ const Common::String begin = _gui.value("Sounds.Begin");
+ if (!begin.empty())
+ _soundBegin = Common::String::format("Sounds/Dialogs/%s", begin.c_str());
+ }
+ _entered = true;
+}
+
+void PuzzleHanjie::sleep() {
+ TeInputMgr *inputMgr = g_engine->getInputMgr();
+ inputMgr->_mouseLUpSignal.remove(this, &PuzzleHanjie::onMouseUp);
+
+ _timer.alarmSignal().clear();
+ _gui.unload();
+ _bgSprite.setVisible(false);
+ _bgSprite.unload();
+ _entered = false;
+ AmerzoneGame *game = dynamic_cast<AmerzoneGame *>(g_engine->getGame());
+ assert(game);
+ game->warpY()->setVisible(true, false);
+}
+
+bool PuzzleHanjie::onExitButton() {
+ sleep();
+ return false;
+}
+
+bool PuzzleHanjie::onWinTimer() {
+ sleep();
+ return false;
+}
+
+bool PuzzleHanjie::onMouseUp(const Common::Point &pt) {
+ error("TODO: Implement PuzzleHanjie::onMouseUp");
+}
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_hanjie.h b/engines/tetraedge/game/puzzle_hanjie.h
new file mode 100644
index 00000000000..26c6e447789
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_hanjie.h
@@ -0,0 +1,63 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_HANJIE_H
+#define TETRAEDGE_GAME_PUZZLE_HANJIE_H
+
+#include "tetraedge/te/te_3d_object2.h"
+#include "tetraedge/te/te_timer.h"
+#include "tetraedge/te/te_xml_gui.h"
+#include "tetraedge/te/te_button_layout.h"
+#include "tetraedge/te/te_sprite_layout.h"
+
+namespace Tetraedge {
+
+class PuzzleHanjie : public Te3DObject2 {
+public:
+ PuzzleHanjie();
+
+ void wakeUp();
+ void sleep();
+
+private:
+ bool onExitButton();
+ bool onWinTimer();
+ bool onMouseUp(const Common::Point &pt);
+
+ TeTimer _timer;
+ TeXmlGui _gui;
+
+ TeButtonLayout *_exitButton;
+ TeSpriteLayout *_sprites[49];
+ TeSpriteLayout *_foregroundSprite;
+ int _backgroundNo;
+ bool _entered;
+ Common::String _bgImg;
+ Common::String _soundBegin;
+ TeSpriteLayout _bgSprite;
+ int _expectedVals[49];
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_HANJIE_H
diff --git a/engines/tetraedge/game/puzzle_liquides.cpp b/engines/tetraedge/game/puzzle_liquides.cpp
new file mode 100644
index 00000000000..463e07e87e9
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_liquides.cpp
@@ -0,0 +1,35 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_liquides.h"
+
+namespace Tetraedge {
+
+PuzzleLiquides::PuzzleLiquides() {
+}
+
+void PuzzleLiquides::wakeUp() {
+ error("TODO: Implement PuzzleLiquides::wakeUp");
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_liquides.h b/engines/tetraedge/game/puzzle_liquides.h
new file mode 100644
index 00000000000..518ddc9761a
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_liquides.h
@@ -0,0 +1,44 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_LIQUIDES_H
+#define TETRAEDGE_GAME_PUZZLE_LIQUIDES_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+class PuzzleLiquides : public Te3DObject2 {
+public:
+ PuzzleLiquides();
+
+ void wakeUp();
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_LIQUIDES_H
diff --git a/engines/tetraedge/game/puzzle_pentacle.cpp b/engines/tetraedge/game/puzzle_pentacle.cpp
new file mode 100644
index 00000000000..de76aa3db40
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_pentacle.cpp
@@ -0,0 +1,35 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_pentacle.h"
+
+namespace Tetraedge {
+
+PuzzlePentacle::PuzzlePentacle() {
+}
+
+void PuzzlePentacle::wakeUp(int param1, int param2) {
+ error("TODO: Implement PuzzlePentacle::wakeUp");
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_pentacle.h b/engines/tetraedge/game/puzzle_pentacle.h
new file mode 100644
index 00000000000..6646cdc8557
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_pentacle.h
@@ -0,0 +1,44 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_PENTACLE_H
+#define TETRAEDGE_GAME_PUZZLE_PENTACLE_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+class PuzzlePentacle : public Te3DObject2 {
+public:
+ PuzzlePentacle();
+
+ void wakeUp(int param1, int param2);
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_PENTACLE_H
diff --git a/engines/tetraedge/game/puzzle_transfusion.cpp b/engines/tetraedge/game/puzzle_transfusion.cpp
new file mode 100644
index 00000000000..8253d845da2
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_transfusion.cpp
@@ -0,0 +1,31 @@
+/* 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/>.
+ *
+ */
+
+#include "tetraedge/game/puzzle_transfusion.h"
+
+namespace Tetraedge {
+
+PuzzleTransfusion::PuzzleTransfusion() {
+}
+
+// TODO: Add more functions here.
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/puzzle_transfusion.h b/engines/tetraedge/game/puzzle_transfusion.h
new file mode 100644
index 00000000000..c10dcc5f753
--- /dev/null
+++ b/engines/tetraedge/game/puzzle_transfusion.h
@@ -0,0 +1,44 @@
+/* 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 TETRAEDGE_GAME_PUZZLE_TRANSFUSION_H
+#define TETRAEDGE_GAME_PUZZLE_TRANSFUSION_H
+
+#include "tetraedge/te/te_3d_object2.h"
+
+namespace Tetraedge {
+
+// Note: this puzzle exists in the game code but seems never used?
+
+class PuzzleTransfusion : public Te3DObject2 {
+public:
+ PuzzleTransfusion();
+
+ // TODO add public members
+
+private:
+ // TODO add private members
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_PUZZLE_TRANSFUSION_H
diff --git a/engines/tetraedge/module.mk b/engines/tetraedge/module.mk
index 28a2947c196..6fe6f25a128 100644
--- a/engines/tetraedge/module.mk
+++ b/engines/tetraedge/module.mk
@@ -40,6 +40,15 @@ MODULE_OBJS := \
game/options_menu.o \
game/owner_error_menu.o \
game/particle_xml_parser.o \
+ game/puzzle_cadenas.o \
+ game/puzzle_coffre.o \
+ game/puzzle_computer_hydra.o \
+ game/puzzle_computer_pwd.o \
+ game/puzzle_disjoncteur.o \
+ game/puzzle_hanjie.o \
+ game/puzzle_liquides.o \
+ game/puzzle_pentacle.o \
+ game/puzzle_transfusion.o \
game/question2.o \
game/scene_lights_xml_parser.o \
game/splash_screens.o \
diff --git a/engines/tetraedge/te/te_name_val_xml_parser.cpp b/engines/tetraedge/te/te_name_val_xml_parser.cpp
index 748dec4548b..e413b3653eb 100644
--- a/engines/tetraedge/te/te_name_val_xml_parser.cpp
+++ b/engines/tetraedge/te/te_name_val_xml_parser.cpp
@@ -35,8 +35,27 @@ bool TeNameValXmlParser::parserCallback_value(ParserNode *node) {
qpos = valStr.find(""");
}
- _map.setVal(node->values["name"], valStr);
+ Common::String name;
+ if (_curGroup.empty())
+ name = node->values["name"];
+ else
+ name = _curGroup + "." + node->values["name"];
+
+ _map.setVal(name, valStr);
+ return true;
+}
+
+bool TeNameValXmlParser::parserCallback_group(ParserNode *node) {
+ _curGroup = node->values["name"];
+ _groupNames.push_back(_curGroup);
return true;
}
+bool TeNameValXmlParser::closedKeyCallback(ParserNode *node) {
+ if (node->name == "group")
+ _curGroup.clear();
+ return true;
+}
+
+
} // end namespace Tetraedge
diff --git a/engines/tetraedge/te/te_name_val_xml_parser.h b/engines/tetraedge/te/te_name_val_xml_parser.h
index 5bdbe2257f7..97690b78a98 100644
--- a/engines/tetraedge/te/te_name_val_xml_parser.h
+++ b/engines/tetraedge/te/te_name_val_xml_parser.h
@@ -34,16 +34,28 @@ public:
XML_PROP(name, true)
XML_PROP(value, true)
KEY_END()
+ XML_KEY(group)
+ XML_PROP(name, true)
+ XML_KEY(value)
+ XML_PROP(name, true)
+ XML_PROP(value, true)
+ KEY_END()
+ KEY_END()
+
} PARSER_END()
// Parser callback methods
bool parserCallback_value(ParserNode *node);
+ bool parserCallback_group(ParserNode *node);
+ virtual bool closedKeyCallback(ParserNode *node) override;
public:
const Common::StringMap &getMap() const { return _map; }
private:
Common::StringMap _map;
+ Common::String _curGroup;
+ Common::Array<Common::String> _groupNames;
};
} // end namespace Tetraedge
diff --git a/engines/tetraedge/te/te_sound_manager.cpp b/engines/tetraedge/te/te_sound_manager.cpp
index 77ae632916e..335593ddf92 100644
--- a/engines/tetraedge/te/te_sound_manager.cpp
+++ b/engines/tetraedge/te/te_sound_manager.cpp
@@ -37,6 +37,10 @@ namespace Tetraedge {
TeSoundManager::TeSoundManager() {
}
+void TeSoundManager::playFreeSound(const Common::Path &path) {
+ playFreeSound(path, 1.0f, "sfx");
+}
+
void TeSoundManager::playFreeSound(const Common::Path &path, float vol, const Common::String &channel) {
TeCore *core = g_engine->getCore();
Common::FSNode sndNode = core->findFile(path);
diff --git a/engines/tetraedge/te/te_sound_manager.h b/engines/tetraedge/te/te_sound_manager.h
index 60faacd8407..bc53c7b3c00 100644
--- a/engines/tetraedge/te/te_sound_manager.h
+++ b/engines/tetraedge/te/te_sound_manager.h
@@ -34,6 +34,7 @@ class TeSoundManager {
public:
TeSoundManager();
+ void playFreeSound(const Common::Path &path);
void playFreeSound(const Common::Path &path, float vol, const Common::String &channel);
void stopFreeSound(const Common::String &channel);
diff --git a/engines/tetraedge/te/te_xml_gui.cpp b/engines/tetraedge/te/te_xml_gui.cpp
index 74a6dbc3f80..767bb7953c5 100644
--- a/engines/tetraedge/te/te_xml_gui.cpp
+++ b/engines/tetraedge/te/te_xml_gui.cpp
@@ -27,7 +27,7 @@
namespace Tetraedge {
-TeXmlGui::TeXmlGui() {
+TeXmlGui::TeXmlGui() : _loaded(false) {
}
Common::String TeXmlGui::value(const Common::String &key) {
@@ -41,9 +41,10 @@ void TeXmlGui::load(const Common::Path &path) {
TeNameValXmlParser parser;
if (!parser.loadFile(path.toString()))
- error("LocFile::load: failed to load xml.");
+ error("TeXmlGui::load: failed to load xml.");
_map = parser.getMap();
+ _loaded = true;
}
void TeXmlGui::clear() {
@@ -51,4 +52,21 @@ void TeXmlGui::clear() {
// TODO: Finish TeXmlGui.clear()
}
+void TeXmlGui::unload() {
+ clear();
+ _loaded = false;
+}
+
+TeSpriteLayout *TeXmlGui::sprite(const Common::String &name) {
+ error("TODO: Implement TeXmlGui::sprite");
+}
+
+TeButtonLayout *TeXmlGui::button(const Common::String &name) {
+ error("TODO: Implement TeXmlGui::sprite");
+}
+
+bool TeXmlGui::group(const Common::String &name) {
+ error("TODO: Implement TeXmlGui::group");
+}
+
} // end namespace Tetraedge
diff --git a/engines/tetraedge/te/te_xml_gui.h b/engines/tetraedge/te/te_xml_gui.h
index e187bab5fdc..8324270fbbf 100644
--- a/engines/tetraedge/te/te_xml_gui.h
+++ b/engines/tetraedge/te/te_xml_gui.h
@@ -25,6 +25,9 @@
#include "common/str.h"
#include "common/path.h"
+#include "tetraedge/te/te_button_layout.h"
+#include "tetraedge/te/te_sprite_layout.h"
+
namespace Tetraedge {
class TeXmlGui {
@@ -36,10 +39,15 @@ public:
void clear();
void load(const Common::Path &path);
+ void unload();
+
+ TeSpriteLayout *sprite(const Common::String &name);
+ TeButtonLayout *button(const Common::String &name);
+ bool group(const Common::String &name);
private:
Common::StringMap _map;
-
+ bool _loaded;
};
} // end namespace Tetraedge
More information about the Scummvm-git-logs
mailing list