[Scummvm-git-logs] scummvm master -> 67c8bd95cbd5c1e65655baac2b63bf042d6b732e

aquadran noreply at scummvm.org
Sat Jul 2 20:43:48 UTC 2022


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:
67c8bd95cb WINTERMUTE: Restore TVideoSkipButton opcode


Commit: 67c8bd95cbd5c1e65655baac2b63bf042d6b732e
    https://github.com/scummvm/scummvm/commit/67c8bd95cbd5c1e65655baac2b63bf042d6b732e
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-07-02T22:43:44+02:00

Commit Message:
WINTERMUTE: Restore TVideoSkipButton opcode

Changed paths:
    engines/wintermute/ad/ad_game.cpp
    engines/wintermute/ad/ad_game.h
    engines/wintermute/ad/ad_types.h


diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp
index 591b4a5ee74..f87720782c5 100644
--- a/engines/wintermute/ad/ad_game.cpp
+++ b/engines/wintermute/ad/ad_game.cpp
@@ -99,6 +99,7 @@ AdGame::AdGame(const Common::String &gameId) : BaseGame(gameId) {
 	_texTalkLifeTime = 10000;
 
 	_talkSkipButton = TALK_SKIP_LEFT;
+	_videoSkipButton = VIDEO_SKIP_LEFT;
 
 	_sceneViewport = nullptr;
 
@@ -1092,16 +1093,13 @@ ScValue *AdGame::scGetProperty(const Common::String &name) {
 		return _scValue;
 	}
 
-#ifdef ENABLE_WME3D
 	//////////////////////////////////////////////////////////////////////////
 	// VideoSkipButton
 	//////////////////////////////////////////////////////////////////////////
 	else if (name == "VideoSkipButton") {
-		warning("AdGame::scGetProperty VideoSkipButton not implemented");
-		_scValue->setInt(0);
+		_scValue->setInt(_videoSkipButton);
 		return _scValue;
 	}
-#endif
 
 	//////////////////////////////////////////////////////////////////////////
 	// ChangingScene
@@ -1225,15 +1223,20 @@ bool AdGame::scSetProperty(const char *name, ScValue *value) {
 		return STATUS_OK;
 	}
 
-#ifdef ENABLE_WME3D
 	//////////////////////////////////////////////////////////////////////////
 	// VideoSkipButton
 	//////////////////////////////////////////////////////////////////////////
 	else if (strcmp(name, "VideoSkipButton") == 0) {
-		warning("AdGame::scSetProperty VideoSkipButton not implemented");
+		int val = value->getInt();
+		if (val < 0) {
+			val = 0;
+		}
+		if (val > VIDEO_SKIP_NONE) {
+			val = VIDEO_SKIP_NONE;
+		}
+		_videoSkipButton = (TVideoSkipButton)val;
 		return STATUS_OK;
 	}
-#endif
 
 	//////////////////////////////////////////////////////////////////////////
 	// StartupScene
@@ -1351,6 +1354,7 @@ TOKEN_DEF(INVENTORY_BOX)
 TOKEN_DEF(ITEMS)
 TOKEN_DEF(ITEM)
 TOKEN_DEF(TALK_SKIP_BUTTON)
+TOKEN_DEF(VIDEO_SKIP_BUTTON)
 TOKEN_DEF(SCENE_VIEWPORT)
 TOKEN_DEF(ENTITY_CONTAINER)
 TOKEN_DEF(EDITOR_PROPERTY)
@@ -1434,6 +1438,15 @@ bool AdGame::loadBuffer(char *buffer, bool complete) {
 					}
 					break;
 
+				case TOKEN_VIDEO_SKIP_BUTTON:
+					if (scumm_stricmp(params2, "right") == 0)
+						_videoSkipButton = VIDEO_SKIP_RIGHT;
+					else if (scumm_stricmp(params2, "both") == 0)
+						_videoSkipButton = VIDEO_SKIP_BOTH;
+					else
+						_videoSkipButton = VIDEO_SKIP_LEFT;
+					break;
+
 				case TOKEN_SCENE_VIEWPORT: {
 					Rect32 rc;
 					parser.scanStr(params2, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
diff --git a/engines/wintermute/ad/ad_game.h b/engines/wintermute/ad/ad_game.h
index 24e820c8f7a..3e97fd975d0 100644
--- a/engines/wintermute/ad/ad_game.h
+++ b/engines/wintermute/ad/ad_game.h
@@ -94,6 +94,7 @@ public:
 	int32 _texTalkLifeTime;
 
 	TTalkSkipButton _talkSkipButton;
+	TVideoSkipButton _videoSkipButton;
 
 #ifdef ENABLE_WME3D
 	uint32 getAmbientLightColor() override;
diff --git a/engines/wintermute/ad/ad_types.h b/engines/wintermute/ad/ad_types.h
index 45fd20912a2..7e84ad68c23 100644
--- a/engines/wintermute/ad/ad_types.h
+++ b/engines/wintermute/ad/ad_types.h
@@ -94,6 +94,14 @@ typedef enum {
 	TALK_SKIP_NONE = 3
 } TTalkSkipButton;
 
+typedef enum
+{
+	VIDEO_SKIP_LEFT = 0,
+	VIDEO_SKIP_RIGHT = 1,
+	VIDEO_SKIP_BOTH = 2,
+	VIDEO_SKIP_NONE = 3
+} TVideoSkipButton;
+
 typedef enum {
 	GEOM_WAYPOINT,
 	GEOM_WALKPLANE,




More information about the Scummvm-git-logs mailing list