[Scummvm-git-logs] scummvm master -> 1fd0887f82ab6a7fa674d7d23b7843ac3b5c23c2
a-yyg
76591232+a-yyg at users.noreply.github.com
Mon Jul 19 09:59:38 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:
1fd0887f82 SAGA2: Add Debug Console
Commit: 1fd0887f82ab6a7fa674d7d23b7843ac3b5c23c2
https://github.com/scummvm/scummvm/commit/1fd0887f82ab6a7fa674d7d23b7843ac3b5c23c2
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-19T18:57:58+09:00
Commit Message:
SAGA2: Add Debug Console
Changed paths:
A engines/saga2/console.cpp
A engines/saga2/console.h
engines/saga2/module.mk
engines/saga2/saga2.cpp
engines/saga2/saga2.h
diff --git a/engines/saga2/console.cpp b/engines/saga2/console.cpp
new file mode 100644
index 0000000000..33a1a70f0c
--- /dev/null
+++ b/engines/saga2/console.cpp
@@ -0,0 +1,49 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "saga2/saga2.h"
+#include "saga2/objects.h"
+#include "saga2/player.h"
+
+#include "saga2/console.h"
+
+namespace Saga2 {
+
+Console::Console(Saga2Engine *vm) : GUI::Debugger() {
+ _vm = vm;
+
+ registerCmd("killprotag", WRAP_METHOD(Console, cmdKillProtag));
+}
+
+Console::~Console() {
+}
+
+bool Console::cmdKillProtag(int argc, const char **argv) {
+ debugPrintf("Killing protagonist\n");
+
+ Actor *protag = (Actor *)GameObject::objectAddress(ActorBaseID);
+ protag->getStats()->vitality = 0;
+
+ return true;
+}
+
+}
diff --git a/engines/saga2/console.h b/engines/saga2/console.h
new file mode 100644
index 0000000000..5bc5004498
--- /dev/null
+++ b/engines/saga2/console.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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SAGA2_CONSOLE_H
+#define SAGA2_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Saga2 {
+
+class Saga2Engine;
+
+class Console : public GUI::Debugger {
+public:
+ Console(Saga2Engine *vm);
+ ~Console() override;
+
+private:
+ Saga2Engine *_vm;
+
+ bool cmdKillProtag(int argc, const char **argv);
+
+};
+
+}
+
+#endif
diff --git a/engines/saga2/module.mk b/engines/saga2/module.mk
index 1e381ee1d8..12a04c75d7 100644
--- a/engines/saga2/module.mk
+++ b/engines/saga2/module.mk
@@ -10,6 +10,7 @@ MODULE_OBJS := \
blitters.o \
button.o \
calender.o \
+ console.o \
contain.o \
display.o \
dispnode.o \
diff --git a/engines/saga2/saga2.cpp b/engines/saga2/saga2.cpp
index 22dbe84429..d6c0c1bbd7 100644
--- a/engines/saga2/saga2.cpp
+++ b/engines/saga2/saga2.cpp
@@ -61,6 +61,7 @@ Saga2Engine::Saga2Engine(OSystem *syst)
g_vm = this;
+ _console = nullptr;
_bandList = nullptr;
_mouseInfo = nullptr;
_smkDecoder = nullptr;
@@ -126,6 +127,9 @@ Common::Error Saga2Engine::run() {
_containerList = new ContainerList;
+ _console = new Console(this);
+ setDebugger(_console);
+
readConfig();
loadExeResources();
diff --git a/engines/saga2/saga2.h b/engines/saga2/saga2.h
index 5f48b3806a..0f427fb940 100644
--- a/engines/saga2/saga2.h
+++ b/engines/saga2/saga2.h
@@ -30,6 +30,7 @@
#include "engines/engine.h"
+#include "saga2/console.h"
#include "saga2/idtypes.h"
#include "saga2/weapons.h"
#include "saga2/vdraw.h"
@@ -128,6 +129,7 @@ public:
public:
// We need random numbers
Common::RandomSource *_rnd;
+ Console *_console;
WeaponStuff _weaponRack[kMaxWeapons];
weaponID _loadedWeapons;
More information about the Scummvm-git-logs
mailing list