[Scummvm-git-logs] scummvm master -> 57c96e9e72ba5ff353951c321516e19b01f08256

tag2015 noreply at scummvm.org
Sun Aug 17 20:43:53 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
57c96e9e72 AGS: Implement ags_utils plugin


Commit: 57c96e9e72ba5ff353951c321516e19b01f08256
    https://github.com/scummvm/scummvm/commit/57c96e9e72ba5ff353951c321516e19b01f08256
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2025-08-17T22:41:37+02:00

Commit Message:
AGS: Implement ags_utils plugin

Used in The Journey of Iesir (Demo)

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


diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 563bd60f232..de0a00f9444 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -355,6 +355,7 @@ MODULE_OBJS = \
 	plugins/ags_tcp_ip/ags_tcp_ip.o \
 	plugins/ags_touch/ags_touch.o \
 	plugins/ags_trans/ags_trans.o \
+	plugins/ags_utils/ags_utils.o \
 	plugins/ags_wadjet_util/ags_wadjet_util.o \
 	plugins/ags_waves/ags_waves.o \
 	plugins/ags_waves/data.o \
diff --git a/engines/ags/plugins/ags_utils/ags_utils.cpp b/engines/ags/plugins/ags_utils/ags_utils.cpp
new file mode 100644
index 00000000000..c6f500502cf
--- /dev/null
+++ b/engines/ags/plugins/ags_utils/ags_utils.cpp
@@ -0,0 +1,53 @@
+/* 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_utils/ags_utils.h"
+#include "common/system.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSUtils {
+
+const char *AGSUtils::AGS_GetPluginName() {
+	return "AGS Utils";
+}
+
+void AGSUtils::AGS_EngineStartup(IAGSEngine *engine) {
+	PluginBase::AGS_EngineStartup(engine);
+
+	SCRIPT_METHOD(DebugPrint, AGSUtils::DebugPrint);
+	SCRIPT_METHOD(GetTime, AGSUtils::GetTime);
+}
+
+void AGSUtils::DebugPrint(ScriptMethodParams &params) {
+	PARAMS1(char *, message);
+
+	_engine->PrintDebugConsole(message);
+}
+
+void AGSUtils::GetTime(ScriptMethodParams &params) {
+
+	params._result = g_system->getMillis();
+}
+
+} // namespace AGSUtils
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_utils/ags_utils.h b/engines/ags/plugins/ags_utils/ags_utils.h
new file mode 100644
index 00000000000..572039f101b
--- /dev/null
+++ b/engines/ags/plugins/ags_utils/ags_utils.h
@@ -0,0 +1,50 @@
+/* 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_UTILS_H
+#define AGS_PLUGINS_AGS_UTILS_H
+
+#include "ags/plugins/ags_plugin.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSUtils {
+
+class AGSUtils : public PluginBase {
+	SCRIPT_HASH(AGSUtils)
+
+private:
+	void DebugPrint(ScriptMethodParams &params);
+	void GetTime(ScriptMethodParams &params);
+
+public:
+	AGSUtils() : PluginBase() {}
+	virtual ~AGSUtils() {}
+
+	const char *AGS_GetPluginName() override;
+	void AGS_EngineStartup(IAGSEngine *engine) override;
+};
+
+} // namespace AGSUtils
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/plugin_base.cpp b/engines/ags/plugins/plugin_base.cpp
index e2c521a2849..9905531dbeb 100644
--- a/engines/ags/plugins/plugin_base.cpp
+++ b/engines/ags/plugins/plugin_base.cpp
@@ -51,6 +51,7 @@
 #include "ags/plugins/ags_tcp_ip/ags_tcp_ip.h"
 #include "ags/plugins/ags_touch/ags_touch.h"
 #include "ags/plugins/ags_trans/ags_trans.h"
+#include "ags/plugins/ags_utils/ags_utils.h"
 #include "ags/plugins/ags_wadjet_util/ags_wadjet_util.h"
 #include "ags/plugins/ags_waves/ags_waves.h"
 #include "ags/ags.h"
@@ -169,6 +170,9 @@ Plugins::PluginBase *pluginOpen(const char *filename) {
 	if (fname.equalsIgnoreCase("AGSTrans"))
 		return new AGSTrans::AGSTrans();
 
+	if (fname.equalsIgnoreCase("ags_utils"))
+		return new AGSUtils::AGSUtils();
+
 	if (fname.equalsIgnoreCase("AGSWadjetUtil"))
 		return new AGSWadjetUtil::AGSWadjetUtil();
 




More information about the Scummvm-git-logs mailing list