[Scummvm-git-logs] scummvm master -> 5741a5c63a047c678197dcb4724e714906b256e2

yuv422 noreply at scummvm.org
Sun Dec 8 04:25:27 UTC 2024


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:
55be4a339e DARKSEED: Fix some animations. Refresh console when answering phone.
5741a5c63a DARKSEED: Fix left / right clipping to game window


Commit: 55be4a339efebb9f080222dc7eb72b3b2c3101ff
    https://github.com/scummvm/scummvm/commit/55be4a339efebb9f080222dc7eb72b3b2c3101ff
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-12-08T15:24:18+11:00

Commit Message:
DARKSEED: Fix some animations. Refresh console when answering phone.

Changed paths:
    engines/darkseed/animation.cpp
    engines/darkseed/darkseed.cpp


diff --git a/engines/darkseed/animation.cpp b/engines/darkseed/animation.cpp
index b1734553e66..168b54e9255 100644
--- a/engines/darkseed/animation.cpp
+++ b/engines/darkseed/animation.cpp
@@ -160,7 +160,7 @@ void Animation::updateAnimation() {
 	case 1: // sleep wake anim
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			_player->_position.x = 0xdf;
 			_player->_position.y = 0xbe;
@@ -172,7 +172,7 @@ void Animation::updateAnimation() {
 	case 2: // shower
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			_player->_position.x = 218;
 			_player->_position.y = 198;
@@ -255,9 +255,9 @@ void Animation::updateAnimation() {
 		}
 		if (!_objRestarted) {
 			if (currentRoomNumber == 6) {
-				_player->_frameIdx = _player->_animations.getAnimAt(1)._frameNo[_player->_animations.getAnimAt(1)._frameNo[_animIndexTbl[1]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(1)._frameNo[_animIndexTbl[1]];
 			} else {
-				_player->_frameIdx = _player->_animations.getAnimAt(2)._frameNo[_player->_animations.getAnimAt(2)._frameNo[_animIndexTbl[2]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(2)._frameNo[_animIndexTbl[2]];
 			}
 		} else {
 			if (currentRoomNumber == 6) {
@@ -277,7 +277,7 @@ void Animation::updateAnimation() {
 				g_engine->playSound(4, 5, -1);
 			}
 			if (!_objRestarted) {
-				_player->_frameIdx = _player->_animations.getAnimAt(3)._frameNo[_player->_animations.getAnimAt(3)._frameNo[_animIndexTbl[3]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(3)._frameNo[_animIndexTbl[3]];
 			} else {
 				g_engine->_previousRoomNumber = 5;
 				g_engine->changeToRoom(6);
@@ -289,7 +289,7 @@ void Animation::updateAnimation() {
 				g_engine->playSound(4, 5, -1);
 			}
 			if (!_objRestarted) {
-				_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 			}
 		}
 		break;
@@ -305,9 +305,9 @@ void Animation::updateAnimation() {
 		}
 		if (!_objRestarted) {
 			if (_otherNspAnimationType_maybe == 8) {
-				_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 			} else {
-				_player->_frameIdx = _player->_animations.getAnimAt(2)._frameNo[_player->_animations.getAnimAt(2)._frameNo[_animIndexTbl[2]]];
+				_player->_frameIdx = _player->_animations.getAnimAt(2)._frameNo[_animIndexTbl[2]];
 			}
 		} else {
 			if (_otherNspAnimationType_maybe == 63) {
@@ -333,7 +333,7 @@ void Animation::updateAnimation() {
 	case 64:
 		advanceAnimationFrame(1);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(1)._frameNo[_player->_animations.getAnimAt(1)._frameNo[_animIndexTbl[1]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(1)._frameNo[_animIndexTbl[1]];
 		} else {
 			_player->_position.x = 300;
 			_player->_position.y = 183;
@@ -358,10 +358,10 @@ void Animation::updateAnimation() {
 			}
 		}
 		break;
-	case 12:
+	case 12: // rt ladder climb up
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			_player->_position.x = 360;
 			_player->_position.y = 238;
@@ -387,7 +387,7 @@ void Animation::updateAnimation() {
 	case 16: // climb down rope
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			_player->_position.x = 336;
 			_player->_position.y = 195;
@@ -415,7 +415,7 @@ void Animation::updateAnimation() {
 	case 18: // push trunk
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		}
 		if (_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]] == 3 && _frameAdvanced) {
 			g_engine->_console->printTosText(_objectVar[22] + 662);
@@ -449,10 +449,10 @@ void Animation::updateAnimation() {
 			g_engine->_console->printTosText(468);
 		}
 		break;
-	case 10:
+	case 10: // climb ladder left
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			g_engine->_previousRoomNumber = g_engine->_room->_roomNumber;
 			g_engine->changeToRoom(61);
@@ -510,10 +510,10 @@ void Animation::updateAnimation() {
 			g_engine->changeToRoom(13);
 		}
 		break;
-	case 27:
+	case 27: // enter mirror from normal world
 		advanceAnimationFrame(0);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]]; // TODO check if this is correct.
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else {
 			g_engine->_previousRoomNumber = g_engine->_room->_roomNumber;
 			g_engine->changeToRoom(38);
@@ -658,13 +658,13 @@ void Animation::updateAnimation() {
 	case 43:
 	case 44:
 	case 45:
-	case 46: {
+	case 46: { // pull lever
 		int iVar4 = 0;
 		if ((_otherNspAnimationType_maybe == 44) || (_otherNspAnimationType_maybe == 46)) {
 			iVar4 = 1;
 		}
 		advanceAnimationFrame(iVar4);
-		_player->_frameIdx = _player->_animations.getAnimAt(iVar4)._frameNo[_player->_animations.getAnimAt(iVar4)._frameNo[_animIndexTbl[iVar4]]];
+		_player->_frameIdx = _player->_animations.getAnimAt(iVar4)._frameNo[_animIndexTbl[iVar4]];
 		//		_HeroSpr = (uint) * (byte *)((int)&DAT_1060_7eb8 + *(int *)((int)&_ObjFrame + iVar4 * 2) + iVar4 * 202);
 		if (_frameAdvanced && _animIndexTbl[iVar4] == 3) { // TODO should we add this conditionally? This logic was missing from the original game. I assume they just forgot to add the sfx.
 			g_engine->playSound(8, 5, -1); // pull lever sound.
@@ -754,7 +754,7 @@ void Animation::updateAnimation() {
 	case 58:
 		advanceAnimationFrame((_otherNspAnimationType_maybe - 57) & 1);
 		if (!_objRestarted) {
-			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]]; //_player->_animations.getAnimAt(0).frameNo[animIndexTbl[0]]];
+			_player->_frameIdx = _player->_animations.getAnimAt(0)._frameNo[_animIndexTbl[0]];
 		} else if (_otherNspAnimationType_maybe == 57) {
 			g_engine->_previousRoomNumber = g_engine->_room->_roomNumber;
 			g_engine->changeToRoom(g_engine->_room->_roomNumber == 41 ? 44 : 41);
diff --git a/engines/darkseed/darkseed.cpp b/engines/darkseed/darkseed.cpp
index 7d9984efc68..8f11fc7664b 100644
--- a/engines/darkseed/darkseed.cpp
+++ b/engines/darkseed/darkseed.cpp
@@ -2654,6 +2654,7 @@ void DarkseedEngine::newGame() {
 
 void DarkseedEngine::waitForSpeech() {
 	while (_sound && _sound->isPlayingSpeech()) {
+		_console->draw();
 		updateEvents();
 		if (_room) {
 			_room->update();
@@ -2665,6 +2666,7 @@ void DarkseedEngine::waitForSpeech() {
 
 void DarkseedEngine::waitForSpeechOrSfx() {
 	while (_sound && (_sound->isPlayingSpeech() || _sound->isPlayingSfx())) {
+		_console->draw();
 		updateEvents();
 		if (_room) {
 			_room->update();


Commit: 5741a5c63a047c678197dcb4724e714906b256e2
    https://github.com/scummvm/scummvm/commit/5741a5c63a047c678197dcb4724e714906b256e2
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-12-08T15:24:18+11:00

Commit Message:
DARKSEED: Fix left / right clipping to game window

Changed paths:
    engines/darkseed/nsp.cpp


diff --git a/engines/darkseed/nsp.cpp b/engines/darkseed/nsp.cpp
index f7dc5b59252..e15f9f71a66 100644
--- a/engines/darkseed/nsp.cpp
+++ b/engines/darkseed/nsp.cpp
@@ -61,8 +61,8 @@ void Sprite::clipToScreen(int x, int y, uint16 frameBottom, uint16 *clippedWidth
 	if (x + _width > g_engine->_screen->w) {
 		*clippedWidth = g_engine->_screen->w - x;
 	}
-	if (x + _width > 569) {
-		*clippedWidth = 569 - x;
+	if (x + _width > 570) {
+		*clippedWidth = 570 - x;
 	}
 	if (frameBottom != 0 && y + _height > g_engine->_frameBottom) {
 		if (y >= frameBottom) {
@@ -137,7 +137,7 @@ void Sprite::drawScaled(int destX, int destY, int destWidth, int destHeight, boo
 		int xi = flipX ? xs : xs * clipX;
 		const byte *wsrc = hsrc + ((xi + 0x8000) >> 16);
 		for (int xc = 0; xc < destWidth; ++xc) {
-			if (currX > 69 && currX < destSurface->w) { // clip to game window. TODO pass clip rect into method.
+			if (currX > 69 && currX < 570 && currX < destSurface->w) { // clip to game window. TODO pass clip rect into method.
 				byte colorIndex = *wsrc;
 				//				uint16 c = READ_LE_UINT16(&palette[colorIndex * 2]);
 				if (colorIndex != 0xf) {




More information about the Scummvm-git-logs mailing list