[Scummvm-cvs-logs] scummvm master -> 1016838bd5e556a4882f2b07e993ea9e78d12f7f

bluegr bluegr at gmail.com
Sat Dec 27 15:35:31 CET 2014


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:
1016838bd5 ZVISION: Add support for disabling animations while turning


Commit: 1016838bd5e556a4882f2b07e993ea9e78d12f7f
    https://github.com/scummvm/scummvm/commit/1016838bd5e556a4882f2b07e993ea9e78d12f7f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-12-27T16:34:27+02:00

Commit Message:
ZVISION: Add support for disabling animations while turning

Also, clean up and document game configuration options, and add a TODO
for QSound support

Changed paths:
    engines/zvision/detection.cpp
    engines/zvision/scripting/sidefx/animation_node.cpp
    engines/zvision/scripting/sidefx/distort_node.cpp
    engines/zvision/zvision.cpp



diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp
index c613278..1eaff83 100644
--- a/engines/zvision/detection.cpp
+++ b/engines/zvision/detection.cpp
@@ -55,9 +55,10 @@ static const PlainGameDescriptor zVisionGames[] = {
 
 namespace ZVision {
 
-#define GAMEOPTION_ORIGINAL_SAVELOAD        GUIO_GAMEOPTIONS1
-#define GAMEOPTION_DOUBLE_FPS               GUIO_GAMEOPTIONS2
-#define GAMEOPTION_ENABLE_VENUS             GUIO_GAMEOPTIONS3
+#define GAMEOPTION_ORIGINAL_SAVELOAD          GUIO_GAMEOPTIONS1
+#define GAMEOPTION_DOUBLE_FPS                 GUIO_GAMEOPTIONS2
+#define GAMEOPTION_ENABLE_VENUS               GUIO_GAMEOPTIONS3
+#define GAMEOPTION_DISABLE_ANIM_WHILE_TURNING GUIO_GAMEOPTIONS4
 
 static const ZVisionGameDescription gameDescriptions[] = {
 
@@ -70,7 +71,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS)
+			GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
 		},
 		GID_NEMESIS
 	},
@@ -84,7 +85,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_DEMO,
-			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS)
+			GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
 		},
 		GID_NEMESIS
 	},
@@ -98,7 +99,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO2(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
 		},
 		GID_GRANDINQUISITOR
 	},
@@ -112,7 +113,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO2(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
 		},
 		GID_GRANDINQUISITOR
 	},
@@ -126,7 +127,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_DEMO,
-			GUIO2(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
 		},
 		GID_GRANDINQUISITOR
 	},
