[Scummvm-git-logs] scummvm master -> 8e567446e8dd6f979b7c2b19a257d6ff4490c4f0

aquadran noreply at scummvm.org
Mon Nov 18 06:08:42 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:
8e567446e8 WINTERMUTE: Added BlackAndWhite plugin stub


Commit: 8e567446e8dd6f979b7c2b19a257d6ff4490c4f0
    https://github.com/scummvm/scummvm/commit/8e567446e8dd6f979b7c2b19a257d6ff4490c4f0
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2024-11-18T07:08:37+01:00

Commit Message:
WINTERMUTE: Added BlackAndWhite plugin stub

Changed paths:
  A engines/wintermute/ext/wme_blackandwhite.cpp
  A engines/wintermute/ext/wme_blackandwhite.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 b1b3957cf33..9d1c222ca01 100644
--- a/engines/wintermute/ext/plugins.h
+++ b/engines/wintermute/ext/plugins.h
@@ -41,6 +41,7 @@ BaseScriptable *makeSX3fStatistics(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXCommandLineHelper(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXSample(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXVlink(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXBlackAndWhite(BaseGame *inGame, ScStack *stack);
 BaseScriptable *makeSXShadowManager(BaseGame *inGame, ScStack *stack);
 
 bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, char *name) {
@@ -119,6 +120,18 @@ bool EmulatePluginCall(BaseGame *inGame, ScStack *stack, ScStack *thisStack, cha
 	}
 
 #ifdef ENABLE_WME3D
+	//////////////////////////////////////////////////////////////////////////
+	// BlackAndWhite (from wme_blackandwhite.dll of "Stroke of Fate" duology games)
+	//////////////////////////////////////////////////////////////////////////
+	else if (strcmp(name, "BlackAndWhite") == 0) {
+		thisObj = thisStack->getTop();
+
+		thisObj->setNative(makeSXBlackAndWhite(inGame, stack));
+
+		stack->pushNULL();
+		return STATUS_OK;
+	}
+
 	//////////////////////////////////////////////////////////////////////////
 	// ShadowManager (from wme_shadows.dll of "Stroke of Fate" duology games)
 	//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/ext/wme_blackandwhite.cpp b/engines/wintermute/ext/wme_blackandwhite.cpp
new file mode 100644
index 00000000000..ab2a679228b
--- /dev/null
+++ b/engines/wintermute/ext/wme_blackandwhite.cpp
@@ -0,0 +1,250 @@
+/* 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/scriptables/script_stack.h"
+#include "engines/wintermute/base/scriptables/script_value.h"
+#include "engines/wintermute/ext/wme_blackandwhite.h"
+
+namespace Wintermute {
+
+IMPLEMENT_PERSISTENT(SXBlackAndWhite, false)
+
+BaseScriptable *makeSXBlackAndWhite(BaseGame *inGame, ScStack *stack) {
+	return new SXBlackAndWhite(inGame, stack);
+}
+
+//////////////////////////////////////////////////////////////////////////
+SXBlackAndWhite::SXBlackAndWhite(BaseGame *inGame, ScStack *stack) : BaseScriptable(inGame) {
+	stack->correctParams(0);
+}
+
+//////////////////////////////////////////////////////////////////////////
+SXBlackAndWhite::~SXBlackAndWhite() {
+}
+
+//////////////////////////////////////////////////////////////////////////
+const char *SXBlackAndWhite::scToString() {
+	return "[blackandwhite object]";
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool SXBlackAndWhite::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
+	//////////////////////////////////////////////////////////////////////////
+	// Start()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "Start") == 0) {
+		stack->correctParams(0);
+
+		// nothing todo
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// Stop()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "Stop") == 0) {
+		stack->correctParams(0);
+
+		// nothing todo
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetSepia()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetSepia") == 0) {
+		stack->correctParams(0);
+
+		setSepia();
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetBlackAndWhite()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetBlackAndWhite") == 0) {
+		stack->correctParams(0);
+
+		setBlackAndWhite();
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetNormalRender()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetNormalRender") == 0) {
+		stack->correctParams(0);
+
+		setNormalRender();
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetWeightedSepia()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetWeightedSepia") == 0) {
+		stack->correctParams(0);
+
+		// nothing todo
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetWeightedBlackAndWhite()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetWeightedBlackAndWhite") == 0) {
+		stack->correctParams(0);
+
+		// nothing todo
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SetSepiaBlackAndWhite()
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "SetSepiaBlackAndWhite") == 0) {
+		stack->correctParams(0);
+
+		// nothing todo
+
+		stack->pushBool(true);
+		return STATUS_OK;
+	}
+
+
+	stack->pushNULL();
+	return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+ScValue *SXBlackAndWhite::scGetProperty(const Common::String &name) {
+	_scValue->setNULL();
+
+	//////////////////////////////////////////////////////////////////////////
+	// Weight
+	//////////////////////////////////////////////////////////////////////////
+	if (name == "Weight") {
+		// nothing todo
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// AllShadersAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "AllShadersAvailable") {
+		_scValue->setBool(false);
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// BlackAndWhiteAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "BlackAndWhiteAvailable") {
+		_scValue->setBool(true);
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SepiaAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "SepiaAvailable") {
+		_scValue->setBool(true);
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// WeightedBlackAndWhiteAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "WeightedBlackAndWhiteAvailable") {
+		_scValue->setBool(false);
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// WeightedSepiaAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "WeightedSepiaAvailable") {
+		_scValue->setBool(false);
+		return _scValue;
+	}
+
+	//////////////////////////////////////////////////////////////////////////
+	// SepiaBlackAndWhiteAvailable
+	//////////////////////////////////////////////////////////////////////////
+	else if (name == "SepiaBlackAndWhiteAvailable") {
+		_scValue->setBool(false);
+		return _scValue;
+	}
+
+	return _scValue;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXBlackAndWhite::scSetProperty(const char *name, ScValue *value) {
+	//////////////////////////////////////////////////////////////////////////
+	// Weight
+	//////////////////////////////////////////////////////////////////////////
+	if (strcmp(name, "Weight") == 0) {
+		// nothing todo
+		return STATUS_OK;
+	}
+
+	return STATUS_FAILED;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool SXBlackAndWhite::persist(BasePersistenceManager *persistMgr) {
+	BaseScriptable::persist(persistMgr);
+
+	return STATUS_OK;
+}
+
+void SXBlackAndWhite::setSepia() {
+}
+
+void SXBlackAndWhite::setBlackAndWhite() {
+}
+
+void SXBlackAndWhite::setNormalRender() {
+}
+
+} // End of namespace Wintermute
diff --git a/engines/wintermute/ext/wme_blackandwhite.h b/engines/wintermute/ext/wme_blackandwhite.h
new file mode 100644
index 00000000000..2c8c21cb6df
--- /dev/null
+++ b/engines/wintermute/ext/wme_blackandwhite.h
@@ -0,0 +1,49 @@
+/* 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_BLACKANDWHITE_H
+#define WINTERMUTE_BLACKANDWHITE_H
+
+#include "common/str.h"
+
+#include "engines/wintermute/base/base_scriptable.h"
+
+namespace Wintermute {
+
+class SXBlackAndWhite : public BaseScriptable {
+public:
+	DECLARE_PERSISTENT(SXBlackAndWhite, 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;
+	SXBlackAndWhite(BaseGame *inGame, ScStack *stack);
+	~SXBlackAndWhite() override;
+
+private:
+	void setSepia();
+	void setBlackAndWhite();
+	void setNormalRender();
+};
+
+} // End of namespace Wintermute
+
+#endif
diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk
index c664d32ac54..7f7b30bf5b6 100644
--- a/engines/wintermute/module.mk
+++ b/engines/wintermute/module.mk
@@ -196,6 +196,7 @@ MODULE_OBJS += \
 	base/gfx/opengl/shadow_volume_opengl.o \
 	base/gfx/opengl/shadow_volume_opengl_shader.o \
 	base/base_animation_transition_time.o \
+	ext/wme_blackandwhite.o \
 	ext/wme_shadowmanager.o
 endif
 
diff --git a/engines/wintermute/persistent.cpp b/engines/wintermute/persistent.cpp
index e1985a8f335..9365ded5af4 100644
--- a/engines/wintermute/persistent.cpp
+++ b/engines/wintermute/persistent.cpp
@@ -102,6 +102,7 @@
 #include "engines/wintermute/ad/ad_path_point3d.h"
 #include "engines/wintermute/ad/ad_scene_geometry.h"
 #include "engines/wintermute/base/gfx/xmodel.h"
+#include "engines/wintermute/ext/wme_blackandwhite.h"
 #include "engines/wintermute/ext/wme_shadowmanager.h"
 #endif
 
@@ -197,6 +198,7 @@ void SystemClassRegistry::register3DClasses() {
 	REGISTER_CLASS(AdPathPoint3D, false)
 	REGISTER_CLASS(AdSceneGeometry, false)
 	REGISTER_CLASS(XModel, false)
+	REGISTER_CLASS(SXBlackAndWhite, false)
 	REGISTER_CLASS(SXShadowManager, false)
 }
 #endif




More information about the Scummvm-git-logs mailing list