[Scummvm-git-logs] scummvm master -> 97262c9d9dc3e12c6faf2758f75216474dad84f2

yuv422 yuv422 at users.noreply.github.com
Tue Aug 18 13:08:11 UTC 2020


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:
831111c7b9 DRAGONS: Add support for selecting dialog using mouse scroll wheel.
97262c9d9d DRAGONS: Mark US and UK versions as ready for public testing


Commit: 831111c7b91b4737504d1b1b9f927cb2dd3c48bd
    https://github.com/scummvm/scummvm/commit/831111c7b91b4737504d1b1b9f927cb2dd3c48bd
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-08-18T23:06:54+10:00

Commit Message:
DRAGONS: Add support for selecting dialog using mouse scroll wheel.

Changed paths:
    engines/dragons/dragons.cpp
    engines/dragons/dragons.h
    engines/dragons/talk.cpp


diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index d6774e9167..23552264fa 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -111,6 +111,7 @@ DragonsEngine::DragonsEngine(OSystem *syst, const ADGameDescription *desc) : Eng
 	_dKeyDown = false;
 	_oKeyDown = false;
 	_pKeyDown = false;
+	_mouseWheel = MOUSE_WHEEL_NO_EVENT;
 
 	_debugMode = false;
 	_isGamePaused = false;
