[Scummvm-cvs-logs] scummvm master -> bb353d14fdcd8373a50cb8b0de5fc386ec588883

bluegr bluegr at gmail.com
Sun Jul 20 16:12:04 CEST 2014


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

Summary:
8f5ccbff18 SAGA: Move and rename some defines which are only used in the ITE intro
96dfeab1e5 SAGA: Fix spacing
b14a2599bc SAGA: Get rid of the MUSIC_DEFAULT flag
e663395435 SAGA: Add wrappers for queuing music events
e5b10aba57 SAGA: Move the ITE intro text together with the other static ITE data
7c19effd36 SAGA: Move ITE credits together with the other ITE static data
bb353d14fd SAGA: Merge all of the ITE intro cave scene handlers


Commit: 8f5ccbff187db2ca5e91a2d4caebcef2b3fdf69c
    https://github.com/scummvm/scummvm/commit/8f5ccbff187db2ca5e91a2d4caebcef2b3fdf69c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:54+03:00

Commit Message:
SAGA: Move and rename some defines which are only used in the ITE intro

Changed paths:
    engines/saga/introproc_ite.cpp
    engines/saga/scene.h



diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 91b1d3d..33c7572 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -42,6 +42,16 @@ using Common::EN_ANY;
 using Common::DE_DEU;
 using Common::IT_ITA;
 
+#define INTRO_FRAMETIME 90
+#define INTRO_CAPTION_Y 170
+#define INTRO_DE_CAPTION_Y 160
+#define INTRO_IT_CAPTION_Y 160
+#define INTRO_VOICE_PAD 50
+#define INTRO_VOICE_LETTERLEN 90
+
+#define DISSOLVE_DURATION 3000
+#define LOGO_DISSOLVE_DURATION 1000
+
 // Intro scenes
 #define RID_ITE_INTRO_ANIM_SCENE 1538
 #define RID_ITE_CAVE_SCENE_1 1542
@@ -54,8 +64,8 @@ using Common::IT_ITA;
 #define RID_ITE_FAIRETENT_SCENE 1567
 
 // ITE intro music
