[Scummvm-git-logs] scummvm master -> 789a38b38c91af973bd6e2c6f4b944c50399cbf4

dreammaster dreammaster at scummvm.org
Wed Dec 13 03:42:34 CET 2017


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:
789a38b38c XEEN: Added Sphinx cutscene code


Commit: 789a38b38c91af973bd6e2c6f4b944c50399cbf4
    https://github.com/scummvm/scummvm/commit/789a38b38c91af973bd6e2c6f4b944c50399cbf4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-12T21:42:23-05:00

Commit Message:
XEEN: Added Sphinx cutscene code

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


diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index cc2320a..bac0f5f 100644
--- a/engines/xeen/locations.cpp
+++ b/engines/xeen/locations.cpp
@@ -1363,12 +1363,87 @@ void DwarfCutscene::getNewLocation() {
 
 /*------------------------------------------------------------------------*/
 
+static const int SPHINX_X1[9] = { 0, -5, -10, -15, -20, -17, -12, -7, 0 };
+static const int SPHINX_Y1[9] = { 0, 0, 0, 6, 11, 16, 20, 23, 28 };
+static const int SPHINX_X2[9] = { 160, 145, 130, 115, 100, 93, 88, 83, 80 };
+
 SphinxCutscene::SphinxCutscene() : CutsceneLocation(SPHINX) {
+}
+
+int SphinxCutscene::show() {
+	EventsManager &events = *g_vm->_events;
+	Interface &intf = *g_vm->_interface;
+	Screen &screen = *g_vm->_screen;
+	Sound &sound = *g_vm->_sound;
+	Windows &windows = *g_vm->_windows;
 	SpriteResource sprites1("sphinx.vga");
 	_boxSprites.load("box.vga");
 
+	// Save background
+	Graphics::ManagedSurface bgSurface;
+	bgSurface.copyFrom(screen);
+	
+	for (int idx = 8; idx >= 0; --idx) {
+		screen.copyFrom(bgSurface);
+		sprites1.draw(0, 0, Common::Point(SPHINX_X1[idx], SPHINX_Y1[idx]));
+		sprites1.draw(0, 1, Common::Point(SPHINX_X2[idx], SPHINX_Y1[idx]));
+		windows[0].update();
+		events.wait(1);
+	}
 
-	// TODO
+	sound.setMusicVolume(48);
+
+	for (int idx = 0; idx < (_mazeFlag ? 3 : 2); ++idx) {
+		switch (idx) {
+		case 0:
+			sound.playSound(_mazeFlag ? "sphinx10.voc" : "sphinx13.voc");
+			break;
+		case 1:
+			sound.playSound(_mazeFlag ? "sphinx11.voc" : "sphinx14.voc");
+			break;
+		case 2:
+			sound.playSound("sphinx12.voc");
+			break;
+		}
+
+		do {
+			sprites1.draw(0, 0, Common::Point(0, 0));
+			sprites1.draw(0, 1, Common::Point(160, 0));
+			sprites1.draw(0, g_vm->getRandomNumber(2, 10));
+			cutsceneAnimUpdate();
+
+			events.wait(1);
+		} while (!g_vm->shouldQuit() && (sound.isPlaying() || _animCtr));
+
+		sprites1.draw(0, 0, Common::Point(0, 0));
+		sprites1.draw(0, 1, Common::Point(160, 0));
+	}
+
+	sound.setMusicVolume(95);
+
+	if (!_mazeFlag) {
+		for (int idx = 0; idx < 8; ++idx) {
+			screen.copyFrom(bgSurface);
+			sprites1.draw(0, 0, Common::Point(SPHINX_X1[idx], SPHINX_Y1[idx]));
+			sprites1.draw(0, 1, Common::Point(SPHINX_X2[idx], SPHINX_Y1[idx]));
+			windows[0].update();
+			events.wait(1);
+		}
+
+		screen.copyFrom(bgSurface);
+		windows[0].update();
+	}
+
+	setNewLocation();
+
+	// Restore game screen
+	sound.setMusicVolume(95);
+	screen.loadBackground("back.raw");
+	intf.drawParty(false);
+	intf.draw3d(false, false);
+
+	events.clearEvents();
+	return 0;
 }
 
 void SphinxCutscene::getNewLocation() {
diff --git a/engines/xeen/locations.h b/engines/xeen/locations.h
index e0f4838..91df561 100644
--- a/engines/xeen/locations.h
+++ b/engines/xeen/locations.h
@@ -300,6 +300,11 @@ private:
 public:
 	SphinxCutscene();
 	virtual ~SphinxCutscene() {}
+
+	/**
+	 * Show the town location
+	 */
+	virtual int show();
 };
 
 class PyramidLocation : public BaseLocation {





More information about the Scummvm-git-logs mailing list