@@ -137,6 +138,7 @@ void DragonsEngine::updateEvents() {
 	_enterKeyUp = false;
 	_leftKeyUp = false;
 	_rightKeyUp = false;
+	_mouseWheel = MOUSE_WHEEL_NO_EVENT;
 	while (_eventMan->pollEvent(event)) {
 //		_input->processEvent(event);
 		switch (event.type) {
@@ -156,6 +158,12 @@ void DragonsEngine::updateEvents() {
 		case Common::EVENT_RBUTTONUP:
 			_rightMouseButtonUp = true;
 			break;
+		case Common::EVENT_WHEELDOWN:
+			_mouseWheel = MOUSE_WHEEL_DOWN;
+			break;
+		case Common::EVENT_WHEELUP:
+			_mouseWheel = MOUSE_WHEEL_UP;
+			break;
 		case Common::EVENT_KEYUP:
 			if (event.kbd.keycode == Common::KEYCODE_i) {
 				_iKeyUp = true;
@@ -1620,7 +1628,7 @@ void DragonsEngine::mainMenu() {
 				_fontManager->addAsciiText((i == 0 ? 17 : 16) * 8, (0x12 + i) * 8, &menuItems[i][0],
 										   strlen(menuItems[i]), i == curMenuItem ? 0 : 1);
 			}
-			if (checkForDownKeyRelease()) {
+			if (checkForDownKeyRelease() || checkForWheelDown()) {
 				if (curMenuItem < 2) {
 					curMenuItem++;
 				} else {
@@ -1629,7 +1637,7 @@ void DragonsEngine::mainMenu() {
 				playOrStopSound(0x8009);
 			}
 
-			if (checkForUpKeyRelease()) {
+			if (checkForUpKeyRelease() || checkForWheelUp()) {
 				if (curMenuItem > 0) {
 					curMenuItem--;
 				} else {
@@ -1769,6 +1777,14 @@ bool DragonsEngine::validateAVFile(const char *filename) {
 	return fileValid;
 }
 
+bool DragonsEngine::checkForWheelUp() {
+	return _mouseWheel == MOUSE_WHEEL_UP;
+}
+
+bool DragonsEngine::checkForWheelDown() {
+	return _mouseWheel == MOUSE_WHEEL_DOWN;
+}
+
 void (*DragonsEngine::getSceneUpdateFunction())() {
 	return _sceneUpdateFunction;
 }
diff --git a/engines/dragons/dragons.h b/engines/dragons/dragons.h
index 4c1fadad0c..cceb8ffa9c 100644
--- a/engines/dragons/dragons.h
+++ b/engines/dragons/dragons.h
@@ -94,6 +94,12 @@ enum UnkFlags {
 	ENGINE_UNK1_FLAG_80 = 0x80
 };
 
+enum MouseWheel {
+	MOUSE_WHEEL_NO_EVENT,
+	MOUSE_WHEEL_DOWN,
+	MOUSE_WHEEL_UP
+};
+
 struct PaletteCyclingInstruction {
 	int16 paletteType;
 	int16 startOffset;
@@ -214,6 +220,7 @@ private:
 	bool _dKeyDown;
 	bool _oKeyDown;
 	bool _pKeyDown;
+	MouseWheel _mouseWheel;
 
 	bool _debugMode;
 	bool _isGamePaused;
@@ -304,6 +311,8 @@ public:
 	bool checkForActionButtonRelease();
 	bool checkForDownKeyRelease();
 	bool checkForUpKeyRelease();
+	bool checkForWheelUp();
+	bool checkForWheelDown();
 
 	bool isDebugMode();
 
diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index 37ee6ba296..70ed61f52b 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -654,13 +654,13 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 	uint16 x;
 	uint uVar6;
 	uint uVar7;
-	uint16 uVar8;
+	uint16 selectedTextLine;
 	TalkDialogEntry *talkDialogEntry;
 	//uint16 local_390[5];
 	uint16 local_386 [195];
 	uint16 asStack512 [200];
 	uint16 numEntries;
-	uint16 local_60;
+	uint16 totalNumEntries;
 	uint16 local_58;
 	int16 local_50;
 	uint16 *local_40;
@@ -672,8 +672,8 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 
 	_vm->_fontManager->clearText();
 
-	uVar8 = 0;
-	local_60 = 0;
+	selectedTextLine = 0;
+	totalNumEntries = 0;
 	local_58 = 0;
 	numEntries = dialogEntries.size();
 	if (numEntries != 0) {
@@ -681,7 +681,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 		do {
 			talkDialogEntry =  dialogEntries[uVar3];
 			if ((talkDialogEntry->flags & 1) == 0) {
-				local_60 = local_60 + 1;
+				totalNumEntries = totalNumEntries + 1;
 				talkDialogEntry->yPosMaybe = '\0';
 				//strcpy((char *)&local_390, (char *)talkDialogEntry->dialogText);
 				UTF16ToUTF16Z(local_386, (uint16 *)(&talkDialogEntry->dialogText[10]));
@@ -695,18 +695,19 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 				local_58 = local_58 + sVar2;
 				talkDialogEntry->yPosMaybe = talkDialogEntry->yPosMaybe + (char)sVar2;
 			}
-			uVar8 = uVar8 + 1;
-			uVar3 = (uint)uVar8;
-		} while (uVar8 < numEntries);
+			selectedTextLine = selectedTextLine + 1;
+			uVar3 = (uint)selectedTextLine;
+		} while (selectedTextLine < numEntries);
 	}
 	drawDialogBox(1, (0x17 - (uint) local_58) & 0xffff, 0x26, 0x18, 1);
-	uVar8 = 0;
+	selectedTextLine = 0;
 	_vm->_cursor->updateSequenceID(3);
 	local_50 = -2;
 	local_38 = (uint)numEntries;
 	_dat_800633f8_talkDialogFlag = 1;
 	hasDialogEntries = (numEntries != 0);
 	local_40 = asStack512;
+
 	LAB_800317a4:
 //		CheckIfCdShellIsOpen();
 	_vm->waitForFrames(1);
@@ -716,7 +717,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 		uVar3 = 0;
 		do {
 			talkDialogEntry = dialogEntries[uVar3];
-			if (((talkDialogEntry->flags & 1) == 0) && (bVar1 = y == uVar8, y = y + 1, bVar1)) break;
+			if (((talkDialogEntry->flags & 1) == 0) && (bVar1 = y == selectedTextLine, y = y + 1, bVar1)) break;
 			x = x + 1;
 			uVar3 = (uint)x;
 		} while (x < numEntries);
@@ -741,93 +742,89 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 					talkDialogEntry = dialogEntries[uVar3];
 					y = y + 1;
 					if ((talkDialogEntry->flags & 1) == 0) {
-						if (uVar8 == 0) {
+						if (selectedTextLine == 0) {
 							_dat_800633f8_talkDialogFlag = 0;
 							return talkDialogEntry;
 						}
-						uVar8--;
+						selectedTextLine--;
 					}
 					uVar3 = (uint)y;
 				} while (y < numEntries);
 			}
 		}
-		if ((uVar8 == 0) || !_vm->checkForUpKeyRelease()) goto LAB_80031970;
-		uVar8--;
-		goto LAB_800319a0;
+		if ((selectedTextLine < totalNumEntries - 1) &&
+			(_vm->checkForDownKeyRelease() || _vm->checkForWheelDown())) {
+			selectedTextLine++;
+			_vm->playOrStopSound(0x8009);
+		} else if (selectedTextLine > 0 && (_vm->checkForUpKeyRelease() || _vm->checkForWheelUp())) {
+			selectedTextLine--;
+			_vm->playOrStopSound(0x8009);
+		}
 	}
-	goto LAB_800319a8;
-	LAB_80031970:
-	if (((int)(uint)uVar8 < (int)((uint)local_60 - 1)) &&
-		_vm->checkForDownKeyRelease()) {
-		uVar8 = uVar8 + 1;
-		LAB_800319a0:
-		_vm->playOrStopSound(0x8009);
-		LAB_800319a8:
-		y = 0x18 - local_58;
-		local_50 = -1;
-		uVar3 = 0;
-		if (hasDialogEntries) {
-			uVar6 = 0;
-			do {
-				talkDialogEntry = dialogEntries[uVar6];
-				uVar6 = (uint)talkDialogEntry->flags & 1;
-				if ((talkDialogEntry->flags & 1) == 0) {
-					sVar2 = local_50 + 1;
-					local_50 = sVar2;
-					UTF16ToUTF16Z(local_386, (uint16 *)(&talkDialogEntry->dialogText[10]));
-					_dat_80083104 = local_386;
-					if (local_386[0] == 0x20) {
-						_dat_80083104 = &local_386[1];
-					}
-					uVar4 = findLastPositionOf5cChar(_dat_80083104);
-					uVar4 = truncateDialogText(_dat_80083104, local_40, uVar4 & 0xffff, 0x20);
-					_dat_80083104 = local_40;
-					if (sVar2 == uVar8) {
-						uVar7 = 0;
-						if (uVar6 < (uVar4 & 0xffff)) {
-							do {
-								x = 5;
-								if ((uVar7 & 0xffff) == 0) {
-									x = 4;
-								}
-								//TODO ProbablyShowUTF16Msg(_dat_80083104, x, y, 0, -1);
-								_vm->_fontManager->addText(x * 8, y * 8, _dat_80083104, wideStrLen(_dat_80083104), 0);
-								sVar2 = *_dat_80083104;
-								while (sVar2 != 0) {
-									sVar2 = _dat_80083104[1];
-									_dat_80083104 = _dat_80083104 + 1;
-								}
-								uVar7 = uVar7 + 1;
+	y = 0x18 - local_58;
+	local_50 = -1;
+	uVar3 = 0;
+	if (hasDialogEntries) {
+		uVar6 = 0;
+		do {
+			talkDialogEntry = dialogEntries[uVar6];
+			uVar6 = (uint)talkDialogEntry->flags & 1;
+			if ((talkDialogEntry->flags & 1) == 0) {
+				sVar2 = local_50 + 1;
+				local_50 = sVar2;
+				UTF16ToUTF16Z(local_386, (uint16 *)(&talkDialogEntry->dialogText[10]));
+				_dat_80083104 = local_386;
+				if (local_386[0] == 0x20) {
+					_dat_80083104 = &local_386[1];
+				}
+				uVar4 = findLastPositionOf5cChar(_dat_80083104);
+				uVar4 = truncateDialogText(_dat_80083104, local_40, uVar4 & 0xffff, 0x20);
+				_dat_80083104 = local_40;
+				if (sVar2 == selectedTextLine) {
+					uVar7 = 0;
+					if (uVar6 < (uVar4 & 0xffff)) {
+						do {
+							x = 5;
+							if ((uVar7 & 0xffff) == 0) {
+								x = 4;
+							}
+							//TODO ProbablyShowUTF16Msg(_dat_80083104, x, y, 0, -1);
+							_vm->_fontManager->addText(x * 8, y * 8, _dat_80083104, wideStrLen(_dat_80083104), 0);
+							sVar2 = *_dat_80083104;
+							while (sVar2 != 0) {
+								sVar2 = _dat_80083104[1];
 								_dat_80083104 = _dat_80083104 + 1;
-								y = y + 1;
-							} while ((uVar7 & 0xffff) < (uVar4 & 0xffff));
-						}
-					} else {
-						uVar7 = 0;
-						if (uVar6 < (uVar4 & 0xffff)) {
-							do {
-								x = 5;
-								if ((uVar7 & 0xffff) == 0) {
-									x = 4;
-								}
-								//TODO ProbablyShowUTF16Msg2(_dat_80083104, x, (uint)y, 0x401, 0xffffffff);
-								_vm->_fontManager->addText(x * 8, y * 8, _dat_80083104, wideStrLen(_dat_80083104), 1);
-								sVar2 = *_dat_80083104;
-								while (sVar2 != 0) {
-									sVar2 = _dat_80083104[1];
-									_dat_80083104 = _dat_80083104 + 1;
-								}
-								uVar7 = uVar7 + 1;
+							}
+							uVar7 = uVar7 + 1;
+							_dat_80083104 = _dat_80083104 + 1;
+							y = y + 1;
+						} while ((uVar7 & 0xffff) < (uVar4 & 0xffff));
+					}
+				} else {
+					uVar7 = 0;
+					if (uVar6 < (uVar4 & 0xffff)) {
+						do {
+							x = 5;
+							if ((uVar7 & 0xffff) == 0) {
+								x = 4;
+							}
+							//TODO ProbablyShowUTF16Msg2(_dat_80083104, x, (uint)y, 0x401, 0xffffffff);
+							_vm->_fontManager->addText(x * 8, y * 8, _dat_80083104, wideStrLen(_dat_80083104), 1);
+							sVar2 = *_dat_80083104;
+							while (sVar2 != 0) {
+								sVar2 = _dat_80083104[1];
 								_dat_80083104 = _dat_80083104 + 1;
-								y = y + 1;
-							} while ((uVar7 & 0xffff) < (uVar4 & 0xffff));
-						}
+							}
+							uVar7 = uVar7 + 1;
+							_dat_80083104 = _dat_80083104 + 1;
+							y = y + 1;
+						} while ((uVar7 & 0xffff) < (uVar4 & 0xffff));
 					}
 				}
-				uVar3 = uVar3 + 1;
-				uVar6 = uVar3 & 0xffff;
-			} while ((uVar3 & 0xffff) < local_38);
-		}
+			}
+			uVar3 = uVar3 + 1;
+			uVar6 = uVar3 & 0xffff;
+		} while ((uVar3 & 0xffff) < local_38);
 	}
 	goto LAB_800317a4;
 }


Commit: 97262c9d9dc3e12c6faf2758f75216474dad84f2
    https://github.com/scummvm/scummvm/commit/97262c9d9dc3e12c6faf2758f75216474dad84f2
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-08-18T23:06:54+10:00

Commit Message:
DRAGONS: Mark US and UK versions as ready for public testing

Changed paths:
    engines/dragons/detection.cpp


diff --git a/engines/dragons/detection.cpp b/engines/dragons/detection.cpp
index ed2ccee21b..92878a96de 100644
--- a/engines/dragons/detection.cpp
+++ b/engines/dragons/detection.cpp
@@ -42,7 +42,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 					AD_ENTRY1s("bigfile.dat", "02c26712bee57266f28235fdc0207725", 44990464),
 					Common::EN_USA,
 					Common::kPlatformPSX,
-					ADGF_DROPPLATFORM,
+					ADGF_DROPPLATFORM | ADGF_TESTING,
 					GUIO0()
 			},
 			kGameIdDragons
@@ -54,7 +54,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 					AD_ENTRY1s("bigfile.dat", "02c26712bee57266f28235fdc0207725", 44992512),
 					Common::EN_GRB,
 					Common::kPlatformPSX,
-					ADGF_DROPPLATFORM,
+					ADGF_DROPPLATFORM | ADGF_TESTING,
 					GUIO0()
 			},
 			kGameIdDragons
@@ -66,7 +66,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 					AD_ENTRY1s("bigfile.dat", "9854fed0d2b48522a62973e99b52a0be", 45099008),
 					Common::DE_DEU,
 					Common::kPlatformPSX,
-					ADGF_DROPPLATFORM,
+					ADGF_DROPPLATFORM | ADGF_UNSTABLE,
 					GUIO0()
 			},
 			kGameIdDragons
@@ -78,7 +78,7 @@ static const DragonsGameDescription gameDescriptions[] = {
 					AD_ENTRY1s("bigfile.dat", "9854fed0d2b48522a62973e99b52a0be", 45107200),
 					Common::FR_FRA,
 					Common::kPlatformPSX,
-					ADGF_DROPPLATFORM,
+					ADGF_DROPPLATFORM | ADGF_UNSTABLE,
 					GUIO0()
 			},
 			kGameIdDragons




More information about the Scummvm-git-logs mailing list