[Scummvm-git-logs] scummvm master -> 3eff3ce763690ebc7902b3c88320180caea60bb5

yuv422 noreply at scummvm.org
Sun Nov 17 11:12:50 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:
52f3580c68 DARKSEED: Add circle wipe effect at start of day.
3eff3ce763 DARKSEED: Fix going to bed animation


Commit: 52f3580c68a292e63f5e79514cde181c83aafe89
    https://github.com/scummvm/scummvm/commit/52f3580c68a292e63f5e79514cde181c83aafe89
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-11-17T22:10:32+11:00

Commit Message:
DARKSEED: Add circle wipe effect at start of day.

Changed paths:
    engines/darkseed/cutscene.cpp
    engines/darkseed/darkseed.cpp
    engines/darkseed/darkseed.h


diff --git a/engines/darkseed/cutscene.cpp b/engines/darkseed/cutscene.cpp
index f93ed641e55..e51500e08e6 100644
--- a/engines/darkseed/cutscene.cpp
+++ b/engines/darkseed/cutscene.cpp
@@ -74,6 +74,8 @@ void Cutscene::update() {
 	}
 
 	if (_movieStep == 9999) {
+		g_engine->_sound->stopMusic();
+
 		if (_cutsceneId == 'E') {
 			g_engine->_previousRoomNumber = 38;
 			g_engine->changeToRoom(7);
@@ -87,10 +89,27 @@ void Cutscene::update() {
 			g_engine->newGame();
 		} else if (_cutsceneId == 'Y') {
 			play('I');
-		} else if (_cutsceneId == 'B' || _cutsceneId == 'C' || _cutsceneId == 'D' || _cutsceneId == 'G') {
-			g_engine->_cursor.showCursor(true); // TODO fade in here
+		} else if (_cutsceneId == 'B' || _cutsceneId == 'C') {
+			g_engine->_room->restorePalette();
+			g_engine->_frame.draw();
+			g_engine->doCircles();
+
+			if (g_engine->_currentDay == 2) {
+				g_engine->_console->printTosText(12);
+			} else if (g_engine->_currentDay == 3) {
+				g_engine->_console->printTosText(14);
+			}
+			g_engine->_console->draw();
+			g_engine->_screen->update();
+
+			g_engine->waitForSpeech();
+			g_engine->_systemTimerCounter = 4;
+			g_engine->_cursor.showCursor(true);
+			g_engine->_room->loadRoomMusic();
+		} else if (_cutsceneId == 'D' || _cutsceneId == 'G') {
 			g_engine->_room->restorePalette();
 			g_engine->_frame.draw();
+			g_engine->_cursor.showCursor(true);
 		}
 	}
 }
diff --git a/engines/darkseed/darkseed.cpp b/engines/darkseed/darkseed.cpp
index cd3309c26f9..4e8ac609294 100644
--- a/engines/darkseed/darkseed.cpp
+++ b/engines/darkseed/darkseed.cpp
@@ -2501,7 +2501,7 @@ void DarkseedEngine::leavePackage() {
 	} else {
 		_objectVar.setMoveObjectRoom(packageObjNum, 10);
 	}
-//	_MoveObjectDepth[packageObjNum] = 0; TODO do we need this? It doesn't appear to be used.
+	//	_MoveObjectDepth[packageObjNum] = 0; TODO do we need this? It doesn't appear to be used.
 	_objectVar._objectRunningCode[140] = 0;
 }
 
@@ -2544,34 +2544,107 @@ void DarkseedEngine::waitxticks(int ticks) {
 		wait();
 	}
 }