@@ -175,6 +176,16 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 
+	{
+		GAMEOPTION_DISABLE_ANIM_WHILE_TURNING,
+		{
+			_s("Disable animation while turning"),
+			_s("Disable animation while turning in panoramic mode"),
+			"noanimwhileturning",
+			false
+		}
+	},
+
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
diff --git a/engines/zvision/scripting/sidefx/animation_node.cpp b/engines/zvision/scripting/sidefx/animation_node.cpp
index 7759758..3dd80f3 100644
--- a/engines/zvision/scripting/sidefx/animation_node.cpp
+++ b/engines/zvision/scripting/sidefx/animation_node.cpp
@@ -75,6 +75,17 @@ AnimationNode::~AnimationNode() {
 }
 
 bool AnimationNode::process(uint32 deltaTimeInMillis) {
+	ScriptManager *scriptManager = _engine->getScriptManager();
+	RenderManager *renderManager = _engine->getRenderManager();
+	RenderTable::RenderState renderState = renderManager->getRenderTable()->getRenderState();
+	bool isPanorama = (renderState == RenderTable::PANORAMA);
+	int16 velocity = _engine->getMouseVelocity() + _engine->getKeyboardVelocity();
+
+	// Do not update animation nodes in panoramic mode while turning, if the user
+	// has set this option
+	if (scriptManager->getStateValue(StateKey_NoTurnAnim) == 1 && isPanorama && velocity)
+		return false;
+
 	PlayNodes::iterator it = _playList.begin();
 	if (it != _playList.end()) {
 		playnode *nod = &(*it);
@@ -93,7 +104,7 @@ bool AnimationNode::process(uint32 deltaTimeInMillis) {
 
 				nod->_delay = _frmDelay;
 				if (nod->slot)
-					_engine->getScriptManager()->setStateValue(nod->slot, 1);
+					scriptManager->setStateValue(nod->slot, 1);
 			} else {
 				nod->_curFrame++;
 
@@ -102,7 +113,7 @@ bool AnimationNode::process(uint32 deltaTimeInMillis) {
 
 					if (nod->loop == 0) {
 						if (nod->slot >= 0)
-							_engine->getScriptManager()->setStateValue(nod->slot, 2);
+							scriptManager->setStateValue(nod->slot, 2);
 						if (nod->_scaled) {
 							nod->_scaled->free();
 							delete nod->_scaled;
@@ -121,7 +132,7 @@ bool AnimationNode::process(uint32 deltaTimeInMillis) {
 			if (frame) {
 				uint32 dstw;
 				uint32 dsth;
-				if (_engine->getRenderManager()->getRenderTable()->getRenderState() == RenderTable::PANORAMA) {
+				if (isPanorama) {
 					dstw = nod->pos.height();
 					dsth = nod->pos.width();
 				} else {
@@ -148,17 +159,17 @@ bool AnimationNode::process(uint32 deltaTimeInMillis) {
 						nod->_scaled->create(dstw, dsth, frame->format);
 					}
 
-					_engine->getRenderManager()->scaleBuffer(frame->getPixels(), nod->_scaled->getPixels(), frame->w, frame->h, frame->format.bytesPerPixel, dstw, dsth);
+					renderManager->scaleBuffer(frame->getPixels(), nod->_scaled->getPixels(), frame->w, frame->h, frame->format.bytesPerPixel, dstw, dsth);
 					frame = nod->_scaled;
 				}
 
-				if (_engine->getRenderManager()->getRenderTable()->getRenderState() == RenderTable::PANORAMA) {
+				if (isPanorama) {
 					Graphics::Surface *transposed = RenderManager::tranposeSurface(frame);
-					_engine->getRenderManager()->blitSurfaceToBkg(*transposed, nod->pos.left, nod->pos.top, _mask);
+					renderManager->blitSurfaceToBkg(*transposed, nod->pos.left, nod->pos.top, _mask);
 					transposed->free();
 					delete transposed;
 				} else {
-					_engine->getRenderManager()->blitSurfaceToBkg(*frame, nod->pos.left, nod->pos.top, _mask);
+					renderManager->blitSurfaceToBkg(*frame, nod->pos.left, nod->pos.top, _mask);
 				}
 			}
 		}
diff --git a/engines/zvision/scripting/sidefx/distort_node.cpp b/engines/zvision/scripting/sidefx/distort_node.cpp
index 0d5c8b1..7d25adc 100644
--- a/engines/zvision/scripting/sidefx/distort_node.cpp
+++ b/engines/zvision/scripting/sidefx/distort_node.cpp
@@ -65,7 +65,6 @@ DistortNode::~DistortNode() {
 }
 
 bool DistortNode::process(uint32 deltaTimeInMillis) {
-
 	float updTime = deltaTimeInMillis / (1000.0 / 60.0);
 
 	if (_incr)
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 0310355..a28ad86 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -62,22 +62,23 @@ struct zvisionIniSettings {
 	bool allowEditing;
 } settingsKeys[ZVISION_SETTINGS_KEYS_COUNT] = {
 	// Hardcoded settings
-	{"qsoundenabled", StateKey_Qsound, 1, false, false},
-	{"highquality", StateKey_HighQuality, 1, false, false},
-	{"platform", StateKey_Platform, 0, false, false},
-	{"installlevel", StateKey_InstallLevel, 0, false, false},
-	{"countrycode", StateKey_CountryCode, 0, false, false},
-	{"cpu", StateKey_CPU, 1, false, false},
-	{"moviecursor", StateKey_MovieCursor, 1, false, false},
-	{"noanimwhileturning", StateKey_NoTurnAnim, 0, false, false},
-	{"win958", StateKey_WIN958, 0, false, false},
-	{"showerrordialogs", StateKey_ShowErrorDlg, 0, false, false},
-	{"japanesefonts", StateKey_JapanFonts, 0, false, false},
-	{"brightness", StateKey_Brightness, 0, false, false},
-	{"debugcheats", StateKey_DebugCheats, 1, false, false},
+	//{"platform", StateKey_Platform, 0, false, false},	// 0 = Windows, 1 = DOS, 2 = DOS, unused
+	//{"installlevel", StateKey_InstallLevel, 0, false, false},	// 0 = full, unused
+	//{"countrycode", StateKey_CountryCode, 0, false, false},	// always 0 = US, unused
+	//{"cpu", StateKey_CPU, 1, false, false},	// always 1 = Pentium (0 is 486), unused
+	//{"win958", StateKey_WIN958, 0, false, false},	// unused, probably Windows version flag
+	//{"showerrordialogs", StateKey_ShowErrorDlg, 0, false, false},	// unused
+	//{"japanesefonts", StateKey_JapanFonts, 0, false, false},
+	//{"brightness", StateKey_Brightness, 0, false, false},
+	//{"lineskipvideo", StateKey_VideoLineSkip, 0, false, false},	// video line skip, 0 = default, 1 = always, 2 = pixel double when possible, unused
+	//{"highquality", StateKey_HighQuality, 0, false, false},	// performance related, always high
+	//{"moviecursor", StateKey_MovieCursor, 0, false, false},	// show mouse cursor in movies, unused
+	{"qsoundenabled", StateKey_Qsound, 1, false, false},	// 1 = enable QSound - TODO: not supported yet
+	{"debugcheats", StateKey_DebugCheats, 1, false, false},	// always start with the GOxxxx cheat enabled
 	// Editable settings
 	{"keyboardturnspeed", StateKey_KbdRotateSpeed, 5, false, true},
 	{"panarotatespeed", StateKey_RotateSpeed, 540, false, true},
+	{"noanimwhileturning", StateKey_NoTurnAnim, -1, false, true},	// toggle playing animations during pana rotation
 	{"venusenabled", StateKey_VenusEnable, -1, true, true},
 	{"subtitles", StateKey_Subtitles, -1, true, true},
 };
@@ -164,7 +165,7 @@ void ZVision::loadSettings() {
 		if (settingsKeys[i].defaultValue >= 0) {
 			value = (settingsKeys[i].allowEditing) ? ConfMan.getInt(settingsKeys[i].name) : settingsKeys[i].defaultValue;
 		} else {
-			boolValue = value = (settingsKeys[i].allowEditing) ? ConfMan.getBool(settingsKeys[i].name) : settingsKeys[i].defaultBoolValue;
+			boolValue = (settingsKeys[i].allowEditing) ? ConfMan.getBool(settingsKeys[i].name) : settingsKeys[i].defaultBoolValue;
 			value = (boolValue) ? 1 : 0;
 		}
 






More information about the Scummvm-git-logs mailing list