[Scummvm-git-logs] scummvm master -> e2320808edf576009d17771f188ec8e1287bfc66
dreammaster
dreammaster at scummvm.org
Sat Jul 24 05:07:35 UTC 2021
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:
862b7cd831 AGS: Remove plugin structures for unknown plugins during startup
e2320808ed AGS: Added AGSTouch plugin implementation
Commit: 862b7cd83150d9f1d8d785b4cb0ba719ca90f2f4
https://github.com/scummvm/scummvm/commit/862b7cd83150d9f1d8d785b4cb0ba719ca90f2f4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-23T22:07:26-07:00
Commit Message:
AGS: Remove plugin structures for unknown plugins during startup
Changed paths:
engines/ags/plugins/ags_plugin.cpp
diff --git a/engines/ags/plugins/ags_plugin.cpp b/engines/ags/plugins/ags_plugin.cpp
index 101c5512d9..d22c0f0542 100644
--- a/engines/ags/plugins/ags_plugin.cpp
+++ b/engines/ags/plugins/ags_plugin.cpp
@@ -855,6 +855,7 @@ Engine::GameInitError pl_register_plugins(const std::vector<Shared::PluginInfo>
} else {
AGS::Shared::Debug::Printf(kDbgMsg_Info, "Plugin '%s' could not be loaded (expected '%s')",
apl->filename, expect_filename.GetCStr());
+ _GP(plugins).pop_back();
continue;
}
Commit: e2320808edf576009d17771f188ec8e1287bfc66
https://github.com/scummvm/scummvm/commit/e2320808edf576009d17771f188ec8e1287bfc66
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-23T22:07:27-07:00
Commit Message:
AGS: Added AGSTouch plugin implementation
Changed paths:
A engines/ags/plugins/ags_touch/ags_touch.cpp
A engines/ags/plugins/ags_touch/ags_touch.h
engines/ags/module.mk
engines/ags/plugins/plugin_base.cpp
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 60ba8f8ca6..55c1513067 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -350,6 +350,7 @@ MODULE_OBJS = \
plugins/ags_sprite_font/variable_width_sprite_font_clifftop.o \
plugins/ags_shell/ags_shell.o \
plugins/ags_tcp_ip/ags_tcp_ip.o \
+ plugins/ags_touch/ags_touch.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_touch/ags_touch.cpp b/engines/ags/plugins/ags_touch/ags_touch.cpp
new file mode 100644
index 0000000000..e89554f124
--- /dev/null
+++ b/engines/ags/plugins/ags_touch/ags_touch.cpp
@@ -0,0 +1,56 @@
+/* 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 "common/system.h"
+#include "ags/plugins/ags_touch/ags_touch.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSTouch {
+
+const char *AGSTouch::AGS_GetPluginName() {
+ return "Touch device control";
+}
+
+void AGSTouch::AGS_EngineStartup(IAGSEngine *engine) {
+ PluginBase::AGS_EngineStartup(engine);
+
+ SCRIPT_METHOD(TouchShowKeyboard, AGSTouch::TouchShowKeyboard);
+ SCRIPT_METHOD(TouchHideKeyboard, AGSTouch::TouchHideKeyboard);
+ SCRIPT_METHOD(TouchIsKeyboardVisible, AGSTouch::TouchIsKeyboardVisible);
+}
+
+void AGSTouch::TouchShowKeyboard(ScriptMethodParams ¶ms) {
+ g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+}
+
+void AGSTouch::TouchHideKeyboard(ScriptMethodParams ¶ms) {
+ g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+}
+
+void AGSTouch::TouchIsKeyboardVisible(ScriptMethodParams ¶ms) {
+ params._result = g_system->getFeatureState(OSystem::kFeatureVirtualKeyboard);
+}
+
+} // namespace AGSTouch
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_touch/ags_touch.h b/engines/ags/plugins/ags_touch/ags_touch.h
new file mode 100644
index 0000000000..3285f0e650
--- /dev/null
+++ b/engines/ags/plugins/ags_touch/ags_touch.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 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 AGS_PLUGINS_AGS_TOUCH_AGS_TOUCH_H
+#define AGS_PLUGINS_AGS_TOUCH_AGS_TOUCH_H
+
+#include "ags/plugins/ags_plugin.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSTouch {
+
+class AGSTouch : public PluginBase {
+ SCRIPT_HASH(AGSTouch)
+public:
+ AGSTouch() : PluginBase() {}
+ virtual ~AGSTouch() {}
+
+ const char *AGS_GetPluginName() override;
+ void AGS_EngineStartup(IAGSEngine *engine) override;
+
+ void TouchShowKeyboard(ScriptMethodParams ¶ms);
+ void TouchHideKeyboard(ScriptMethodParams ¶ms);
+ void TouchIsKeyboardVisible(ScriptMethodParams ¶ms);
+};
+
+} // namespace AGSTouch
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/plugin_base.cpp b/engines/ags/plugins/plugin_base.cpp
index 58701db148..29a5bd0587 100644
--- a/engines/ags/plugins/plugin_base.cpp
+++ b/engines/ags/plugins/plugin_base.cpp
@@ -41,6 +41,7 @@
#include "ags/plugins/ags_sprite_font/ags_sprite_font.h"
#include "ags/plugins/ags_sprite_font/ags_sprite_font_clifftop.h"
#include "ags/plugins/ags_tcp_ip/ags_tcp_ip.h"
+#include "ags/plugins/ags_touch/ags_touch.h"
#include "ags/plugins/ags_wadjet_util/ags_wadjet_util.h"
#include "ags/plugins/ags_waves/ags_waves.h"
#include "ags/ags.h"
@@ -125,6 +126,9 @@ Plugins::PluginBase *pluginOpen(const char *filename) {
fname.equalsIgnoreCase("agsteam-disjoint"))
return new AGSGalaxySteam::AGSSteam();
+ if (fname.equalsIgnoreCase("AGSTouch"))
+ return new AGSTouch::AGSTouch();
+
if (fname.equalsIgnoreCase("AGSWadjetUtil"))
return new AGSWadjetUtil::AGSWadjetUtil();
More information about the Scummvm-git-logs
mailing list