+
+void DarkseedEngine::doCircles() {
+	debug("DarkseedEngine::doCircles");
+	_player->loadAnimations("bedsleep.nsp");
+	_player->_position.x = 0x87;
+	_player->_position.y = 0x5b;
+	_player->_frameIdx = 0;
+	_player->_direction = 1;
+	_animation->setupOtherNspAnimation(0, 1);
+
+	_frame.draw();
+	_room->draw();
+	_console->draw();
+
+	// setup & draw Mike in bed.
+	_sprites.clearSpriteDrawList();
+	const Sprite &animSprite = _player->_animations.getSpriteAt(_player->_frameIdx);
+	_sprites.addSpriteToDrawList(0x75, 0x71, &animSprite, 240 - _player->_position.y, animSprite._width, animSprite._height, _player->_flipSprite);
+	_sprites.drawSprites();
+
+	// Capture screen.
+
+	Graphics::Surface screenCopy;
+	screenCopy.copyFrom(*_screen);
+
+	_screen->clear(0);
+
+	// draw onion rings of the screen.
+
+	int16 lineLengthTbl[175];
+
+	for (int i = 0; i < 175; i++) {
+		lineLengthTbl[i] = -1;
+	}
+
+	for (int xOffset = 5; xOffset < 261; xOffset = xOffset + 5) {
+		int16 prevLineLengthTbl[175];
+		for (int i = 0; i < 175; i++) {
+			prevLineLengthTbl[i] = lineLengthTbl[i];
+		}
+		int local_4 = xOffset * xOffset;
+		for (int y = 0; y < xOffset; y++) {
+			int local_6 = local_4 - y * y;
+			int local_8 = 0;
+			int iVar1 = 0;
+			for (int local_a = 0; local_a < local_6; local_a = local_a + iVar1 + 1) {
+				iVar1 = local_8 * 2;
+				local_8 = local_8 + 1;
+			}
+			if (y < 175) {
+				lineLengthTbl[y] = (int16)(local_8 * 3 >> 1);
+				if (prevLineLengthTbl[y] == -1) {
+					copyLine(screenCopy, 320 - lineLengthTbl[y],lineLengthTbl[y] + 320,175 - y);
+					copyLine(screenCopy, 320 - lineLengthTbl[y],lineLengthTbl[y] + 320,y + 176);
+				}
+				else {
+					copyLine(screenCopy, 320 - lineLengthTbl[y],320 - prevLineLengthTbl[y],175 - y);
+					copyLine(screenCopy, prevLineLengthTbl[y] + 320,lineLengthTbl[y] + 320,175 - y);
+					copyLine(screenCopy, 320 - lineLengthTbl[y],320 - prevLineLengthTbl[y],y + 176);
+					copyLine(screenCopy, prevLineLengthTbl[y] + 320,lineLengthTbl[y] + 320,y + 176);
+				}
+			}
+		}
+		_screen->update();
+		wait();
+	}
+
+	_screen->copyRectToSurface(screenCopy, 0, 0, {screenCopy.w, screenCopy.h});
+	_screen->update();
+}
+
+void DarkseedEngine::copyLine(const Graphics::Surface &surface, int16 x1, int16 x2, int16 y) {
+	auto rect = Common::Rect({x1, y}, x2 - x1, 1);
+	_screen->blitFrom(surface, rect, rect);
+}
+
 void DarkseedEngine::restartGame() {
 	_restartGame = true;
 }
 
 void DarkseedEngine::newGame() {
 	_redrawFrame = true;
-	_cursor.showCursor(true);
 	_sprites.clearSpriteDrawList();
 	removeFullscreenPic();
 	_inventory.reset();
 	_sound->resetSpeech();
 	_objectVar.reset();
 	_room->_roomNumber = 0;
+	_currentDay = 1;
 	changeToRoom(0);
-	_player->loadAnimations("bedsleep.nsp");
-	_player->_position.x = 0x87;
-	_player->_position.y = 0x5b;
-	_player->_frameIdx = 0;
-	_player->_direction = 1;
-	_animation->setupOtherNspAnimation(0, 1);
-	//		bVar1 = true;
-	if (_currentDay == 1) {
-		_console->printTosText(8);
-	} else if (_currentDay == 2) {
-		_console->printTosText(0xc);
-	} else if (_currentDay == 3) {
-		_console->printTosText(0xe);
-	}
+
+	doCircles();
+
+	_console->printTosText(8);
+
+	_console->draw();
+	_screen->update();
+
+	waitForSpeech();
+	_systemTimerCounter = 4;
+	_cursor.showCursor(true);
 }
 
 void DarkseedEngine::waitForSpeech() {
diff --git a/engines/darkseed/darkseed.h b/engines/darkseed/darkseed.h
index 6b1e37c594b..e57c10d1ed9 100644
--- a/engines/darkseed/darkseed.h
+++ b/engines/darkseed/darkseed.h
@@ -154,7 +154,6 @@ public:
 
 	void syncSoundSettings() override;
 
-public:
 	DarkseedEngine(OSystem *syst, const ADGameDescription *gameDesc);
 	~DarkseedEngine() override;
 
@@ -245,6 +244,8 @@ public:
 	void changeToRoom(int newRoomNumber, bool placeDirectly = false);
 	void waitxticks(int ticks);
 
+	void doCircles();
+
 private:
 	void updateBaseSprites();
 	void gameLoop();
@@ -261,6 +262,7 @@ private:
 	void movePlayerToDelbert();
 	void delbertThrowStick(int16 spriteNum);
 	void leavePackage();
+	void copyLine(const Graphics::Surface &surface, int16 x1, int16 x2, int16 y);
 };
 
 extern DarkseedEngine *g_engine;


Commit: 3eff3ce763690ebc7902b3c88320180caea60bb5
    https://github.com/scummvm/scummvm/commit/3eff3ce763690ebc7902b3c88320180caea60bb5
Author: Eric Fry (yuv422 at reversedgames.com)
Date: 2024-11-17T22:10:32+11:00

Commit Message:
DARKSEED: Fix going to bed animation

Changed paths:
    engines/darkseed/animation.cpp


diff --git a/engines/darkseed/animation.cpp b/engines/darkseed/animation.cpp
index ccacf293e2d..b1734553e66 100644
--- a/engines/darkseed/animation.cpp
+++ b/engines/darkseed/animation.cpp
@@ -233,7 +233,7 @@ void Animation::updateAnimation() {
 		_player->_position.y = 91;
 		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 {
 			g_engine->gotoNextMorning(); // TODO there might be some extra logic required from original function
 			_player->_position.x = 242;




More information about the Scummvm-git-logs mailing list