-#define MUSIC_1 9
-#define MUSIC_2 10
+#define MUSIC_INTRO 9
+#define MUSIC_TITLE_THEME 10
 
 LoadSceneParams ITE_IntroList[] = {
 	{RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
@@ -132,7 +142,7 @@ EventColumns *Scene::ITEQueueDialogue(EventColumns *eventColumns, int n_dialogue
 			event.code = kTextEvent;
 			event.op = kEventDisplay;
 			event.data = entry;
-			event.time = (i == 0) ? 0 : VOICE_PAD;
+			event.time = (i == 0) ? 0 : INTRO_VOICE_PAD;
 			eventColumns = _vm->_events->chain(eventColumns, event);
 		}
 
@@ -148,7 +158,7 @@ EventColumns *Scene::ITEQueueDialogue(EventColumns *eventColumns, int n_dialogue
 
 		voice_len = _vm->_sndRes->getVoiceLength(dialogue[i].i_voice_rn);
 		if (voice_len < 0) {
-			voice_len = strlen(dialogue[i].i_str) * VOICE_LETTERLEN;
+			voice_len = strlen(dialogue[i].i_str) * INTRO_VOICE_LETTERLEN;
 		}
 
 		// Remove text
@@ -328,7 +338,7 @@ int Scene::ITEIntroAnimProc(int param) {
 		debug(3, "Intro animation procedure started.");
 		debug(3, "Linking animation resources...");
 
-		_vm->_anim->setFrameTime(0, ITE_INTRO_FRAMETIME);
+		_vm->_anim->setFrameTime(0, INTRO_FRAMETIME);
 
 		// Link this scene's animation resources for continuous
 		// playback
@@ -357,7 +367,7 @@ int Scene::ITEIntroAnimProc(int param) {
 		// Queue intro music playback
 		event.type = kEvTOneshot;
 		event.code = kMusicEvent;
-		event.param = MUSIC_1;
+		event.param = MUSIC_INTRO;
 		event.param2 = MUSIC_LOOP;
 		event.op = kEventPlay;
 		event.time = 0;
@@ -474,7 +484,7 @@ int Scene::ITEIntroCave1Proc(int param) {
 		event.type = kEvTOneshot;
 		event.code = kSceneEvent;
 		event.op = kEventEnd;
-		event.time = VOICE_PAD;
+		event.time = INTRO_VOICE_PAD;
 		_vm->_events->chain(eventColumns, event);
 
 		break;
@@ -579,7 +589,7 @@ int Scene::ITEIntroCave2Proc(int param) {
 		event.type = kEvTOneshot;
 		event.code = kSceneEvent;
 		event.op = kEventEnd;
-		event.time = VOICE_PAD;
+		event.time = INTRO_VOICE_PAD;
 		_vm->_events->chain(eventColumns, event);
 
 		break;
@@ -684,7 +694,7 @@ int Scene::ITEIntroCave3Proc(int param) {
 		event.type = kEvTOneshot;
 		event.code = kSceneEvent;
 		event.op = kEventEnd;
-		event.time = VOICE_PAD;
+		event.time = INTRO_VOICE_PAD;
 		_vm->_events->chain(eventColumns, event);
 
 		break;
@@ -802,7 +812,7 @@ int Scene::ITEIntroCave4Proc(int param) {
 		event.type = kEvTOneshot;
 		event.code = kSceneEvent;
 		event.op = kEventEnd;
-		event.time = VOICE_PAD;
+		event.time = INTRO_VOICE_PAD;
 		_vm->_events->chain(eventColumns, event);
 
 		break;
@@ -860,7 +870,7 @@ int Scene::ITEIntroValleyProc(int param) {
 
 		event.type = kEvTOneshot;
 		event.code = kMusicEvent;
-		event.param = MUSIC_2;
+		event.param = MUSIC_TITLE_THEME;
 		event.param2 = MUSIC_NORMAL;
 		event.op = kEventPlay;
 		event.time = 0;
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 0a3b98b..0785be8 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -182,19 +182,6 @@ typedef Common::List<LoadSceneParams> SceneQueueList;
 #define IHNM_TITLE_TIME_GM   28750
 #define IHNM_TITLE_TIME_FM   19500
 
-///// ITE-specific stuff
-#define ITE_INTRO_FRAMETIME 90
-
-#define INTRO_CAPTION_Y 170
-#define INTRO_DE_CAPTION_Y 160
-#define INTRO_IT_CAPTION_Y 160
-#define VOICE_PAD 50
-#define VOICE_LETTERLEN 90
-
-#define PALETTE_FADE_DURATION 1000
-#define DISSOLVE_DURATION 3000
-#define LOGO_DISSOLVE_DURATION 1000
-
 #define CREDIT_DURATION1 4000
 
 struct IntroDialogue {


Commit: 96dfeab1e5cb1b9e9dc5118f90b14bab241cce0d
    https://github.com/scummvm/scummvm/commit/96dfeab1e5cb1b9e9dc5118f90b14bab241cce0d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:55+03:00

Commit Message:
SAGA: Fix spacing

Changed paths:
    engines/saga/itedata.cpp



diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp
index 87b71c2..cc3d7e0 100644
--- a/engines/saga/itedata.cpp
+++ b/engines/saga/itedata.cpp
@@ -444,110 +444,128 @@ const RawPoint pieceOrigins[PUZZLE_PIECES] = {
 };
 
 const char *pieceNames[][PUZZLE_PIECES] = {
-	{ "screwdriver", "pliers", "c-clamp", "wood clamp", "level",
-	"twine", "wood plane", "claw hammer", "tape measure", "hatchet",
-	"shears", "ruler", "saw", "mallet", "paint brush"
+	{
+		"screwdriver", "pliers", "c-clamp", "wood clamp", "level",
+		"twine", "wood plane", "claw hammer", "tape measure", "hatchet",
+		"shears", "ruler", "saw", "mallet", "paint brush"
 	},
-	{ "Schraubendreher", "Zange", "Schraubzwinge", "Holzzwinge", "Wasserwaage",
-	"Bindfaden", "Hobel", "Schusterhammer", "Bandma$", "Beil",
-	"Schere", "Winkel", "S\204ge", "Hammer", "Pinsel"
+	{
+		"Schraubendreher", "Zange", "Schraubzwinge", "Holzzwinge", "Wasserwaage",
+		"Bindfaden", "Hobel", "Schusterhammer", "Bandma$", "Beil",
+		"Schere", "Winkel", "S\204ge", "Hammer", "Pinsel"
 	},
-	{ "cacciavite", "pinze", "morsa", "morsa da legno", "livella",
-	"spago", "pialla", "martello", "metro a nastro", "accetta",
-	"cesoie", "righello", "sega", "mazza", "pennello"
+	{
+		"cacciavite", "pinze", "morsa", "morsa da legno", "livella",
+		"spago", "pialla", "martello", "metro a nastro", "accetta",
+		"cesoie", "righello", "sega", "mazza", "pennello"
 	}
 };
 
 const char *hintStr[][4] = {
-	{ "Check which pieces could fit in each corner first.",
-	"Check which corner has the least number of pieces that can fit and start from there.",
-	"Check each new corner and any new side for pieces that fit.",
-	"I don't see anything out of place."
+	{
+		"Check which pieces could fit in each corner first.",
+		"Check which corner has the least number of pieces that can fit and start from there.",
+		"Check each new corner and any new side for pieces that fit.",
+		"I don't see anything out of place."
 	},
-	{ "\232berpr\201fe zun\204chst, welche die Eckteile sein k\224nnten.",
-	"Schau, in welche Ecke die wenigsten Teile passen, und fang dort an.",
-	"Untersuche jede Ecke und jede Seite auf Teile, die dort passen k\224nnen.",
-	"Ich sehe nichts an der falschen Stelle."
+	{
+		"\232berpr\201fe zun\204chst, welche die Eckteile sein k\224nnten.",
+		"Schau, in welche Ecke die wenigsten Teile passen, und fang dort an.",
+		"Untersuche jede Ecke und jede Seite auf Teile, die dort passen k\224nnen.",
+		"Ich sehe nichts an der falschen Stelle."
 	},
-	{ "Controlla prima quali pezzi si inseriscono meglio in ogni angolo.",
-	"Controlla quale angolo ha il minor numero di pezzi che combaciano, e parti da quello.",
-	"Controlla ogni nuovo angolo e lato per ogni pezzo che combacia.",
-	"Non vedo nulla fuori posto."
+	{
+		"Controlla prima quali pezzi si inseriscono meglio in ogni angolo.",
+		"Controlla quale angolo ha il minor numero di pezzi che combaciano, e parti da quello.",
+		"Controlla ogni nuovo angolo e lato per ogni pezzo che combacia.",
+		"Non vedo nulla fuori posto."
 	}
 };
 
 const char *solicitStr[][NUM_SOLICIT_REPLIES] = {
-	{ "Hey, Fox! Would you like a hint?",
-	"Would you like some help?",
-	"Umm...Umm...",
-	"Psst! want a hint?",
-	"I would have done this differently, you know."
+	{
+		"Hey, Fox! Would you like a hint?",
+		"Would you like some help?",
+		"Umm...Umm...",
+		"Psst! want a hint?",
+		"I would have done this differently, you know."
 	},
-	{ "Hey, Fuchs! Brauchst Du \047nen Tip?",
-	"M\224chtest Du etwas Hilfe?"
-	"\231hm...\216hm..."
-	"Psst! \047n Tip vielleicht?"
-	"Ja, wei$t Du... ich h\204tte das anders gemacht."
+	{
+		"Hey, Fuchs! Brauchst Du \047nen Tip?",
+		"M\224chtest Du etwas Hilfe?"
+		"\231hm...\216hm..."
+		"Psst! \047n Tip vielleicht?"
+		"Ja, wei$t Du... ich h\204tte das anders gemacht."
 	},
-	{ "Hey, Volpe! Serve un suggerimento?",
-	"Hai bisogno di aiuto?",
-	"Umm...Umm...",
-	"Psst! Serve un aiutino?",
-	"Io, sai, l'avrei fatto diversamente."
+	{
+		"Hey, Volpe! Serve un suggerimento?",
+		"Hai bisogno di aiuto?",
+		"Umm...Umm...",
+		"Psst! Serve un aiutino?",
+		"Io, sai, l'avrei fatto diversamente."
 	}
 };
 
 const char *sakkaStr[][NUM_SAKKA] = {
-	{ "Hey, you're not supposed to help the applicants!",
-	"Guys! This is supposed to be a test!",
-	"C'mon fellows, that's not in the rules!"
+	{
+		"Hey, you're not supposed to help the applicants!",
+		"Guys! This is supposed to be a test!",
+		"C'mon fellows, that's not in the rules!"
 	},
-	{ "Hey, Du darfst dem Pr\201fling nicht helfen!",
-	"Hallo?! Dies soll eine Pr\201fung sein!",
-	"Also, Jungs. Schummeln steht nicht in den Regeln!"
+	{
+		"Hey, Du darfst dem Pr\201fling nicht helfen!",
+		"Hallo?! Dies soll eine Pr\201fung sein!",
+		"Also, Jungs. Schummeln steht nicht in den Regeln!"
 	},
-	{ "Hey, non si dovrebbero aiutare i candidati!",
-	"Ragazzi! Questo dovrebbe essere un test!",
-	"Forza ragazzi, non si pu\225!"
+	{
+		"Hey, non si dovrebbero aiutare i candidati!",
+		"Ragazzi! Questo dovrebbe essere un test!",
+		"Forza ragazzi, non si pu\225!"
 	}
 };
 
 const char *whineStr[][NUM_WHINES] = {
-	{ "Aww, c'mon Sakka!",
-	"One hint won't hurt, will it?",
-	"Sigh...",
-	"I think that clipboard has gone to your head, Sakka!",
-	"Well, I don't recall any specific rule against hinting."
+	{
+		"Aww, c'mon Sakka!",
+		"One hint won't hurt, will it?",
+		"Sigh...",
+		"I think that clipboard has gone to your head, Sakka!",
+		"Well, I don't recall any specific rule against hinting."
 	},
-	{ "Och, sei nicht so, Sakka!"
-	"EIN Tip wird schon nicht schaden, oder?",
-	"Seufz..."
-	"Ich glaube, Du hast ein Brett vor dem Kopf, Sakka!",
-	"Hm, ich kann mich an keine Regel erinnern, die Tips verbietet."
+	{
+		"Och, sei nicht so, Sakka!"
+		"EIN Tip wird schon nicht schaden, oder?",
+		"Seufz..."
+		"Ich glaube, Du hast ein Brett vor dem Kopf, Sakka!",
+		"Hm, ich kann mich an keine Regel erinnern, die Tips verbietet."
 	},
-	{ "Ooo, suvvia Sakka!",
-	"Un indizio non guaster\205, no?",
-	"Sigh...",
-	"Credo che questa faccenda ti abbia dato alla testa, Sakka!",
-	"Beh, non ricordo regole specifiche contro i suggerimenti."
+	{
+		"Ooo, suvvia Sakka!",
+		"Un indizio non guaster\205, no?",
+		"Sigh...",
+		"Credo che questa faccenda ti abbia dato alla testa, Sakka!",
+		"Beh, non ricordo regole specifiche contro i suggerimenti."
 	}
 };
 
 const char *optionsStr[][4] = {
-	{ "\"I'll do this puzzle later.\"",
-	"\"Yes, I'd like a hint please.\"",
-	"\"No, thank you, I'd like to try and solve it myself.\"",
-	"I think the %s is in the wrong place."
+	{
+		"\"I'll do this puzzle later.\"",
+		"\"Yes, I'd like a hint please.\"",
+		"\"No, thank you, I'd like to try and solve it myself.\"",
+		"I think the %s is in the wrong place."
 	},
-	{ "\"Ich l\224se das Puzzle sp\204ter.\"",
-	"\"Ja, ich m\224chte einen Tip, bitte.\"",
-	"\"Nein danke, ich m\224chte das alleine l\224sen.\"",
-	"Pssst... %s... falsche Stelle..."
+	{
+		"\"Ich l\224se das Puzzle sp\204ter.\"",
+		"\"Ja, ich m\224chte einen Tip, bitte.\"",
+		"\"Nein danke, ich m\224chte das alleine l\224sen.\"",
+		"Pssst... %s... falsche Stelle..."
 	},
-	{ "\"Far\225 questo puzzle pi\227 tardi.\"",
-	"\"Si, grazie. Ne avrei bisogno.\"",
-	"\"No, grazie, voglio provare a risolverlo da solo.\"",
-	"Penso che la tessera %s sia nel posto sbagliato."
+	{
+		"\"Far\225 questo puzzle pi\227 tardi.\"",
+		"\"Si, grazie. Ne avrei bisogno.\"",
+		"\"No, grazie, voglio provare a risolverlo da solo.\"",
+		"Penso che la tessera %s sia nel posto sbagliato."
 	}
 };
 


Commit: b14a2599bcbb5fcec2e860e048081751dbde8162
    https://github.com/scummvm/scummvm/commit/b14a2599bcbb5fcec2e860e048081751dbde8162
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:55+03:00

Commit Message:
SAGA: Get rid of the MUSIC_DEFAULT flag

Changed paths:
    engines/saga/music.cpp
    engines/saga/music.h
    engines/saga/scene.cpp



diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index e444900..6e36f51 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -258,13 +258,8 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
 	int realTrackNumber;
 
 	if (_vm->getGameId() == GID_ITE) {
-		if (flags == MUSIC_DEFAULT) {
-			if (resourceId == 13 || resourceId == 19) {
-				flags = MUSIC_NORMAL;
-			} else {
-				flags = MUSIC_LOOP;
-			}
-		}
+		if (flags == MUSIC_NORMAL && (resourceId == 13 || resourceId == 19))
+			flags = MUSIC_LOOP;
 		realTrackNumber = resourceId - 8;
 	} else {
 		realTrackNumber = resourceId + 1;
@@ -359,9 +354,6 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
 		return;
 	}
 
-	if (flags == MUSIC_DEFAULT)
-		flags = MUSIC_NORMAL;
-
 	// Load MIDI/XMI resource data
 	if (_vm->getGameId() == GID_IHNM && _vm->isMacResources()) {
 		// Load the external music file for Mac IHNM
diff --git a/engines/saga/music.h b/engines/saga/music.h
index ba44c3c..2106fb6 100644
--- a/engines/saga/music.h
+++ b/engines/saga/music.h
@@ -37,8 +37,7 @@ namespace Saga {
 
 enum MusicFlags {
 	MUSIC_NORMAL = 0,
-	MUSIC_LOOP = 0x0001,
-	MUSIC_DEFAULT = 0xffff
+	MUSIC_LOOP = 0x0001
 };
 
 class MusicDriver : public Audio::MidiPlayer {
@@ -72,7 +71,7 @@ public:
 	bool isPlaying();
 	bool hasDigitalMusic() { return _digitalMusic; }
 
-	void play(uint32 resourceId, MusicFlags flags = MUSIC_DEFAULT);
+	void play(uint32 resourceId, MusicFlags flags = MUSIC_NORMAL);
 	void pause();
 	void resume();
 	void stop();
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 04776bd..e94effe 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -792,7 +792,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) {
 				event.type = kEvTOneshot;
 				event.code = kMusicEvent;
 				event.param = _sceneDescription.musicResourceId;
-				event.param2 = MUSIC_DEFAULT;
+				event.param2 = MUSIC_NORMAL;
 				event.op = kEventPlay;
 				event.time = 0;
 				_vm->_events->queue(event);


Commit: e663395435764f14fcf9b561af408b25521d16ce
    https://github.com/scummvm/scummvm/commit/e663395435764f14fcf9b561af408b25521d16ce
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:55+03:00

Commit Message:
SAGA: Add wrappers for queuing music events

Changed paths:
    engines/saga/events.cpp
    engines/saga/events.h
    engines/saga/introproc_ite.cpp
    engines/saga/scene.cpp
    engines/saga/sfuncs_ihnm.cpp



diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 013b019..b7c3fa4 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -583,6 +583,18 @@ EventColumns *Events::chain(EventColumns *eventColumns, const Event &event) {
 	return eventColumns;
 }
 
+EventColumns *Events::chainMusic(EventColumns *eventColumns, long musicId, bool loop, long time) {
+	Event event;
+
+	event.type = kEvTOneshot;
+	event.code = kMusicEvent;
+	event.param = musicId;
+	event.param2 = loop ? MUSIC_NORMAL : MUSIC_LOOP;
+	event.op = kEventPlay;
+	event.time = time;
+	return chain(eventColumns, event);
+}
+
 void Events::initializeEvent(Event &event) {
 	switch (event.type) {
 	case kEvTOneshot:
diff --git a/engines/saga/events.h b/engines/saga/events.h
index 6c423ab..84a62f5 100644
--- a/engines/saga/events.h
+++ b/engines/saga/events.h
@@ -172,9 +172,18 @@ class Events {
 		return chain(NULL, event);
 	}
 
+	// Schedules a music event in the event list; returns a pointer to the scheduled
+	// event columns suitable for chaining if desired.
+	EventColumns *queueMusic(long musicId, bool loop = false, long time = 0) {
+		return chainMusic(NULL, musicId, loop, time);
+	}
+
 	// Places a 'event' on the end of an event columns given by 'eventColumns'
 	EventColumns *chain(EventColumns *eventColumns, const Event &event);
 
+	// Places a music 'event' on the end of an event columns given by 'eventColumns'
+	EventColumns *chainMusic(EventColumns *eventColumns, long musicId, bool loop = false, long time = 0);
+
  private:
 	int handleContinuous(Event *event);
 	int handleOneShot(Event *event);
diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 33c7572..ded1d1c 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -365,13 +365,7 @@ int Scene::ITEIntroAnimProc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue intro music playback
-		event.type = kEvTOneshot;
-		event.code = kMusicEvent;
-		event.param = MUSIC_INTRO;
-		event.param2 = MUSIC_LOOP;
-		event.op = kEventPlay;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
+		_vm->_events->chainMusic(eventColumns, MUSIC_INTRO, true);
 		}
 		break;
 	case SCENE_END:
@@ -868,13 +862,7 @@ int Scene::ITEIntroValleyProc(int param) {
 		// Begin ITE title theme music
 		_vm->_music->stop();
 
-		event.type = kEvTOneshot;
-		event.code = kMusicEvent;
-		event.param = MUSIC_TITLE_THEME;
-		event.param2 = MUSIC_NORMAL;
-		event.op = kEventPlay;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
+		_vm->_events->chainMusic(eventColumns, MUSIC_TITLE_THEME);
 
 		// Pause animation before logo
 		event.type = kEvTOneshot;
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index e94effe..f19645d 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -789,13 +789,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) {
 
 		if (_vm->getGameId() == GID_ITE) {
 			if (_sceneDescription.musicResourceId >= 0) {
-				event.type = kEvTOneshot;
-				event.code = kMusicEvent;
-				event.param = _sceneDescription.musicResourceId;
-				event.param2 = MUSIC_NORMAL;
-				event.op = kEventPlay;
-				event.time = 0;
-				_vm->_events->queue(event);
+				_vm->_events->queueMusic(_sceneDescription.musicResourceId);
 			} else {
 				event.type = kEvTOneshot;
 				event.code = kMusicEvent;
diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp
index 6957360..e3e3c1c 100644
--- a/engines/saga/sfuncs_ihnm.cpp
+++ b/engines/saga/sfuncs_ihnm.cpp
@@ -421,14 +421,7 @@ void Script::sfQueueMusic(SCRIPTFUNC_PARAMS) {
 		warning("sfQueueMusic: Wrong song number (%d > %d)", param1, _vm->_music->_songTable.size() - 1);
 	} else {
 		_vm->_music->setVolume(_vm->_musicVolume, 1);
-		event.type = kEvTOneshot;
-		event.code = kMusicEvent;
-		event.param = _vm->_music->_songTable[param1];
-		event.param2 = param2 ? MUSIC_LOOP : MUSIC_NORMAL;
-		event.op = kEventPlay;
-		event.time = _vm->ticksToMSec(1000);
-
-		_vm->_events->queue(event);
+		_vm->_events->queueMusic(_vm->_music->_songTable[param1], param2, _vm->ticksToMSec(1000));
 
 		if (!_vm->_scene->haveChapterPointsChanged()) {
 			_vm->_scene->setCurrentMusicTrack(param1);


Commit: e5b10aba570ae63154feda4cd3755a417f3d9064
    https://github.com/scummvm/scummvm/commit/e5b10aba570ae63154feda4cd3755a417f3d9064
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:56+03:00

Commit Message:
SAGA: Move the ITE intro text together with the other static ITE data

Changed paths:
    engines/saga/introproc_ite.cpp
    engines/saga/itedata.cpp
    engines/saga/itedata.h
    engines/saga/scene.h



diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index ded1d1c..0d4227c 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -28,6 +28,7 @@
 #include "saga/animation.h"
 #include "saga/events.h"
 #include "saga/font.h"
+#include "saga/itedata.h"
 #include "saga/sndres.h"
 #include "saga/palanim.h"
 #include "saga/music.h"
@@ -393,74 +394,7 @@ int Scene::ITEIntroCave1Proc(int param) {
 	else if (_vm->getLanguage() == Common::IT_ITA)
 		lang = 2;
 
-	static const IntroDialogue dialogue[][4] = {
-		{ { // English
-			0,		// cave voice 0
-			"We see the sky, we see the land, we see the water, "
-			"and we wonder: Are we the only ones?"
-		},
-		{
-			1,		// cave voice 1
-			"Long before we came to exist, the humans ruled the "
-			"Earth."
-		},
-		{
-			2,		// cave voice 2
-			"They made marvelous things, and moved whole "
-			"mountains."
-		},
-		{
-			3,		// cave voice 3
-			"They knew the Secret of Flight, the Secret of "
-			"Happiness, and other secrets beyond our imagining."
-		} },
-		// -----------------------------------------------------
-		{ { // German
-			0,		// cave voice 0
-			"Um uns sind der Himmel, das Land und die Seen; und "
-			"wir fragen uns - sind wir die einzigen?"
-		},
-		{
-			1,		// cave voice 1
-			"Lange vor unserer Zeit herrschten die Menschen "
-			"\201ber die Erde."
-		},
-		{
-			2,		// cave voice 2
-			"Sie taten wundersame Dinge und versetzten ganze "
-			"Berge."
-		},
-		{
-			3,		// cave voice 3
-			"Sie kannten das Geheimnis des Fluges, das Geheimnis "
-			"der Fr\224hlichkeit und andere Geheimnisse, die "
-			"unsere Vorstellungskraft \201bersteigen."
-		} },
-		// -----------------------------------------------------
-		{ { // Italian fan translation
-			0,		// cave voice 0
-			"Guardiamo il cielo, guardiamo la terra, guardiamo "
-			"l'acqua, e ci chiediamo: Siamo forse soli?"
-		},
-		{
-			1,		// cave voice 1
-			"Molto tempo prima che noi esistessimo, gli Umani "
-			"dominavano la terra."
-		},
-		{
-			2,		// cave voice 2
-			"Fecero cose meravigliose, e mossero intere "
-			"montagne."
-		},
-		{
-			3,		// cave voice 3
-			"Conoscevano il Segreto del Volo, il Segreto della "
-			"Felicit\205, ed altri segreti oltre ogni nostra "
-			"immaginazione."
-		} }
-	};
-
-	int n_dialogues = ARRAYSIZE(dialogue[lang]);
+	int n_dialogues = ARRAYSIZE(introDialogueCave1[lang]);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -472,7 +406,7 @@ int Scene::ITEIntroCave1Proc(int param) {
 		eventColumns = _vm->_events->queue(event);
 
 		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]);
+		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave1[lang]);
 
 		// End scene after last dialogue over
 		event.type = kEvTOneshot;
@@ -508,56 +442,7 @@ int Scene::ITEIntroCave2Proc(int param) {
 	else if (_vm->getLanguage() == Common::IT_ITA)
 		lang = 2;
 
-	static const IntroDialogue dialogue[][3] = {
-		{ { // English
-			4,		// cave voice 4
-			"The humans also knew the Secret of Life, and they "
-			"used it to give us the Four Great Gifts:"
-		},
-		{
-			5,		// cave voice 5
-			"Thinking minds, feeling hearts, speaking mouths, and "
-			"reaching hands."
-		},
-		{
-			6,		// cave voice 6
-			"We are their children."
-		} },
-		// -----------------------------------------------------
-		{ { // German
-			4,		// cave voice 4
-			"Au$erdem kannten die Menschen das Geheimnis des "
-			"Lebens. Und sie nutzten es, um uns die vier gro$en "
-			"Geschenke zu geben -"
-		},
-		{
-			5,		// cave voice 5
-			"den denkenden Geist, das f\201hlende Herz, den "
-			"sprechenden Mund und die greifende Hand."
-		},
-		{
-			6,		// cave voice 6
-			"Wir sind ihre Kinder."
-		} },
-		// -----------------------------------------------------
-		{ { // Italian fan translation
-			4,		// cave voice 4
-			"Gli Umani conoscevano anche il Segreto della Vita, "
-			"e lo usarono per darci i Quattro Grandi Doni:"
-
-		},
-		{
-			5,		// cave voice 5
-			"Il pensiero, le emozioni, la parola e la manualit\205."
-
-		},
-		{
-			6,		// cave voice 6
-			"Siamo i loro figli."
-		} }
-	};
-
-	int n_dialogues = ARRAYSIZE(dialogue[lang]);
+	int n_dialogues = ARRAYSIZE(introDialogueCave2[lang]);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -577,7 +462,7 @@ int Scene::ITEIntroCave2Proc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]);
+		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave2[lang]);
 
 		// End scene after last dialogue over
 		event.type = kEvTOneshot;
@@ -612,57 +497,7 @@ int Scene::ITEIntroCave3Proc(int param) {
 	else if (_vm->getLanguage() == Common::IT_ITA)
 		lang = 2;
 
-	static const IntroDialogue dialogue[][3] = {
-		{ { // English
-			7,		// cave voice 7
-			"They taught us how to use our hands, and how to "
-			"speak."
-		},
-		{
-			8,		// cave voice 8
-			"They showed us the joy of using our minds."
-		},
-		{
-			9,		// cave voice 9
-			"They loved us, and when we were ready, they surely "
-			"would have given us the Secret of Happiness."
-		} },
-		// -----------------------------------------------------
-		{ { // German
-			7,		// cave voice 7
-			"Sie lehrten uns zu sprechen und unsere H\204nde zu "
-			"benutzen."
-		},
-		{
-			8,		// cave voice 8
-			"Sie zeigten uns die Freude am Denken."
-		},
-		{
-			9,		// cave voice 9
-			"Sie liebten uns, und w\204ren wir bereit gewesen, "
-			"h\204tten sie uns sicherlich das Geheimnis der "
-			"Fr\224hlichkeit offenbart."
-		} },
-		// -----------------------------------------------------
-		{ { // Italian fan translation
-			7,		// cave voice 7
-			"Ci insegnarono come usare le mani e come parlare. "
-
-		},
-		{
-			8,		// cave voice 8
-			"Ci mostrarono le gioie che l'uso della mente "
-			"pu\225 dare. "
-		},
-		{
-			9,		// cave voice 9
-			"Ci amarono, ed una volta pronti, ci avrebbero "
-			"sicuramente svelato il Segreto della Felicit\205."
-
-		} }
-	};
-
-	int n_dialogues = ARRAYSIZE(dialogue[lang]);
+	int n_dialogues = ARRAYSIZE(introDialogueCave3[lang]);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -682,7 +517,7 @@ int Scene::ITEIntroCave3Proc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]);
+		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave3[lang]);
 
 		// End scene after last dialogue over
 		event.type = kEvTOneshot;
@@ -717,70 +552,7 @@ int Scene::ITEIntroCave4Proc(int param) {
 	else if (_vm->getLanguage() == Common::IT_ITA)
 		lang = 2;
 
-	static const IntroDialogue dialogue[][4] = {
-		{ { // English
-			10,		// cave voice 10
-			"And now we see the sky, the land, and the water that "
-			"we are heirs to, and we wonder: why did they leave?"
-		},
-		{
-			11,		// cave voice 11
-			"Do they live still, in the stars? In the oceans "
-			"depths? In the wind?"
-		},
-		{
-			12,		// cave voice 12
-			"We wonder, was their fate good or evil?"
-		},
-		{
-			13,		// cave voice 13
-			"And will we also share the same fate one day?"
-		} },
-		// -----------------------------------------------------
-		{ { // German
-			10,		// cave voice 10
-			"Und nun sehen wir den Himmel, das Land und die "
-			"Seen - unser Erbe. Und wir fragen uns - warum "
-			"verschwanden sie?"
-		},
-		{
-			11,		// cave voice 11
-			"Leben sie noch in den Sternen? In den Tiefen des "
-			"Ozeans? Im Wind?"
-		},
-		{
-			12,		// cave voice 12
-			"Wir fragen uns - war ihr Schicksal gut oder b\224se?"
-		},
-		{
-			13,		// cave voice 13
-			"Und wird uns eines Tages das gleiche Schicksal "
-			"ereilen?"
-		} },
-		// -----------------------------------------------------
-		{ { // Italian fan translation
-			10,		// cave voice 10
-			"Ed ora che guardiamo il cielo, la terra e l'acqua "
-			"che abbiamo ereditato, pensiamo: Perch\202 partirono?"
-
-		},
-		{
-			11,		// cave voice 11
-			"Vivono ancora, nelle stelle? Nelle profondit\205 "
-			"dell'oceano? Nel vento?"
-		},
-		{
-			12,		// cave voice 12
-			"Ci domandiamo, il loro destino fu felice o nefasto?"
-		},
-		{
-			13,		// cave voice 13
-			"E un giorno, condivideremo anche noi lo stesso "
-			"destino?"
-		} }
-	};
-
-	int n_dialogues = ARRAYSIZE(dialogue[lang]);
+	int n_dialogues = ARRAYSIZE(introDialogueCave4[lang]);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -800,7 +572,7 @@ int Scene::ITEIntroCave4Proc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]);
+		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave4[lang]);
 
 		// End scene after last dialogue over
 		event.type = kEvTOneshot;
diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp
index cc3d7e0..aaeac23 100644
--- a/engines/saga/itedata.cpp
+++ b/engines/saga/itedata.cpp
@@ -569,4 +569,233 @@ const char *optionsStr[][4] = {
 	}
 };
 
+const IntroDialogue introDialogueCave1[][4] = {
+	{ { // English
+		0,		// cave voice 0
+		"We see the sky, we see the land, we see the water, "
+		"and we wonder: Are we the only ones?"
+	},
+	{
+		1,		// cave voice 1
+		"Long before we came to exist, the humans ruled the "
+		"Earth."
+	},
+	{
+		2,		// cave voice 2
+		"They made marvelous things, and moved whole "
+		"mountains."
+	},
+	{
+		3,		// cave voice 3
+		"They knew the Secret of Flight, the Secret of "
+		"Happiness, and other secrets beyond our imagining."
+	} },
+	// -----------------------------------------------------
+	{ { // German
+		0,		// cave voice 0
+		"Um uns sind der Himmel, das Land und die Seen; und "
+		"wir fragen uns - sind wir die einzigen?"
+	},
+	{
+		1,		// cave voice 1
+		"Lange vor unserer Zeit herrschten die Menschen "
+		"\201ber die Erde."
+	},
+	{
+		2,		// cave voice 2
+		"Sie taten wundersame Dinge und versetzten ganze "
+		"Berge."
+	},
+	{
+		3,		// cave voice 3
+		"Sie kannten das Geheimnis des Fluges, das Geheimnis "
+		"der Fr\224hlichkeit und andere Geheimnisse, die "
+		"unsere Vorstellungskraft \201bersteigen."
+	} },
+	// -----------------------------------------------------
+	{ { // Italian fan translation
+		0,		// cave voice 0
+		"Guardiamo il cielo, guardiamo la terra, guardiamo "
+		"l'acqua, e ci chiediamo: Siamo forse soli?"
+	},
+	{
+		1,		// cave voice 1
+		"Molto tempo prima che noi esistessimo, gli Umani "
+		"dominavano la terra."
+	},
+	{
+		2,		// cave voice 2
+		"Fecero cose meravigliose, e mossero intere "
+		"montagne."
+	},
+	{
+		3,		// cave voice 3
+		"Conoscevano il Segreto del Volo, il Segreto della "
+		"Felicit\205, ed altri segreti oltre ogni nostra "
+		"immaginazione."
+	} }
+};
+
+const IntroDialogue introDialogueCave2[][3] = {
+	{ { // English
+		4,		// cave voice 4
+		"The humans also knew the Secret of Life, and they "
+		"used it to give us the Four Great Gifts:"
+	},
+	{
+		5,		// cave voice 5
+		"Thinking minds, feeling hearts, speaking mouths, and "
+		"reaching hands."
+	},
+	{
+		6,		// cave voice 6
+		"We are their children."
+	} },
+	// -----------------------------------------------------
+	{ { // German
+		4,		// cave voice 4
+		"Au$erdem kannten die Menschen das Geheimnis des "
+		"Lebens. Und sie nutzten es, um uns die vier gro$en "
+		"Geschenke zu geben -"
+	},
+	{
+		5,		// cave voice 5
+		"den denkenden Geist, das f\201hlende Herz, den "
+		"sprechenden Mund und die greifende Hand."
+	},
+	{
+		6,		// cave voice 6
+		"Wir sind ihre Kinder."
+	} },
+	// -----------------------------------------------------
+	{ { // Italian fan translation
+		4,		// cave voice 4
+		"Gli Umani conoscevano anche il Segreto della Vita, "
+		"e lo usarono per darci i Quattro Grandi Doni:"
+
+	},
+	{
+		5,		// cave voice 5
+		"Il pensiero, le emozioni, la parola e la manualit\205."
+
+	},
+	{
+		6,		// cave voice 6
+		"Siamo i loro figli."
+	} }
+};
+
+const IntroDialogue introDialogueCave3[][3] = {
+	{ { // English
+		7,		// cave voice 7
+		"They taught us how to use our hands, and how to "
+		"speak."
+	},
+	{
+		8,		// cave voice 8
+		"They showed us the joy of using our minds."
+	},
+	{
+		9,		// cave voice 9
+		"They loved us, and when we were ready, they surely "
+		"would have given us the Secret of Happiness."
+	} },
+	// -----------------------------------------------------
+	{ { // German
+		7,		// cave voice 7
+		"Sie lehrten uns zu sprechen und unsere H\204nde zu "
+		"benutzen."
+	},
+	{
+		8,		// cave voice 8
+		"Sie zeigten uns die Freude am Denken."
+	},
+	{
+		9,		// cave voice 9
+		"Sie liebten uns, und w\204ren wir bereit gewesen, "
+		"h\204tten sie uns sicherlich das Geheimnis der "
+		"Fr\224hlichkeit offenbart."
+	} },
+	// -----------------------------------------------------
+	{ { // Italian fan translation
+		7,		// cave voice 7
+		"Ci insegnarono come usare le mani e come parlare. "
+
+	},
+	{
+		8,		// cave voice 8
+		"Ci mostrarono le gioie che l'uso della mente "
+		"pu\225 dare. "
+	},
+	{
+		9,		// cave voice 9
+		"Ci amarono, ed una volta pronti, ci avrebbero "
+		"sicuramente svelato il Segreto della Felicit\205."
+
+	} }
+};
+
+const IntroDialogue introDialogueCave4[][4] = {
+	{ { // English
+		10,		// cave voice 10
+		"And now we see the sky, the land, and the water that "
+		"we are heirs to, and we wonder: why did they leave?"
+	},
+	{
+		11,		// cave voice 11
+		"Do they live still, in the stars? In the oceans "
+		"depths? In the wind?"
+	},
+	{
+		12,		// cave voice 12
+		"We wonder, was their fate good or evil?"
+	},
+	{
+		13,		// cave voice 13
+		"And will we also share the same fate one day?"
+	} },
+	// -----------------------------------------------------
+	{ { // German
+		10,		// cave voice 10
+		"Und nun sehen wir den Himmel, das Land und die "
+		"Seen - unser Erbe. Und wir fragen uns - warum "
+		"verschwanden sie?"
+	},
+	{
+		11,		// cave voice 11
+		"Leben sie noch in den Sternen? In den Tiefen des "
+		"Ozeans? Im Wind?"
+	},
+	{
+		12,		// cave voice 12
+		"Wir fragen uns - war ihr Schicksal gut oder b\224se?"
+	},
+	{
+		13,		// cave voice 13
+		"Und wird uns eines Tages das gleiche Schicksal "
+		"ereilen?"
+	} },
+	// -----------------------------------------------------
+	{ { // Italian fan translation
+		10,		// cave voice 10
+		"Ed ora che guardiamo il cielo, la terra e l'acqua "
+		"che abbiamo ereditato, pensiamo: Perch\202 partirono?"
+
+	},
+	{
+		11,		// cave voice 11
+		"Vivono ancora, nelle stelle? Nelle profondit\205 "
+		"dell'oceano? Nel vento?"
+	},
+	{
+		12,		// cave voice 12
+		"Ci domandiamo, il loro destino fu felice o nefasto?"
+	},
+	{
+		13,		// cave voice 13
+		"E un giorno, condivideremo anche noi lo stesso "
+		"destino?"
+	} }
+};
+
 } // End of namespace Saga
diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h
index d27b847..637a842 100644
--- a/engines/saga/itedata.h
+++ b/engines/saga/itedata.h
@@ -79,6 +79,11 @@ struct IteFxTable {
 	byte vol;
 };
 
+struct IntroDialogue {
+	uint32 i_voice_rn;
+	const char *i_str;
+};
+
 #define ITE_OBJECTCOUNT 39
 #define ITE_SFXCOUNT 63
 
@@ -106,6 +111,11 @@ extern const char *hintStr[][4];
 extern const char portraitList[];
 extern const char *optionsStr[][4];
 
+extern const IntroDialogue introDialogueCave1[][4];
+extern const IntroDialogue introDialogueCave2[][3];
+extern const IntroDialogue introDialogueCave3[][3];
+extern const IntroDialogue introDialogueCave4[][4];
+
 } // End of namespace Saga
 
 #endif
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 0785be8..9a88f01 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -184,11 +184,6 @@ typedef Common::List<LoadSceneParams> SceneQueueList;
 
 #define CREDIT_DURATION1 4000
 
-struct IntroDialogue {
-	uint32 i_voice_rn;
-	const char *i_str;
-};
-
 struct IntroCredit {
 	Common::Language lang;
 	int game;


Commit: 7c19effd36e7fb648d6aa9cff1b351e7ae41540b
    https://github.com/scummvm/scummvm/commit/7c19effd36e7fb648d6aa9cff1b351e7ae41540b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:56+03:00

Commit Message:
SAGA: Move ITE credits together with the other ITE static data

Changed paths:
    engines/saga/introproc_ite.cpp
    engines/saga/itedata.cpp
    engines/saga/itedata.h
    engines/saga/scene.h



diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 0d4227c..96137cc 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -38,11 +38,6 @@
 
 namespace Saga {
 
-using Common::UNK_LANG;
-using Common::EN_ANY;
-using Common::DE_DEU;
-using Common::IT_ITA;
-
 #define INTRO_FRAMETIME 90
 #define INTRO_CAPTION_Y 170
 #define INTRO_DE_CAPTION_Y 160
@@ -174,20 +169,6 @@ EventColumns *Scene::ITEQueueDialogue(EventColumns *eventColumns, int n_dialogue
 	return eventColumns;
 }
 
-enum {
-	kCHeader,
-	kCText
-};
-
-enum {
-	kITEPC           = (1 << 0),
-	kITEPCCD         = (1 << 1),
-	kITEMac          = (1 << 2),
-	kITEWyrmKeep     = (1 << 3),
-	kITEAny          = 0xffff,
-	kITENotWyrmKeep  = kITEAny & ~kITEWyrmKeep
-};
-
 // Queue a page of credits text. The original interpreter did word-wrapping
 // automatically. We currently don't.
 
@@ -203,13 +184,13 @@ EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits
 	lang = _vm->getLanguage();
 
 	if (hasWyrmkeepCredits)
-		game = kITEWyrmKeep;
+		game = kITECreditsWyrmKeep;
 	else if (_vm->getPlatform() == Common::kPlatformMacintosh)
-		game = kITEMac;
+		game = kITECreditsMac;
 	else if (_vm->getFeatures() & GF_EXTRA_ITE_CREDITS)
-		game = kITEPCCD;
+		game = kITECreditsPCCD;
 	else
-		game = kITEPC;
+		game = kITECreditsPC;
 
 	int line_spacing = 0;
 	int paragraph_spacing;
@@ -220,7 +201,7 @@ EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits
 	int credits_height = 0;
 
 	for (i = 0; i < n_credits; i++) {
-		if (credits[i].lang != lang && credits[i].lang != UNK_LANG) {
+		if (credits[i].lang != lang && credits[i].lang != Common::UNK_LANG) {
 			continue;
 		}
 
@@ -229,12 +210,12 @@ EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits
 		}
 
 		switch (credits[i].type) {
-		case kCHeader:
+		case kITECreditsHeader:
 			font = kKnownFontSmall;
 			line_spacing = 4;
 			n_paragraphs++;
 			break;
-		case kCText:
+		case kITECreditsText:
 			font = kKnownFontMedium;
 			line_spacing = 2;
 			break;
@@ -261,7 +242,7 @@ EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits
 	textEntry.point.x = 160;
 
 	for (i = 0; i < n_credits; i++) {
-		if (credits[i].lang != lang && credits[i].lang != UNK_LANG) {
+		if (credits[i].lang != lang && credits[i].lang != Common::UNK_LANG) {
 			continue;
 		}
 
@@ -270,12 +251,12 @@ EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits
 		}
 
 		switch (credits[i].type) {
-		case kCHeader:
+		case kITECreditsHeader:
 			font = kKnownFontSmall;
 			line_spacing = 4;
 			y += paragraph_spacing;
 			break;
-		case kCText:
+		case kITECreditsText:
 			font = kKnownFontMedium;
 			line_spacing = 2;
 			break;
@@ -601,23 +582,7 @@ int Scene::ITEIntroValleyProc(int param) {
 	Event event;
 	EventColumns *eventColumns;
 
-	static const IntroCredit credits[] = {
-		{EN_ANY, kITEAny, kCHeader, "Producer"},
-		{DE_DEU, kITEAny, kCHeader, "Produzent"},
-		{IT_ITA, kITEAny, kCHeader, "Produttore"},
-		{UNK_LANG, kITEAny, kCText, "Walter Hochbrueckner"},
-		{EN_ANY, kITEAny, kCHeader, "Executive Producer"},
-		{DE_DEU, kITEAny, kCHeader, "Ausf\201hrender Produzent"},
-		{IT_ITA, kITEAny, kCHeader, "Produttore Esecutivo"},
-		{UNK_LANG, kITEAny, kCText, "Robert McNally"},
-		{UNK_LANG, kITEWyrmKeep, kCHeader, "2nd Executive Producer"},
-		{EN_ANY, kITENotWyrmKeep, kCHeader, "Publisher"},
-		{DE_DEU, kITENotWyrmKeep, kCHeader, "Herausgeber"},
-		{IT_ITA, kITENotWyrmKeep, kCHeader, "Editore"},
-		{UNK_LANG, kITEAny, kCText, "Jon Van Caneghem"}
-	};
-
-	int n_credits = ARRAYSIZE(credits);
+	int n_credits = ARRAYSIZE(creditsValley);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -669,7 +634,7 @@ int Scene::ITEIntroValleyProc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue game credits list
-		eventColumns = ITEQueueCredits(9000, CREDIT_DURATION1, n_credits, credits);
+		eventColumns = ITEQueueCredits(9000, CREDIT_DURATION1, n_credits, creditsValley);
 
 		// End scene after credit display
 		event.type = kEvTOneshot;
@@ -698,47 +663,8 @@ int Scene::ITEIntroTreeHouseProc(int param) {
 	Event event;
 	EventColumns *eventColumns;
 
-	static const IntroCredit credits1[] = {
-		{EN_ANY, kITEAny, kCHeader, "Game Design"},
-		{DE_DEU, kITEAny, kCHeader, "Spielentwurf"},
-		{IT_ITA, kITEAny, kCHeader, "Progetto"},
-		{UNK_LANG, kITEAny, kCText, "Talin, Joe Pearce, Robert McNally"},
-		{EN_ANY, kITEAny, kCText, "and Carolly Hauksdottir"},
-		{DE_DEU, kITEAny, kCText, "und Carolly Hauksdottir"},
-		{IT_ITA, kITEAny, kCText, "e Carolly Hauksdottir"},
-		{EN_ANY, kITEAny, kCHeader, "Screenplay and Dialog"},
-		{EN_ANY, kITEAny, kCText, "Robert Leh, Len Wein, and Bill Rotsler"},
-		{DE_DEU, kITEAny, kCHeader, "Geschichte und Dialoge"},
-		{DE_DEU, kITEAny, kCText, "Robert Leh, Len Wein und Bill Rotsler"},
-		{IT_ITA, kITEAny, kCHeader, "Sceneggiatura e Dialoghi"},
-		{IT_ITA, kITEAny, kCText, "Robert Leh, Len Wein e Bill Rotsler"}
-	};
-
-	int n_credits1 = ARRAYSIZE(credits1);
-
-	static const IntroCredit credits2[] = {
-		{UNK_LANG, kITEWyrmKeep, kCHeader, "Art Direction"},
-		{UNK_LANG, kITEWyrmKeep, kCText, "Allison Hershey"},
-		{EN_ANY, kITEAny, kCHeader, "Art"},
-		{DE_DEU, kITEAny, kCHeader, "Grafiken"},
-		{IT_ITA, kITEAny, kCHeader, "Grafica"},
-		{UNK_LANG, kITEWyrmKeep, kCText, "Ed Lacabanne, Glenn Price, April Lee,"},
-		{UNK_LANG, kITENotWyrmKeep, kCText, "Edward Lacabanne, Glenn Price, April Lee,"},
-		{UNK_LANG, kITEWyrmKeep, kCText, "Lisa Sample, Brian Dowrick, Reed Waller,"},
-		{EN_ANY, kITEWyrmKeep, kCText, "Allison Hershey and Talin"},
-		{DE_DEU, kITEWyrmKeep, kCText, "Allison Hershey und Talin"},
-		{IT_ITA, kITEWyrmKeep, kCText, "Allison Hershey e Talin"},
-		{EN_ANY, kITENotWyrmKeep, kCText, "Lisa Iennaco, Brian Dowrick, Reed"},
-		{EN_ANY, kITENotWyrmKeep, kCText, "Waller, Allison Hershey and Talin"},
-		{DE_DEU, kITEAny, kCText, "Waller, Allison Hershey und Talin"},
-		{IT_ITA, kITEAny, kCText, "Waller, Allison Hershey e Talin"},
-		{EN_ANY, kITENotWyrmKeep, kCHeader, "Art Direction"},
-		{DE_DEU, kITENotWyrmKeep, kCHeader, "Grafische Leitung"},
-		{IT_ITA, kITENotWyrmKeep, kCHeader, "Direzione Grafica"},
-		{UNK_LANG, kITENotWyrmKeep, kCText, "Allison Hershey"}
-	};
-
-	int n_credits2 = ARRAYSIZE(credits2);
+	int n_credits1 = ARRAYSIZE(creditsTreeHouse1);
+	int n_credits2 = ARRAYSIZE(creditsTreeHouse2);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -763,8 +689,8 @@ int Scene::ITEIntroTreeHouseProc(int param) {
 		}
 
 		// Queue game credits list
-		ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1);
-		eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2);
+		ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, creditsTreeHouse1);
+		eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, creditsTreeHouse2);
 
 		// End scene after credit display
 		event.type = kEvTOneshot;
@@ -793,34 +719,8 @@ int Scene::ITEIntroFairePathProc(int param) {
 	Event event;
 	EventColumns *eventColumns;
 
-	static const IntroCredit credits1[] = {
-		{EN_ANY, kITEAny, kCHeader, "Programming"},
-		{DE_DEU, kITEAny, kCHeader, "Programmiert von"},
-		{IT_ITA, kITEAny, kCHeader, "Programmazione"},
-		{UNK_LANG, kITEAny, kCText, "Talin, Walter Hochbrueckner,"},
-		{EN_ANY, kITEAny, kCText, "Joe Burks and Robert Wiggins"},
-		{DE_DEU, kITEAny, kCText, "Joe Burks und Robert Wiggins"},
-		{IT_ITA, kITEAny, kCText, "Joe Burks e Robert Wiggins"},
-		{EN_ANY, kITEPCCD | kITEWyrmKeep, kCHeader, "Additional Programming"},
-		{EN_ANY, kITEPCCD | kITEWyrmKeep, kCText, "John Bolton"},
-		{UNK_LANG, kITEMac, kCHeader, "Macintosh Version"},
-		{UNK_LANG, kITEMac, kCText, "Michael McNally and Robert McNally"},
-		{EN_ANY, kITEAny, kCHeader, "Music and Sound"},
-		{DE_DEU, kITEAny, kCHeader, "Musik und Sound"},
-		{IT_ITA, kITEAny, kCHeader, "Musica e Sonoro"},
-		{UNK_LANG, kITEAny, kCText, "Matt Nathan"}
-	};
-
-	int n_credits1 = ARRAYSIZE(credits1);
-
-	static const IntroCredit credits2[] = {
-		{EN_ANY, kITEAny, kCHeader, "Directed by"},
-		{DE_DEU, kITEAny, kCHeader, "Regie"},
-		{IT_ITA, kITEAny, kCHeader, "Regia"},
-		{UNK_LANG, kITEAny, kCText, "Talin"}
-	};
-
-	int n_credits2 = ARRAYSIZE(credits2);
+	int n_credits1 = ARRAYSIZE(creditsFairePath1);
+	int n_credits2 = ARRAYSIZE(creditsFairePath2);
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -843,8 +743,8 @@ int Scene::ITEIntroFairePathProc(int param) {
 		_vm->_events->chain(eventColumns, event);
 
 		// Queue game credits list
-		ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1);
-		eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2);
+		ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, creditsFairePath1);
+		eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, creditsFairePath2);
 
 		// End scene after credit display
 		event.type = kEvTOneshot;
diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp
index aaeac23..da70733 100644
--- a/engines/saga/itedata.cpp
+++ b/engines/saga/itedata.cpp
@@ -798,4 +798,83 @@ const IntroDialogue introDialogueCave4[][4] = {
 	} }
 };
 
+const IntroCredit creditsValley[] = {
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Producer"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Produzent"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Produttore"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Walter Hochbrueckner"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Executive Producer"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Ausf\201hrender Produzent"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Produttore Esecutivo"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Robert McNally"},
+	{Common::UNK_LANG, kITECreditsWyrmKeep, kITECreditsHeader, "2nd Executive Producer"},
+	{Common::EN_ANY, kITECreditsNotWyrmKeep, kITECreditsHeader, "Publisher"},
+	{Common::DE_DEU, kITECreditsNotWyrmKeep, kITECreditsHeader, "Herausgeber"},
+	{Common::IT_ITA, kITECreditsNotWyrmKeep, kITECreditsHeader, "Editore"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Jon Van Caneghem"}
+};
+
+const IntroCredit creditsTreeHouse1[] = {
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Game Design"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Spielentwurf"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Progetto"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Talin, Joe Pearce, Robert McNally"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsText, "and Carolly Hauksdottir"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsText, "und Carolly Hauksdottir"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsText, "e Carolly Hauksdottir"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Screenplay and Dialog"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsText, "Robert Leh, Len Wein, and Bill Rotsler"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Geschichte und Dialoge"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsText, "Robert Leh, Len Wein und Bill Rotsler"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Sceneggiatura e Dialoghi"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsText, "Robert Leh, Len Wein e Bill Rotsler"}
+};
+
+const IntroCredit creditsTreeHouse2[] = {
+	{Common::UNK_LANG, kITECreditsWyrmKeep, kITECreditsHeader, "Art Direction"},
+	{Common::UNK_LANG, kITECreditsWyrmKeep, kITECreditsText, "Allison Hershey"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Art"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Grafiken"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Grafica"},
+	{Common::UNK_LANG, kITECreditsWyrmKeep, kITECreditsText, "Ed Lacabanne, Glenn Price, April Lee,"},
+	{Common::UNK_LANG, kITECreditsNotWyrmKeep, kITECreditsText, "Edward Lacabanne, Glenn Price, April Lee,"},
+	{Common::UNK_LANG, kITECreditsWyrmKeep, kITECreditsText, "Lisa Sample, Brian Dowrick, Reed Waller,"},
+	{Common::EN_ANY, kITECreditsWyrmKeep, kITECreditsText, "Allison Hershey and Talin"},
+	{Common::DE_DEU, kITECreditsWyrmKeep, kITECreditsText, "Allison Hershey und Talin"},
+	{Common::IT_ITA, kITECreditsWyrmKeep, kITECreditsText, "Allison Hershey e Talin"},
+	{Common::EN_ANY, kITECreditsNotWyrmKeep, kITECreditsText, "Lisa Iennaco, Brian Dowrick, Reed"},
+	{Common::EN_ANY, kITECreditsNotWyrmKeep, kITECreditsText, "Waller, Allison Hershey and Talin"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsText, "Waller, Allison Hershey und Talin"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsText, "Waller, Allison Hershey e Talin"},
+	{Common::EN_ANY, kITECreditsNotWyrmKeep, kITECreditsHeader, "Art Direction"},
+	{Common::DE_DEU, kITECreditsNotWyrmKeep, kITECreditsHeader, "Grafische Leitung"},
+	{Common::IT_ITA, kITECreditsNotWyrmKeep, kITECreditsHeader, "Direzione Grafica"},
+	{Common::UNK_LANG, kITECreditsNotWyrmKeep, kITECreditsText, "Allison Hershey"}
+};
+
+const IntroCredit creditsFairePath1[] = {
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Programming"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Programmiert von"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Programmazione"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Talin, Walter Hochbrueckner,"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsText, "Joe Burks and Robert Wiggins"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsText, "Joe Burks und Robert Wiggins"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsText, "Joe Burks e Robert Wiggins"},
+	{Common::EN_ANY, kITECreditsPCCD | kITECreditsWyrmKeep, kITECreditsHeader, "Additional Programming"},
+	{Common::EN_ANY, kITECreditsPCCD | kITECreditsWyrmKeep, kITECreditsText, "John Bolton"},
+	{Common::UNK_LANG, kITECreditsMac, kITECreditsHeader, "Macintosh Version"},
+	{Common::UNK_LANG, kITECreditsMac, kITECreditsText, "Michael McNally and Robert McNally"},
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Music and Sound"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Musik und Sound"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Musica e Sonoro"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Matt Nathan"}
+};
+
+const IntroCredit creditsFairePath2[] = {
+	{Common::EN_ANY, kITECreditsAny, kITECreditsHeader, "Directed by"},
+	{Common::DE_DEU, kITECreditsAny, kITECreditsHeader, "Regie"},
+	{Common::IT_ITA, kITECreditsAny, kITECreditsHeader, "Regia"},
+	{Common::UNK_LANG, kITECreditsAny, kITECreditsText, "Talin"}
+};
+
 } // End of namespace Saga
diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h
index 637a842..f941665 100644
--- a/engines/saga/itedata.h
+++ b/engines/saga/itedata.h
@@ -84,6 +84,27 @@ struct IntroDialogue {
 	const char *i_str;
 };
 
+struct IntroCredit {
+	Common::Language lang;
+	int game;
+	int type;
+	const char *string;
+};
+
+enum {
+	kITECreditsHeader,
+	kITECreditsText
+};
+
+enum {
+	kITECreditsPC           = (1 << 0),
+	kITECreditsPCCD         = (1 << 1),
+	kITECreditsMac          = (1 << 2),
+	kITECreditsWyrmKeep     = (1 << 3),
+	kITECreditsAny          = 0xffff,
+	kITECreditsNotWyrmKeep  = kITECreditsAny & ~kITECreditsWyrmKeep
+};
+
 #define ITE_OBJECTCOUNT 39
 #define ITE_SFXCOUNT 63
 
@@ -116,6 +137,12 @@ extern const IntroDialogue introDialogueCave2[][3];
 extern const IntroDialogue introDialogueCave3[][3];
 extern const IntroDialogue introDialogueCave4[][4];
 
+extern const IntroCredit creditsValley[13];
+extern const IntroCredit creditsTreeHouse1[13];
+extern const IntroCredit creditsTreeHouse2[19];
+extern const IntroCredit creditsFairePath1[15];
+extern const IntroCredit creditsFairePath2[4];
+
 } // End of namespace Saga
 
 #endif
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 9a88f01..e7e2839 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -184,14 +184,6 @@ typedef Common::List<LoadSceneParams> SceneQueueList;
 
 #define CREDIT_DURATION1 4000
 
-struct IntroCredit {
-	Common::Language lang;
-	int game;
-	int type;
-	const char *string;
-};
-
-
 class Scene {
  public:
 	Scene(SagaEngine *vm);


Commit: bb353d14fdcd8373a50cb8b0de5fc386ec588883
    https://github.com/scummvm/scummvm/commit/bb353d14fdcd8373a50cb8b0de5fc386ec588883
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-07-20T17:10:56+03:00

Commit Message:
SAGA: Merge all of the ITE intro cave scene handlers

Changed paths:
    engines/saga/introproc_ite.cpp
    engines/saga/scene.h



diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 96137cc..4094e8c 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -360,14 +360,11 @@ int Scene::ITEIntroAnimProc(int param) {
 	return 0;
 }
 
-int Scene::SC_ITEIntroCave1Proc(int param, void *refCon) {
-	return ((Scene *)refCon)->ITEIntroCave1Proc(param);
-}
-
-// Handles first introductory cave painting scene
-int Scene::ITEIntroCave1Proc(int param) {
+int Scene::ITEIntroCaveCommonProc(int param, int caveScene) {
 	Event event;
-	EventColumns *eventColumns;
+	EventColumns *eventColumns = NULL;
+	const IntroDialogue *dialogue;
+
 	int lang = 0;
 
 	if (_vm->getLanguage() == Common::DE_DEU)
@@ -375,19 +372,50 @@ int Scene::ITEIntroCave1Proc(int param) {
 	else if (_vm->getLanguage() == Common::IT_ITA)
 		lang = 2;
 
-	int n_dialogues = ARRAYSIZE(introDialogueCave1[lang]);
+	int n_dialogues = 0;
+	
+	switch (caveScene) {
+	case 1:
+		n_dialogues = ARRAYSIZE(introDialogueCave1[lang]);
+		dialogue = introDialogueCave1[lang];
+		break;
+	case 2:
+		n_dialogues = ARRAYSIZE(introDialogueCave2[lang]);
+		dialogue = introDialogueCave2[lang];
+		break;
+	case 3:
+		n_dialogues = ARRAYSIZE(introDialogueCave3[lang]);
+		dialogue = introDialogueCave3[lang];
+		break;
+	case 4:
+		n_dialogues = ARRAYSIZE(introDialogueCave4[lang]);
+		dialogue = introDialogueCave4[lang];
+		break;
+	default:
+		error("Invalid cave scene");
+	}
 
 	switch (param) {
 	case SCENE_BEGIN:
+		if (caveScene > 1) {
+			// Start 'dissolve' transition to new scene background
+			event.type = kEvTContinuous;
+			event.code = kTransitionEvent;
+			event.op = kEventDissolve;
+			event.time = 0;
+			event.duration = DISSOLVE_DURATION;
+			eventColumns = _vm->_events->queue(event);
+		}
+
 		// Begin palette cycling animation for candles
 		event.type = kEvTOneshot;
 		event.code = kPalAnimEvent;
 		event.op = kEventCycleStart;
 		event.time = 0;
-		eventColumns = _vm->_events->queue(event);
+		eventColumns = _vm->_events->chain(eventColumns, event);
 
 		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave1[lang]);
+		ITEQueueDialogue(eventColumns, n_dialogues, dialogue);
 
 		// End scene after last dialogue over
 		event.type = kEvTOneshot;
@@ -408,59 +436,22 @@ int Scene::ITEIntroCave1Proc(int param) {
 	return 0;
 }
 
+int Scene::SC_ITEIntroCave1Proc(int param, void *refCon) {
+	return ((Scene *)refCon)->ITEIntroCave1Proc(param);
+}
+
+// Handles first introductory cave painting scene
+int Scene::ITEIntroCave1Proc(int param) {
+	return ITEIntroCaveCommonProc(param, 1);
+}
+
 int Scene::SC_ITEIntroCave2Proc(int param, void *refCon) {
 	return ((Scene *)refCon)->ITEIntroCave2Proc(param);
 }
 
 // Handles second introductory cave painting scene
 int Scene::ITEIntroCave2Proc(int param) {
-	Event event;
-	EventColumns *eventColumns;
-	int lang = 0;
-
-	if (_vm->getLanguage() == Common::DE_DEU)
-		lang = 1;
-	else if (_vm->getLanguage() == Common::IT_ITA)
-		lang = 2;
-
-	int n_dialogues = ARRAYSIZE(introDialogueCave2[lang]);
-
-	switch (param) {
-	case SCENE_BEGIN:
-		// Start 'dissolve' transition to new scene background
-		event.type = kEvTContinuous;
-		event.code = kTransitionEvent;
-		event.op = kEventDissolve;
-		event.time = 0;
-		event.duration = DISSOLVE_DURATION;
-		eventColumns = _vm->_events->queue(event);
-
-		// Begin palette cycling animation for candles
-		event.type = kEvTOneshot;
-		event.code = kPalAnimEvent;
-		event.op = kEventCycleStart;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
-
-		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave2[lang]);
-
-		// End scene after last dialogue over
-		event.type = kEvTOneshot;
-		event.code = kSceneEvent;
-		event.op = kEventEnd;
-		event.time = INTRO_VOICE_PAD;
-		_vm->_events->chain(eventColumns, event);
-
-		break;
-	case SCENE_END:
-		break;
-	default:
-		warning("Illegal scene procedure parameter");
-		break;
-	}
-
-	return 0;
+	return ITEIntroCaveCommonProc(param, 2);
 }
 
 int Scene::SC_ITEIntroCave3Proc(int param, void *refCon) {
@@ -469,53 +460,7 @@ int Scene::SC_ITEIntroCave3Proc(int param, void *refCon) {
 
 // Handles third introductory cave painting scene
 int Scene::ITEIntroCave3Proc(int param) {
-	Event event;
-	EventColumns *eventColumns;
-	int lang = 0;
-
-	if (_vm->getLanguage() == Common::DE_DEU)
-		lang = 1;
-	else if (_vm->getLanguage() == Common::IT_ITA)
-		lang = 2;
-
-	int n_dialogues = ARRAYSIZE(introDialogueCave3[lang]);
-
-	switch (param) {
-	case SCENE_BEGIN:
-		// Start 'dissolve' transition to new scene background
-		event.type = kEvTContinuous;
-		event.code = kTransitionEvent;
-		event.op = kEventDissolve;
-		event.time = 0;
-		event.duration = DISSOLVE_DURATION;
-		eventColumns = _vm->_events->queue(event);
-
-		// Begin palette cycling animation for candles
-		event.type = kEvTOneshot;
-		event.code = kPalAnimEvent;
-		event.op = kEventCycleStart;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
-
-		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave3[lang]);
-
-		// End scene after last dialogue over
-		event.type = kEvTOneshot;
-		event.code = kSceneEvent;
-		event.op = kEventEnd;
-		event.time = INTRO_VOICE_PAD;
-		_vm->_events->chain(eventColumns, event);
-
-		break;
-	case SCENE_END:
-		break;
-	default:
-		warning("Illegal scene procedure parameter");
-		break;
-	}
-
-	return 0;
+	return ITEIntroCaveCommonProc(param, 3);
 }
 
 int Scene::SC_ITEIntroCave4Proc(int param, void *refCon) {
@@ -524,53 +469,7 @@ int Scene::SC_ITEIntroCave4Proc(int param, void *refCon) {
 
 // Handles fourth introductory cave painting scene
 int Scene::ITEIntroCave4Proc(int param) {
-	Event event;
-	EventColumns *eventColumns;
-	int lang = 0;
-
-	if (_vm->getLanguage() == Common::DE_DEU)
-		lang = 1;
-	else if (_vm->getLanguage() == Common::IT_ITA)
-		lang = 2;
-
-	int n_dialogues = ARRAYSIZE(introDialogueCave4[lang]);
-
-	switch (param) {
-	case SCENE_BEGIN:
-		// Start 'dissolve' transition to new scene background
-		event.type = kEvTContinuous;
-		event.code = kTransitionEvent;
-		event.op = kEventDissolve;
-		event.time = 0;
-		event.duration = DISSOLVE_DURATION;
-		eventColumns = _vm->_events->queue(event);
-
-		// Begin palette cycling animation for candles
-		event.type = kEvTOneshot;
-		event.code = kPalAnimEvent;
-		event.op = kEventCycleStart;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
-
-		// Queue narrator dialogue list
-		ITEQueueDialogue(eventColumns, n_dialogues, introDialogueCave4[lang]);
-
-		// End scene after last dialogue over
-		event.type = kEvTOneshot;
-		event.code = kSceneEvent;
-		event.op = kEventEnd;
-		event.time = INTRO_VOICE_PAD;
-		_vm->_events->chain(eventColumns, event);
-
-		break;
-	case SCENE_END:
-		break;
-	default:
-		warning("Illegal scene procedure parameter");
-		break;
-	}
-
-	return 0;
+	return ITEIntroCaveCommonProc(param, 4);
 }
 
 int Scene::SC_ITEIntroValleyProc(int param, void *refCon) {
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index e7e2839..fc23a46 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -412,6 +412,7 @@ class Scene {
 	int ITEIntroCave2Proc(int param);
 	int ITEIntroCave3Proc(int param);
 	int ITEIntroCave4Proc(int param);
+	int ITEIntroCaveCommonProc(int param, int caveScene);
 	int ITEIntroValleyProc(int param);
 	int ITEIntroTreeHouseProc(int param);
 	int ITEIntroFairePathProc(int param);






More information about the Scummvm-git-logs mailing list