[Scummvm-git-logs] scummvm master -> ce400ce0f1764c3ee5a5dc102e84d372c8cd57ee

dreammaster dreammaster at scummvm.org
Fri Jan 19 03:29:48 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ce400ce0f1 XEEN: Implemented death cutscene method


Commit: ce400ce0f1764c3ee5a5dc102e84d372c8cd57ee
    https://github.com/scummvm/scummvm/commit/ce400ce0f1764c3ee5a5dc102e84d372c8cd57ee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-18T21:29:42-05:00

Commit Message:
XEEN: Implemented death cutscene method

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


diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp
index a15bc40..cc797d7 100644
--- a/engines/xeen/worldofxeen/worldofxeen.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen.cpp
@@ -86,5 +86,86 @@ void WorldOfXeenEngine::outerGameLoop() {
 	}
 }
 
+void WorldOfXeenEngine::death() {
+	Window &w = (*_windows)[0];
+	_sound->stopAllAudio();
+	SpriteResource fireSprites[4] = {
+		SpriteResource("fire1.vga"),
+		SpriteResource("fire2.vga"),
+		SpriteResource("fire3.vga"),
+		SpriteResource("fire4.vga")
+	};
+	SpriteResource deathSprites("death.vga"), death1Sprites("death1.vga");
+	const int Y_LIST[] = {
+		196, 187, 179, 169, 159, 147, 138, 127, 113, 101, 86,
+		73, 60, 48, 36, 23, 10, 0, 0
+	};
+
+	Graphics::ManagedSurface savedBg;
+	savedBg.copyFrom(*_screen);
+
+	fireSprites[0].draw(0, 0, Common::Point(0, 0));
+	fireSprites[0].draw(0, 1, Common::Point(160, 0));
+	w.update();
+	_sound->playSound("fire.voc");
+
+	// Fire will vertically consume the screen
+	for (int idx = 2; idx < 36; idx += 2) {
+		_events->updateGameCounter();
+		_screen->blitFrom(savedBg);
+
+		fireSprites[idx / 10].draw(0, idx % 10, Common::Point(0, 0));
+		fireSprites[idx / 10].draw(0, (idx % 10) + 1, Common::Point(160, 0));
+
+		for (int yCtr = 0, frame = 0; yCtr < (idx / 2); ++yCtr, frame += 2) {
+			deathSprites.draw(0, frame, Common::Point(0, Y_LIST[yCtr]));
+			deathSprites.draw(0, frame + 1, Common::Point(160, Y_LIST[yCtr]));
+		}
+
+		w.update();
+		_events->wait(1);
+	}
+
+	deathSprites.draw(0, 34, Common::Point(0, 0));
+	deathSprites.draw(0, 35, Common::Point(160, 0));
+	w.update();
+	savedBg.blitFrom(*_screen);
+
+	_sound->playSong(_files->_isDarkCc ? "laff1.voc" : "xeenlaff.voc");
+
+	// Animation of Xeen or Alamar laughing
+	for (int idx = 0, idx2 = 0; idx < (_files->_isDarkCc ? 10 : 23); ++idx) {
+		_events->updateGameCounter();
+		_screen->blitFrom(savedBg);
+
+		if (idx != 0)
+			death1Sprites.draw(0, idx - 1);
+		w.update();
+
+		if (_files->_isDarkCc) {
+			_events->wait(2);
+		} else {
+			if (idx == 1 || idx == 11)
+				_sound->playFX(33);
+			_events->wait(2);
+			if (idx == 15)
+				_sound->playFX(34);
+		}
+
+		if (idx == (_files->_isDarkCc ? 9 : 10)) {
+			if (idx2 < (_files->_isDarkCc ? 2 : 1)) {
+				idx = -1;
+				++idx2;
+			}
+		}
+
+		if (!_sound->isPlaying())
+			idx = 23;
+	}
+
+	_screen->blitFrom(savedBg);
+	w.update();
+}
+
 } // End of namespace WorldOfXeen
 } // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h
index 0177e7c..90fd191 100644
--- a/engines/xeen/worldofxeen/worldofxeen.h
+++ b/engines/xeen/worldofxeen/worldofxeen.h
@@ -48,6 +48,11 @@ protected:
 	 * intros, main menus, or to play the actual game
 	 */
 	virtual void outerGameLoop();
+
+	/**
+	 * Death cutscene
+	 */
+	virtual void death();
 public:
 	bool _seenDarkSideIntro;
 	WOXGameAction _pendingAction;
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index 81f629e..44679ee 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -200,6 +200,9 @@ void XeenEngine::play() {
 	_combat->_moveMonsters = true;
 
 	gameLoop();
+
+	if (_party->_dead)
+		death();
 }
 
 void XeenEngine::gameLoop() {
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index c0ff071..dcf490d 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -127,6 +127,11 @@ protected:
 	 * Play the game
 	 */
 	virtual void playGame();
+
+	/**
+	 * Death cutscene
+	 */
+	virtual void death() = 0;
 public:
 	Combat *_combat;
 	Debugger *_debugger;





More information about the Scummvm-git-logs mailing list