[Scummvm-git-logs] scummvm master -> 2886132f9a5e9120cb642d06fbf6520304d6ce86

aquadran noreply at scummvm.org
Mon Oct 28 19:31:01 UTC 2024


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:
2886132f9a WINTERMUTE: Implemented stub for wme_link plugin used for play bink videos


Commit: 2886132f9a5e9120cb642d06fbf6520304d6ce86
    https://github.com/scummvm/scummvm/commit/2886132f9a5e9120cb642d06fbf6520304d6ce86
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2024-10-28T20:30:57+01:00

Commit Message:
WINTERMUTE: Implemented stub for wme_link plugin used for play bink videos

Changed paths:
  A engines/wintermute/ext/wme_vlink.cpp
  A engines/wintermute/ext/wme_vlink.h
    engines/wintermute/ext/plugins.h
    engines/wintermute/module.mk


diff --git a/engines/wintermute/ext/plugins.h b/engines/wintermute/ext/plugins.h
index 6780f88563c..86fe1fb7469 100644
--- a/engines/wintermute/ext/plugins.h
+++ b/engines/wintermute/ext/plugins.h
@@ -40,6 +40,7 @@ BaseScriptable *makeSXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSX3fStatistics(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXSample(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXVlink(BaseGame *inGame, ScStack *stack);
 
 bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
 	ScValue *thisObj;
@@ -104,6 +105,19 @@ bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, cha
 		return STATUS_OK;
 	}
 
+	//////////////////////////////////////////////////////////////////////////
+	// BinkVideo player (from wme_vlink.dll of "Sunrise" game)
+	//////////////////////////////////////////////////////////////////////////
+	else if (strcmp(name, "BinkVideo") == 0) {
+		thisObj = thisStack->getTop();
+
+		thisObj->setNative(makeSXVlink(inGame, stack));
+
+		stack->pushNULL();
+		return STATUS_OK;
+	}
+
+
 	return STATUS_FAILED;
 }
 
diff --git a/engines/wintermute/ext/wme_vlink.cpp b/engines/wintermute/ext/wme_vlink.cpp
new file mode 100644
index 00000000000..7fa68d8ccde
--- /dev/null
+++ b/engines/wintermute/ext/wme_vlink.cpp
@@ -0,0 +1,107 @@
+/* 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
+ * (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 "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/gfx/base_renderer.h"
+#include "engines/wintermute/base/scriptables/script_stack.h"
+#include "engines/wintermute/base/scriptables/script_value.h"
+#include "engines/wintermute/ext/wme_vlink.h"
+
+namespace Wintermute {
+
+IMPLEMENT_PERSISTENT(SXVlink, false)
+
+BaseScriptable *makeSXVlink(BaseGame *inGame, ScStack *stack) {
+	return new SXVlink(inGame, stack);
+}
+
+//////////////////////////////////////////////////////////////////////////
+SXVlink::SXVlink(BaseGame *inGame, ScStack *stack) : BaseScriptable(inGame) {
+	stack->correctParams(1);
+	uint32 handle = (uint32)stack->pop()->getInt();
+	if (handle != 'D3DH') {
+		warning("SXVlink() Invalid D3D handle");
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////
+SXVlink::~SXVlink() {
+}
+
+//////////////////////////////////////////////////////////////////////////
+const char *SXVlink::scToString() {
+	return "[binkvideo object]";
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool SXVlink::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
+	//////////////////////////////////////////////////////////////////////////
+	// Play(string path)
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "Play") == 0) {
+		stack->correctParams(1);
+		const char *path = stack->pop()->getString();
+
+		warning("SXVlink::Play(%s) missing implementation", path);
+
+		stack->pushNULL();
+		return STATUS_OK;
+	}
+	//////////////////////////////////////////////////////////////////////////
+	// SetVolume(int level)
+	//////////////////////////////////////////////////////////////////////////
+	else if (strcmp(name, "SetVolume") == 0) {
+		stack->correctParams(1);
+		int level = stack->pop()->getInt();
+
+		warning("SXVlink::SetVolume(%d) missing implementation", level);
+
+		stack->pushNULL();
+		return STATUS_OK;
+	}
+
+	return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+ScValue *SXVlink::scGetProperty(const Common::String &name) {
+	_scValue->setNULL();
+	return _scValue;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXVlink::scSetProperty(const char *name, ScValue *value) {
+	return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXVlink::persist(BasePersistenceManager *persistMgr) {
+	BaseScriptable::persist(persistMgr);
+	return STATUS_OK;
+}
+
+} // End of namespace Wintermute
diff --git a/engines/wintermute/ext/wme_vlink.h b/engines/wintermute/ext/wme_vlink.h
new file mode 100644
index 00000000000..469df39e7cd
--- /dev/null
+++ b/engines/wintermute/ext/wme_vlink.h
@@ -0,0 +1,43 @@
+/* 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
+ * (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 WINTERMUTE_VLINK_H
+#define WINTERMUTE_VLINK_H
+
+#include "common/str.h"
+#include "engines/wintermute/base/base_scriptable.h"
+
+namespace Wintermute {
+
+class SXVlink : public BaseScriptable {
+public:
+	DECLARE_PERSISTENT(SXVlink, 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;
+	SXVlink(BaseGame *inGame, ScStack *stack);
+	~SXVlink() override;
+};
+
+} // End of namespace Wintermute
+
+#endif
diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk
index 28bc8fded9d..7bde9e2ae52 100644
--- a/engines/wintermute/module.mk
+++ b/engines/wintermute/module.mk
@@ -106,6 +106,7 @@ MODULE_OBJS := \
 	ext/wme_galaxy.o \
 	ext/wme_steam.o \
 	ext/wme_windowmode.o \
+	ext/wme_vlink.o \
 	debugger/breakpoint.o \
 	debugger/debugger_controller.o \
 	debugger/error.o \




More information about the Scummvm-git-logs mailing list