[Scummvm-git-logs] scummvm master -> 0ea996a0ffdc7946cfd05a9fe12ea99d04618132

dreammaster dreammaster at scummvm.org
Sun Feb 11 05:20:19 CET 2018


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:
678c320feb XEEN: Fix Clouds cutscene background decoder
0ea996a0ff BLADERUNNER: Fix compilation in Visual Studio


Commit: 678c320feba1390b7971b08fd8a92ece90cc00b0
    https://github.com/scummvm/scummvm/commit/678c320feba1390b7971b08fd8a92ece90cc00b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-10T23:19:21-05:00

Commit Message:
XEEN: Fix Clouds cutscene background decoder

Changed paths:
    engines/xeen/worldofxeen/clouds_cutscenes.cpp


diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
index 56ffe96..aa2fb14 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
@@ -992,6 +992,7 @@ void CloudsCutscenes::loadScreen(const Common::String &name) {
 
 	for (int byteIdx = 0; byteIdx < count; ) {
 		assert(fSrc.pos() < fSrc.size());
+
 		int vMin = array2[(ARRAY_SIZE - 1) * 2];
 		int vThreshold = ARRAY_SIZE * 4 - 2;
 		while (vMin < vThreshold) {
@@ -1045,34 +1046,33 @@ void CloudsCutscenes::loadScreen(const Common::String &name) {
 			}
 		}
 
-		for (int offset = array4[627 + vMin / 2]; offset; offset = array4[offset / 2]) {
-			uint *arrP = &array3[offset / 2];
-			uint threshold = ++arrP[0];
-			if (threshold <= arrP[1])
-				continue;
-
-			uint *currP = arrP + 2;
-			while (threshold > *currP)
-				++currP;
-			--currP;
-
-			*arrP = *currP;
-			*currP = threshold;
-			int offset4 = array2[offset / 2];
-			int newIndex = currP - array3;
-			array4[offset4 / 2] = newIndex * 2;
-			if (offset4 < (ARRAY_SIZE * 4 - 2))
-				array4[offset4 / 2 + 1] = newIndex * 2;
-
-			int newIndex2 = array2[newIndex] / 2;
-			array2[newIndex] = offset4;
-			array4[newIndex2] = offset;
-			if ((newIndex2 * 2) <= (ARRAY_SIZE * 4 - 2))
-				array4[newIndex2 + 1] = offset;
-
-			array2[offset / 2] = newIndex2 * 2;
-			offset = newIndex * 2;
-		}
+		int offset = array4[627 + vMin / 2] / 2;
+		do {
+			int offset2 = offset;
+			uint val = ++array3[offset2];
+			if (val > array3[offset2 + 1]) {
+				while (val > array3[++offset2])
+					;
+				--offset2;
+
+				array3[offset] = array3[offset2];
+				array3[offset2] = val;
+
+				int offset3 = array2[offset] / 2;
+				array4[offset3] = offset2 * 2;
+				if ((offset3 * 2) < (ARRAY_SIZE * 4 - 2))
+					array4[offset3 + 1] = offset2 * 2;
+
+				int offset4 = array2[offset2] / 2;
+				array2[offset2] = offset3 * 2;
+				array4[offset4] = offset * 2;
+				if ((offset4 * 2) < (ARRAY_SIZE * 4 - 2))
+					array4[offset4 + 1] = offset * 2;
+
+				array2[offset] = offset4 * 2;
+				offset = offset2;
+			}
+		} while ((offset = array4[offset] / 2) != 0);
 
 		vMin /= 2;
 		if (vMin < 256) {
@@ -1122,16 +1122,16 @@ void CloudsCutscenes::loadScreen(const Common::String &name) {
 		}
 
 		t2Val |= (bitsHigh & 0x3F);
-		int buffOffset = array2[ARRAY_LAST2] - t2Val - 1;
+		uint &last2 = array2[ARRAY_LAST2];
+		int buffOffset = last2 - t2Val - 1;
 
 		for (int ctr = 0; ctr < vMin - 253; ++ctr, ++buffOffset) {
 			buffOffset &= 0xfff;
 			byte b = buffer[buffOffset];
 			*destP++ = b;
 
-			uint &buffOffset2 = array2[ARRAY_LAST2];
-			buffer[buffOffset2] = b;
-			buffOffset2 = (buffOffset2 + 1) & 0xfff;
+			buffer[last2] = b;
+			last2 = (last2 + 1) & 0xfff;
 			++byteIdx;
 		}
 	}


Commit: 0ea996a0ffdc7946cfd05a9fe12ea99d04618132
    https://github.com/scummvm/scummvm/commit/0ea996a0ffdc7946cfd05a9fe12ea99d04618132
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-10T23:20:18-05:00

Commit Message:
BLADERUNNER: Fix compilation in Visual Studio

Changed paths:
    engines/bladerunner/ui/vk.cpp


diff --git a/engines/bladerunner/ui/vk.cpp b/engines/bladerunner/ui/vk.cpp
index fab58e9..078b60a 100644
--- a/engines/bladerunner/ui/vk.cpp
+++ b/engines/bladerunner/ui/vk.cpp
@@ -664,7 +664,7 @@ void VK::drawNeedle(Graphics::Surface &surface) {
 		x = CLIP(x + (int)_vm->_rnd.getRandomNumberRng(0, 4) - 2, 165, 245);
 	}
 
-	float needleOffset = abs(38.0f - _needleValue);
+	float needleOffset = ABS(38.0f - _needleValue);
 	float y = 345 - sqrt(72.0f * 72.0f - needleOffset * needleOffset);
 
 	float colorIntensity = MIN(78.0f, _needleValue + 39.0f) / 78.0f;
@@ -846,7 +846,7 @@ void VK::animateAdjustment(int target) {
 
 void VK::setAdjustment(int x) {
 	_adjustment = CLIP(x - 4, 154, 246);
-	float offset = abs(199.0f - _adjustment);
+	float offset = ABS(199.0f - _adjustment);
 	int y = sqrt(88.0f * 88.0f - offset * offset);
 	_buttons->setImageLeft(1, _adjustment);
 	_buttons->setImageTop(1, 345 - y);





More information about the Scummvm-git-logs mailing list