[Scummvm-git-logs] scummvm master -> 0060d8dca4ba6e77d3ff14bd6fe20b779a472797

athrxx athrxx at scummvm.org
Sat May 1 22:10:14 UTC 2021


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:
3eef43cd06 KYRA: (EOB) - fix spell anim speed
0060d8dca4 KYRA: (EOB/FM-Towns) - fix regression


Commit: 3eef43cd062dbb5acafcfbcb989f5048cdc6f6c3
    https://github.com/scummvm/scummvm/commit/3eef43cd062dbb5acafcfbcb989f5048cdc6f6c3
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-02T00:08:17+02:00

Commit Message:
KYRA: (EOB) - fix spell anim speed

The explosion and cone of cold pixel "animations" have somehow become extremely slow. At least in MSVC debug mode. No idea whether this is a regression from recent OSystem or backend graphics updates. I now set these pixel updates on a strict timer based schedule. If the machine/backend/whatever is too slow it will just get less screen updates...dfdsfsf

Changed paths:
    engines/kyra/graphics/screen_eob.cpp


diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp
index 6758e733c2..ddcaec5381 100644
--- a/engines/kyra/graphics/screen_eob.cpp
+++ b/engines/kyra/graphics/screen_eob.cpp
@@ -1115,6 +1115,8 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 	if (numElements > 150)
 		numElements = 150;
 
+	uint32 incPerElement = (18 << 8) / numElements;
+
 	for (int i = 0; i < numElements; i++) {
 		ptr2[i] = ptr3[i] = 0;
 		ptr4[i] = _vm->_rnd.getRandomNumberRng(0, radius) - (radius >> 1);
@@ -1140,9 +1142,10 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 		}
 
 		l = 0;
+		uint32 timer = 0;
+		uint32 start = _system->getMillis();
 
 		for (int i = 0; i < numElements; i++) {
-			uint32 end = _system->getMillis() + 1;
 			if (ptr4[i] <= 0)
 				ptr4[i]++;
 			else
@@ -1168,17 +1171,20 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 				ptr6[i] = getPagePixel(0, px, py);
 			}
 
+			timer += incPerElement ;
+
 			assert((ptr8[i] >> 8) < colorTableSize);
 			int pxVal2 = colorTable[ptr8[i] >> 8];
 			if (pxVal2) {
 				l = 1;
 				if (pxVal1 == _gfxCol && posWithinRect(px, py, rX1, rY1, rX2, rY2)) {
 					setPagePixel(0, px, py, pxVal2);
-					if (i % 5 == 0)  {
+					uint32 cur = _system->getMillis();
+					if (cur < start + (timer >> 8))  {
 						updateScreen();
-						uint32 cur = _system->getMillis();
-						if (end > cur)
-							_system->delayMillis(end - cur);
+						cur = _system->getMillis();
+						if (cur < start + (timer >> 8))
+							_system->delayMillis(start + (timer >> 8) - cur);
 					}
 				}
 			} else {
@@ -1187,6 +1193,7 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 		}
 	}
 
+	updateScreen();
 	showMouse();
 }
 
@@ -1210,6 +1217,10 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 	int cy = 48;
 	radius <<= 6;
 
+	uint32 incPerElement = (12 << 8) / numElements;
+	uint32 timer = 0;
+	uint32 start = _system->getMillis();
+
 	for (int i = 0; i < numElements; i++) {
 		int16 v38 = _vm->_rnd.getRandomNumberRng(radius >> 2, radius);
 		int16 stepSum = 0;
@@ -1274,7 +1285,6 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 
 		i = 0;
 		int r = (stepSize >> 1) + (stepSize >> 2) + (stepSize >> 3);
-		uint32 nextDelay = _system->getMillis() + 1;
 
 		for (int ii = 0; ii < numElements; ii++) {
 			if (pixDelay[ii] == 0) {
@@ -1306,16 +1316,18 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 			uint8 tblIndex = CLIP(colTableIndex[ii] >> 8, 0, colorTableSize - 1);
 			uint8 tc2 = colorTable[tblIndex];
 
+			timer += incPerElement;
+
 			if (tc2) {
 				i = 1;
 				if (tc1 == _gfxCol && !pixDelay[ii]) {
 					setPagePixel(0, px, py, tc2);
-					if (ii % 15 == 0)  {
+					uint32 cur = _system->getMillis();
+					if (cur < start + (timer >> 8)) {
 						updateScreen();
-						uint32 cur = _system->getMillis();
-						if (nextDelay > cur)
-							_system->delayMillis(nextDelay - cur);
-						nextDelay += 1;
+						cur = _system->getMillis();
+						if (cur < start + (timer >> 8))
+							_system->delayMillis(start + (timer >> 8) - cur);
 					}
 				}
 			} else {
@@ -1326,6 +1338,7 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 	}
 
 	_curPage = cp;
+	updateScreen();
 	showMouse();
 }
 


Commit: 0060d8dca4ba6e77d3ff14bd6fe20b779a472797
    https://github.com/scummvm/scummvm/commit/0060d8dca4ba6e77d3ff14bd6fe20b779a472797
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-02T00:08:17+02:00

Commit Message:
KYRA: (EOB/FM-Towns) - fix regression

("Unknown key" error)

Changed paths:
    engines/kyra/graphics/screen_eob_towns.cpp


diff --git a/engines/kyra/graphics/screen_eob_towns.cpp b/engines/kyra/graphics/screen_eob_towns.cpp
index e5f6686f74..ce2bbe19e8 100644
--- a/engines/kyra/graphics/screen_eob_towns.cpp
+++ b/engines/kyra/graphics/screen_eob_towns.cpp
@@ -133,11 +133,10 @@ void SJISFont12x12::unload() {
 }
 
 void SJISFont12x12::drawChar(uint16 c, byte *dst, int pitch, int) const {
-	int offs = _searchTable[c];
-	if (!offs)
+	if (!_searchTable.contains(c))
 		return;
 
-	const uint8 *src = _data + (offs - 1) * 24;
+	const uint8 *src = _data + (_searchTable[c] - 1) * 24;
 	uint8 color1 = _colorMap[1];
 
 	int bt = 0;




More information about the Scummvm-git-logs mailing list