[Scummvm-git-logs] scummvm master -> d9e1073671d53d7e8fb9c5f776e2a30910f594ba
aquadran
aquadran at gmail.com
Mon Aug 31 16:49:49 UTC 2020
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:
d9e1073671 WME: Added Commandline helper plugin for "Pizza Morgana: Episode 1" game (#2431)
Commit: d9e1073671d53d7e8fb9c5f776e2a30910f594ba
https://github.com/scummvm/scummvm/commit/d9e1073671d53d7e8fb9c5f776e2a30910f594ba
Author: PaweÅ KoÅodziejski (aquadran at users.sourceforge.net)
Date: 2020-08-31T18:49:44+02:00
Commit Message:
WME: Added Commandline helper plugin for "Pizza Morgana: Episode 1" game (#2431)
Changed paths:
A engines/wintermute/ext/wme_commandlinehelper.cpp
A engines/wintermute/ext/wme_commandlinehelper.h
engines/wintermute/ext/plugins.h
engines/wintermute/module.mk
engines/wintermute/persistent.cpp
diff --git a/engines/wintermute/ext/plugins.h b/engines/wintermute/ext/plugins.h
index 4c61188fbd..422abab09e 100644
--- a/engines/wintermute/ext/plugins.h
+++ b/engines/wintermute/ext/plugins.h
@@ -39,6 +39,7 @@ namespace Wintermute {
BaseScriptable *makeSXSteamAPI(BaseGame *inGame, ScStack *stack);
BaseScriptable *makeSXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack);
BaseScriptable *makeSX3fStatistics(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack);
bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
ScValue *thisObj;
@@ -79,6 +80,18 @@ bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, cha
return STATUS_OK;
}
+ //////////////////////////////////////////////////////////////////////////
+ // Commandline helper (from wme_commandlinehelper.dll)
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "CommandLineHelper") == 0) {
+ thisObj = thisStack->getTop();
+
+ thisObj->setNative(makeSXCommandLineHelper(inGame, stack));
+
+ stack->pushNULL();
+ return STATUS_OK;
+ }
+
return STATUS_FAILED;
}
diff --git a/engines/wintermute/ext/wme_commandlinehelper.cpp b/engines/wintermute/ext/wme_commandlinehelper.cpp
new file mode 100644
index 0000000000..a694081669
--- /dev/null
+++ b/engines/wintermute/ext/wme_commandlinehelper.cpp
@@ -0,0 +1,102 @@
+/* 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.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#include "engines/metaengine.h"
+#include "engines/wintermute/wintermute.h"
+#include "engines/wintermute/base/base_game.h"
+#include "engines/wintermute/base/base_engine.h"
+#include "engines/wintermute/base/scriptables/script_stack.h"
+#include "engines/wintermute/base/scriptables/script_value.h"
+#include "engines/wintermute/ext/wme_commandlinehelper.h"
+
+namespace Wintermute {
+
+IMPLEMENT_PERSISTENT(SXCommandLineHelper, false)
+
+BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack) {
+ return new SXCommandLineHelper(inGame, stack);
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+SXCommandLineHelper::SXCommandLineHelper(BaseGame *inGame, ScStack *stack) : BaseScriptable(inGame) {
+ stack->correctParams(0);
+ _gameRef->LOG(0, "new SXCommandLineHelper()");
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+SXCommandLineHelper::~SXCommandLineHelper() {
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+const char *SXCommandLineHelper::scToString() {
+ return "[commandlinehelper object]";
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXCommandLineHelper::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
+ return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+ScValue *SXCommandLineHelper::scGetProperty(const Common::String &name) {
+ _scValue->setNULL();
+
+ //////////////////////////////////////////////////////////////////////////
+ // Parameters (RO)
+ // Used to launch demo: "Pizza Morgana: Episode 1 - Monsters and Manipulations in the Magical Forest"
+ //////////////////////////////////////////////////////////////////////////
+ if (name == "Parameters") {
+ _scValue->setString("Pizza.exe DEMO");
+ return _scValue;
+ }
+
+ else {
+ return _scValue;
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXCommandLineHelper::scSetProperty(const char *name, ScValue *value) {
+ return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXCommandLineHelper::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptable::persist(persistMgr);
+
+ return STATUS_OK;
+}
+
+} // End of namespace Wintermute
diff --git a/engines/wintermute/ext/wme_commandlinehelper.h b/engines/wintermute/ext/wme_commandlinehelper.h
new file mode 100644
index 0000000000..c63448a488
--- /dev/null
+++ b/engines/wintermute/ext/wme_commandlinehelper.h
@@ -0,0 +1,52 @@
+/* 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.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#ifndef WINTERMUTE_COMMANDLINEHELPER_H
+#define WINTERMUTE_COMMANDLINEHELPER_H
+
+#include "common/str.h"
+#include "engines/wintermute/base/base_scriptable.h"
+
+namespace Wintermute {
+
+class SXCommandLineHelper : public BaseScriptable {
+public:
+ DECLARE_PERSISTENT(SXCommandLineHelper, BaseScriptable)
+ ScValue *scGetProperty(const Common::String &name) override;
+ bool scSetProperty(const char *name, ScValue *value) override;
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
+ const char *scToString() override;
+ SXCommandLineHelper(BaseGame *inGame, ScStack *stack);
+ ~SXCommandLineHelper() override;
+
+private:
+};
+
+} // End of namespace Wintermute
+
+#endif
diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk
index f273083d21..7d6045dd60 100644
--- a/engines/wintermute/module.mk
+++ b/engines/wintermute/module.mk
@@ -101,6 +101,7 @@ MODULE_OBJS := \
ext/dll_shell32.o \
ext/dll_tools.o \
ext/wme_3fstatistics.o \
+ ext/wme_commandlinehelper.o \
ext/wme_galaxy.o \
ext/wme_steam.o \
debugger/breakpoint.o \
diff --git a/engines/wintermute/persistent.cpp b/engines/wintermute/persistent.cpp
index 00e8184397..a6154ebbf6 100644
--- a/engines/wintermute/persistent.cpp
+++ b/engines/wintermute/persistent.cpp
@@ -82,6 +82,7 @@
#include "engines/wintermute/base/scriptables/script_ext_object.h"
#include "engines/wintermute/base/scriptables/script_ext_string.h"
#include "engines/wintermute/ext/wme_3fstatistics.h"
+#include "engines/wintermute/ext/wme_commandlinehelper.h"
#include "engines/wintermute/ext/wme_steam.h"
#include "engines/wintermute/ext/wme_galaxy.h"
#include "engines/wintermute/ui/ui_button.h"
@@ -163,6 +164,7 @@ void SystemClassRegistry::registerClasses() {
REGISTER_CLASS(SX3fStatistics, false)
REGISTER_CLASS(SXSteamAPI, false)
REGISTER_CLASS(SXWMEGalaxyAPI, false)
+ REGISTER_CLASS(SXCommandLineHelper, false)
REGISTER_CLASS(UIButton, false)
REGISTER_CLASS(UIEdit, false)
More information about the Scummvm-git-logs
mailing list