[Scummvm-git-logs] scummvm master -> b70519b3c7358b02652f960a42503f209db0a9a9

sev- noreply at scummvm.org
Sun Aug 6 12:30:43 UTC 2023


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:
b70519b3c7  AGS: Preliminary implementation of ags_consoles plugin


Commit: b70519b3c7358b02652f960a42503f209db0a9a9
    https://github.com/scummvm/scummvm/commit/b70519b3c7358b02652f960a42503f209db0a9a9
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-08-06T14:30:40+02:00

Commit Message:
 AGS: Preliminary implementation of ags_consoles plugin

Changed paths:
  A engines/ags/plugins/ags_consoles/ags_consoles.cpp
  A engines/ags/plugins/ags_consoles/ags_consoles.h
    engines/ags/module.mk
    engines/ags/plugins/plugin_base.cpp


diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 109aa9d3d5b..96089975d39 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -321,6 +321,7 @@ MODULE_OBJS = \
 	plugins/ags_blend/ags_blend.o \
 	plugins/ags_clipboard/ags_clipboard.o \
 	plugins/ags_collision_detector/ags_collision_detector.o \
+	plugins/ags_consoles/ags_consoles.o \
 	plugins/ags_controller/ags_controller.o \
 	plugins/ags_creditz/ags_creditz.o \
 	plugins/ags_creditz/ags_creditz1.o \
diff --git a/engines/ags/plugins/ags_consoles/ags_consoles.cpp b/engines/ags/plugins/ags_consoles/ags_consoles.cpp
new file mode 100644
index 00000000000..c46b6ee0970
--- /dev/null
+++ b/engines/ags/plugins/ags_consoles/ags_consoles.cpp
@@ -0,0 +1,120 @@
+/* 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
+ * 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 "ags/plugins/ags_consoles/ags_consoles.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSConsoles {
+
+const char *AGSConsoles::AGS_GetPluginName() {
+	return "AGS Consoles";
+}
+
+void AGSConsoles::AGS_EngineStartup(IAGSEngine *engine) {
+	PluginBase::AGS_EngineStartup(engine);
+
+	SCRIPT_METHOD(IsPS4, AGSConsoles::IsPS4);
+	SCRIPT_METHOD(IsPS5, AGSConsoles::IsPS5);
+	SCRIPT_METHOD(IsSwitch, AGSConsoles::IsSwitch);
+	SCRIPT_METHOD(IsPSVita, AGSConsoles::IsPSVita);
+	SCRIPT_METHOD(IsXboxOne, AGSConsoles::IsXboxOne);
+	SCRIPT_METHOD(IsSeriesX, AGSConsoles::IsSeriesX);
+	SCRIPT_METHOD(SendStat, AGSConsoles::SendStat);
+	SCRIPT_METHOD(SetAchievement, AGSConsoles::SetAchievement);
+	SCRIPT_METHOD(RequestAccountPicker, AGSConsoles::RequestAccountPicker);
+	SCRIPT_METHOD(LogMessage, AGSConsoles::LogMessage);
+	SCRIPT_METHOD(GetGamertag, AGSConsoles::GetGamertag);
+	SCRIPT_METHOD(StartStory, AGSConsoles::StartStory);
+	SCRIPT_METHOD(ShowKeyboard, AGSConsoles::ShowKeyboard);
+	SCRIPT_METHOD(ShouldOpenActivity, AGSConsoles::ShouldOpenActivity);
+}
+
+void AGSConsoles::IsPS4(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsPS4 STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::IsPS5(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsPS5 STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::IsSwitch(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsSwitch STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::IsPSVita(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsPSVita STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::IsXboxOne(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsXboxOne STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::IsSeriesX(ScriptMethodParams &params) {
+	warning("AGSConsoles::IsSeriesX STUB: returning false");
+	params._result = false;
+}
+
+void AGSConsoles::SendStat(ScriptMethodParams &params) {
+	warning("AGSConsoles::SendStat STUB");
+}
+
+void AGSConsoles::SetAchievement(ScriptMethodParams &params) {
+	warning("AGSConsoles::SetAchievement STUB");
+}
+
+void AGSConsoles::RequestAccountPicker(ScriptMethodParams &params) {
+	warning("AGSConsoles::RequestAccountPicker STUB");
+}
+
+void AGSConsoles::LogMessage(ScriptMethodParams &params) {
+	PARAMS1(char *, msg);
+
+	char buf[1024];
+	snprintf(buf, sizeof(buf), "AGSConsoles: %s", msg);
+	_engine->PrintDebugConsole(buf);
+}
+
+void AGSConsoles::GetGamertag(ScriptMethodParams &params) {
+	warning("AGSConsoles::GetGamertag STUB: using \"ScummVM\"");
+	params._result = _engine->CreateScriptString("ScummVM");
+}
+
+void AGSConsoles::StartStory(ScriptMethodParams &params) {
+	warning("AGSConsoles::StartStory STUB");
+}
+
+void AGSConsoles::ShowKeyboard(ScriptMethodParams &params) {
+	warning("AGSConsoles::ShowKeyboard STUB");
+}
+
+void AGSConsoles::ShouldOpenActivity(ScriptMethodParams &params) {
+	warning("AGSConsoles::ShouldOpenActivity STUB");
+}
+
+} // namespace AGSConsoles
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_consoles/ags_consoles.h b/engines/ags/plugins/ags_consoles/ags_consoles.h
new file mode 100644
index 00000000000..b30e63a787c
--- /dev/null
+++ b/engines/ags/plugins/ags_consoles/ags_consoles.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
+ * 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 AGS_PLUGINS_AGS_CONSOLES_H
+#define AGS_PLUGINS_AGS_CONSOLES_H
+
+#include "ags/plugins/ags_plugin.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSConsoles {
+
+class AGSConsoles : public PluginBase {
+	SCRIPT_HASH(AGSConsoles)
+
+private:
+	void IsPS4(ScriptMethodParams &params);
+	void IsPS5(ScriptMethodParams &params);
+	void IsSwitch(ScriptMethodParams &params);
+	void IsPSVita(ScriptMethodParams &params);
+	void IsXboxOne(ScriptMethodParams &params);
+	void IsSeriesX(ScriptMethodParams &params);
+	void SendStat(ScriptMethodParams &params);
+	void SetAchievement(ScriptMethodParams &params);
+	void RequestAccountPicker(ScriptMethodParams &params);
+	void LogMessage(ScriptMethodParams &params);
+	void GetGamertag(ScriptMethodParams &params);
+	void StartStory(ScriptMethodParams &params);
+	void ShowKeyboard(ScriptMethodParams &params);
+	void ShouldOpenActivity(ScriptMethodParams &params);
+
+public:
+	AGSConsoles() : PluginBase() {}
+	virtual ~AGSConsoles() {}
+
+	const char *AGS_GetPluginName() override;
+	void AGS_EngineStartup(IAGSEngine *engine) override;
+
+};
+
+} // namespace AGSConsoles
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/plugin_base.cpp b/engines/ags/plugins/plugin_base.cpp
index 9c37ea92323..bb76a36aaf0 100644
--- a/engines/ags/plugins/plugin_base.cpp
+++ b/engines/ags/plugins/plugin_base.cpp
@@ -26,6 +26,7 @@
 #include "ags/plugins/ags_blend/ags_blend.h"
 #include "ags/plugins/ags_clipboard/ags_clipboard.h"
 #include "ags/plugins/ags_collision_detector/ags_collision_detector.h"
+#include "ags/plugins/ags_consoles/ags_consoles.h"
 #include "ags/plugins/ags_controller/ags_controller.h"
 #include "ags/plugins/ags_creditz/ags_creditz1.h"
 #include "ags/plugins/ags_creditz/ags_creditz2.h"
@@ -83,6 +84,9 @@ Plugins::PluginBase *pluginOpen(const char *filename) {
 	if (fname.equalsIgnoreCase("AGSClipboard"))
 		return new AGSClipboard::AGSClipboard();
 
+	if (fname.equalsIgnoreCase("AGSConsoles"))
+		return new AGSConsoles::AGSConsoles();
+
 	if (fname.equalsIgnoreCase("AGSController"))
 		return new AGSController::AGSController();
 




More information about the Scummvm-git-logs mailing list