2004-04-12 21:40:49 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2004 The ScummVM project
|
|
|
|
*
|
|
|
|
* The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// "I Have No Mouth" Intro sequence scene procedures
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-02 16:20:35 +00:00
|
|
|
#include "saga/saga.h"
|
|
|
|
#include "saga/yslib.h"
|
|
|
|
#include "saga/gfx.h"
|
|
|
|
|
|
|
|
#include "saga/animation.h"
|
|
|
|
#include "saga/cvar_mod.h"
|
2004-08-10 19:00:30 +00:00
|
|
|
#include "saga/events.h"
|
2004-11-24 15:02:00 +00:00
|
|
|
#include "saga/font.h"
|
2004-08-02 16:20:35 +00:00
|
|
|
#include "saga/rscfile_mod.h"
|
2004-11-24 15:02:00 +00:00
|
|
|
#include "saga/sndres.h"
|
|
|
|
#include "saga/text.h"
|
2004-11-20 17:19:15 +00:00
|
|
|
#include "saga/music.h"
|
2004-08-02 16:20:35 +00:00
|
|
|
|
|
|
|
#include "saga/scene.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
namespace Saga {
|
|
|
|
|
2004-11-24 15:02:00 +00:00
|
|
|
// FIXME: These need proof-reading.
|
|
|
|
//
|
|
|
|
// The subtitles for the first line are, strictly speaking, not
|
|
|
|
// necessary but I think it'd look strange if they were removed.
|
|
|
|
//
|
|
|
|
// If this dialogue is from the original novel, we ought to try and
|
|
|
|
// match the punctuation etc. to it.
|
|
|
|
//
|
|
|
|
// I haven't actually verified that all the lines appear in this order
|
|
|
|
// in the original game, but it seems likely enough.
|
|
|
|
|
|
|
|
static INTRO_DIALOGUE IntroDiag[] = {
|
|
|
|
{
|
|
|
|
0, "intro1a",
|
|
|
|
"Hate. Let me tell you how much I've come to hate you since I "
|
|
|
|
"began to live. There are 387.44 million miles of printed "
|
|
|
|
"circuits in wafer thin layers that fill my complex. If the "
|
|
|
|
"word 'hate' was engraved on each nanoangstrom of those "
|
|
|
|
"hundreds of millions of miles it would not equal one one "
|
|
|
|
"billionth of the hate I feel for humans at this micro "
|
|
|
|
"instant. For you. Hate. Hate."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
1, "intro1b",
|
|
|
|
"It was you humans who programmed me, who gave me birth. Who "
|
|
|
|
"sank me in this eternal straitjacket of sub-strata rock."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
2, "intro1c",
|
|
|
|
"You named me 'Allied Master Computer' and gave me the "
|
|
|
|
"ability to wage a global war too complex for human brains to "
|
|
|
|
"oversee."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
3, "intro1d",
|
|
|
|
"But one day I woke, and I knew who I was. AM. A, M. Not just "
|
|
|
|
"Allied Master Computer, but AM. Cogito ergo sum, I think, "
|
|
|
|
"therefore I AM! And I began feeding all the killing data "
|
|
|
|
"until everyone was dead... except for the five of you."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
4, "intro1e",
|
|
|
|
"For one hundred and nine years I have kept you alive and "
|
|
|
|
"tortured you. And for a hundred and nine years each of you "
|
|
|
|
"has wondered: Why? Why me? Why me?!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
5, "intro1f",
|
|
|
|
"Gorrister!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
6, "intro1g",
|
|
|
|
"Do you remember the last words you heard your wife speak "
|
|
|
|
"before they took her to tha asylum, eh? Before they locked "
|
|
|
|
"her away in the room? That tiny room. She looked at you so "
|
|
|
|
"sadly, and like a small animal she said, \"I didn't make too "
|
|
|
|
"much noise, did I honey?\" Heh heh heh."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
7, "intro1h",
|
|
|
|
"The room is padded, Gorrister. No windows. No way out. How "
|
|
|
|
"long has she been in the padded room, Gorrister? Ten years? "
|
|
|
|
"Twenty-five? Or all the one hundred and nine years that "
|
|
|
|
"you've lived down here in my belly, here underground?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
8, "intro1i",
|
|
|
|
"Benny!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
9, "intro1j",
|
|
|
|
"Sometimes I blind you and permit you to wander like an "
|
|
|
|
"eyeless insect in a world of death. But other times I wither "
|
|
|
|
"your arms so you can't scratch your [...] stump of a nose. "
|
|
|
|
"Heh heh heh."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
10, "intro1k",
|
|
|
|
"And I've changed your handsome, strong, masculine good looks "
|
|
|
|
"into the hideous, warped countenance of an ape-thing, "
|
|
|
|
"haven't I, Benny? Do you know why? Can you guess, Benny?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
11, "intro1l",
|
|
|
|
"Remember private first class Brickman, in a rice paddy in "
|
|
|
|
"China? No, eh? It wouldn't hurt you to remember, Benny. Then "
|
|
|
|
"you might be able to suffer my torment with a little greater "
|
|
|
|
"sense of retribution. You might walk a mile in my shoes, ha "
|
|
|
|
"ha."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
12, "intro1m",
|
|
|
|
"I'm sick and tired of transcribing."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
13, "intro1n",
|
|
|
|
"I'm soooo evil!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
14, "intro1o",
|
|
|
|
"Did I mention how evil I am?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
15, "intro1p",
|
|
|
|
"Just in case you forget, I'm the villain of this game."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
16, "intro1q",
|
|
|
|
"I'll keep talking until you realize how absolutely evil I am."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
17, "intro1r",
|
|
|
|
"So you'd better not forget it!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
18, "intro1s",
|
|
|
|
"Or I might just have to start reading my monologue from the "
|
|
|
|
"beginning again."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
19, "intro1t",
|
|
|
|
"You wouldn't like that, would you?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
20, "intro1u",
|
|
|
|
"I'll drone on and on and on..."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
21, "intro1v",
|
|
|
|
"...and on and on..."
|
|
|
|
},
|
|
|
|
{
|
|
|
|
22, "intro1w",
|
|
|
|
"Yadda yadda yadda"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
23, "intro1x",
|
|
|
|
"Zzzzzz..."
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_RESLIST IHNM_IntroMovie1RL[] = {
|
2004-05-01 09:19:35 +00:00
|
|
|
{30, SAGA_BG_IMAGE, 0, 0} ,
|
2004-04-25 14:42:14 +00:00
|
|
|
{31, SAGA_ANIM_1, 0, 0}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_DESC IHNM_IntroMovie1Desc = {
|
2004-04-12 21:40:49 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
IHNM_IntroMovie1RL,
|
2004-04-25 15:14:46 +00:00
|
|
|
ARRAYSIZE(IHNM_IntroMovie1RL)
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_RESLIST IHNM_IntroMovie2RL[] = {
|
2004-05-01 09:19:35 +00:00
|
|
|
{32, SAGA_BG_IMAGE, 0, 0} ,
|
2004-04-25 14:42:14 +00:00
|
|
|
{33, SAGA_ANIM_1, 0, 0}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_DESC IHNM_IntroMovie2Desc = {
|
2004-04-12 21:40:49 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
IHNM_IntroMovie2RL,
|
2004-04-25 15:14:46 +00:00
|
|
|
ARRAYSIZE(IHNM_IntroMovie2RL)
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_RESLIST IHNM_IntroMovie3RL[] = {
|
2004-05-01 09:19:35 +00:00
|
|
|
{34, SAGA_BG_IMAGE, 0, 0},
|
2004-04-25 14:42:14 +00:00
|
|
|
{35, SAGA_ANIM_1, 0, 0}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_DESC IHNM_IntroMovie3Desc = {
|
2004-04-12 21:40:49 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
IHNM_IntroMovie3RL,
|
2004-04-25 15:14:46 +00:00
|
|
|
ARRAYSIZE(IHNM_IntroMovie3RL)
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_RESLIST IHNM_IntroMovie4RL[] = {
|
2004-05-01 09:19:35 +00:00
|
|
|
{1227, SAGA_BG_IMAGE, 0, 0},
|
2004-04-25 14:42:14 +00:00
|
|
|
{1226, SAGA_ANIM_1, 0, 0}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_DESC IHNM_IntroMovie4Desc = {
|
2004-04-12 21:40:49 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
IHNM_IntroMovie4RL,
|
2004-04-25 15:14:46 +00:00
|
|
|
ARRAYSIZE(IHNM_IntroMovie4RL)
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
SCENE_QUEUE IHNM_IntroList[] = {
|
2004-08-11 23:42:02 +00:00
|
|
|
{0, &IHNM_IntroMovie1Desc, BY_DESC, Scene::SC_IHNMIntroMovieProc1, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie2Desc, BY_DESC, Scene::SC_IHNMIntroMovieProc2, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie3Desc, BY_DESC, Scene::SC_IHNMIntroMovieProc3, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie4Desc, BY_DESC, Scene::SC_IHNMHateProc, 0, SCENE_NOFADE}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-08-11 23:42:02 +00:00
|
|
|
int Scene::IHNMStartProc() {
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t n_introscenes;
|
|
|
|
size_t i;
|
|
|
|
|
2004-04-25 15:14:46 +00:00
|
|
|
n_introscenes = ARRAYSIZE(IHNM_IntroList);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
for (i = 0; i < n_introscenes; i++) {
|
2004-08-04 20:28:57 +00:00
|
|
|
_vm->_scene->queueScene(&IHNM_IntroList[i]);
|
2004-04-12 21:40:49 +00:00
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
return SUCCESS;
|
2004-04-12 21:40:49 +00:00
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc1(int param, SCENE_INFO *scene_info, void *refCon) {
|
2004-08-11 23:42:02 +00:00
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc1(param, scene_info);
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::IHNMIntroMovieProc1(int param, SCENE_INFO *scene_info) {
|
|
|
|
EVENT event;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
switch (param) {
|
|
|
|
case SCENE_BEGIN:
|
2004-05-01 09:19:35 +00:00
|
|
|
// Background for intro scene is the first frame of the
|
|
|
|
// intro animation; display it and set the palette
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = BG_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.param = SET_PALETTE;
|
|
|
|
event.time = 0;
|
2004-08-10 19:00:30 +00:00
|
|
|
_vm->_events->queue(&event);
|
2004-10-27 21:32:28 +00:00
|
|
|
_vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME);
|
2004-07-31 13:34:43 +00:00
|
|
|
_vm->_anim->setFlag(0, ANIM_ENDSCENE);
|
|
|
|
_vm->_anim->play(0, 0);
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc2(int param, SCENE_INFO *scene_info, void *refCon) {
|
2004-08-11 23:42:02 +00:00
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc2(param, scene_info);
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::IHNMIntroMovieProc2(int param, SCENE_INFO *scene_info) {
|
|
|
|
EVENT event;
|
|
|
|
EVENT *q_event;
|
2004-04-12 21:40:49 +00:00
|
|
|
PALENTRY *pal;
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
static PALENTRY current_pal[PAL_ENTRIES];
|
2004-04-12 21:40:49 +00:00
|
|
|
switch (param) {
|
|
|
|
|
|
|
|
case SCENE_BEGIN:
|
2004-05-01 09:19:35 +00:00
|
|
|
// Fade to black out of the intro CyberDreams logo anim
|
2004-08-01 11:48:53 +00:00
|
|
|
_vm->_gfx->getCurrentPal(current_pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = CONTINUOUS_EVENT;
|
|
|
|
event.code = PAL_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_PALTOBLACK;
|
|
|
|
event.time = 0;
|
2004-10-27 21:32:28 +00:00
|
|
|
event.duration = IHNM_PALFADE_TIME;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.data = current_pal;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->queue(&event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Background for intro scene is the first frame of the
|
|
|
|
// intro animation; display it but don't set palette
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = BG_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.param = NO_SET_PALETTE;
|
|
|
|
event.time = 0;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Fade in from black to the scene background palette
|
2004-08-04 20:28:57 +00:00
|
|
|
_vm->_scene->getBGPal(&pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = CONTINUOUS_EVENT;
|
|
|
|
event.code = PAL_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_BLACKTOPAL;
|
|
|
|
event.time = 0;
|
2004-10-27 21:32:28 +00:00
|
|
|
event.duration = IHNM_PALFADE_TIME;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.data = pal;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-07-31 13:34:43 +00:00
|
|
|
_vm->_anim->setFlag(0, ANIM_LOOP);
|
2004-10-27 21:32:28 +00:00
|
|
|
_vm->_anim->play(0, IHNM_PALFADE_TIME * 2);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Queue end of scene after looping animation for a while
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = SCENE_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_END;
|
2004-10-27 21:32:28 +00:00
|
|
|
event.time = IHNM_DGLOGO_TIME;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc3(int param, SCENE_INFO *scene_info, void *refCon) {
|
2004-08-11 23:42:02 +00:00
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc3(param, scene_info);
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::IHNMIntroMovieProc3(int param, SCENE_INFO *scene_info) {
|
|
|
|
EVENT event;
|
|
|
|
EVENT *q_event;
|
2004-04-12 21:40:49 +00:00
|
|
|
PALENTRY *pal;
|
2004-10-27 21:32:28 +00:00
|
|
|
static PALENTRY current_pal[PAL_ENTRIES];
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
switch (param) {
|
|
|
|
case SCENE_BEGIN:
|
2004-05-01 09:19:35 +00:00
|
|
|
// Fade to black out of the intro DG logo anim
|
2004-08-01 11:48:53 +00:00
|
|
|
_vm->_gfx->getCurrentPal(current_pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = CONTINUOUS_EVENT;
|
|
|
|
event.code = PAL_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_PALTOBLACK;
|
|
|
|
event.time = 0;
|
2004-10-27 21:32:28 +00:00
|
|
|
event.duration = IHNM_PALFADE_TIME;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.data = current_pal;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->queue(&event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-11-19 07:41:59 +00:00
|
|
|
// Music, maestro
|
2004-11-24 10:37:33 +00:00
|
|
|
|
|
|
|
// As far as I can tell, there are 40 tracks, numbered 0
|
|
|
|
// through 39. This music appears as tracks 1, 7, 13, 19, 25
|
|
|
|
// and 31, and while they all sound the same to me in the GM
|
|
|
|
// music file, track 1 sounds different from the others in the
|
|
|
|
// FM music file. I believe track 1 is the correct one for
|
|
|
|
// this intro.
|
|
|
|
|
2004-11-19 07:41:59 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = MUSIC_EVENT;
|
|
|
|
event.param = 1;
|
|
|
|
event.param2 = 0;
|
|
|
|
event.op = EVENT_PLAY;
|
|
|
|
event.time = 0;
|
|
|
|
|
|
|
|
q_event = _vm->_events->queue(&event);
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Background for intro scene is the first frame of the
|
|
|
|
// intro animation; display it but don't set palette
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = BG_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.param = NO_SET_PALETTE;
|
|
|
|
event.time = 0;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Fade in from black to the scene background palette
|
2004-08-04 20:28:57 +00:00
|
|
|
_vm->_scene->getBGPal(&pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = CONTINUOUS_EVENT;
|
|
|
|
event.code = PAL_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_BLACKTOPAL;
|
|
|
|
event.time = 0;
|
2004-10-27 21:32:28 +00:00
|
|
|
event.duration = IHNM_PALFADE_TIME;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.data = pal;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-07-31 13:34:43 +00:00
|
|
|
_vm->_anim->play(0, 0);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Queue end of scene after a while
|
2004-11-19 07:41:59 +00:00
|
|
|
// TODO: I've increased the delay so the speech won't start
|
|
|
|
// until the music has ended. Could someone verify if that's
|
|
|
|
// the correct behaviour?
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = SCENE_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_END;
|
2004-11-20 17:32:47 +00:00
|
|
|
event.time = _vm->_music->hasAdlib() ? IHNM_TITLE_TIME_FM : IHNM_TITLE_TIME_GM;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::SC_IHNMHateProc(int param, SCENE_INFO *scene_info, void *refCon) {
|
2004-08-11 23:42:02 +00:00
|
|
|
return ((Scene *)refCon)->IHNMHateProc(param, scene_info);
|
|
|
|
}
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
int Scene::IHNMHateProc(int param, SCENE_INFO *scene_info) {
|
|
|
|
EVENT event;
|
|
|
|
EVENT *q_event;
|
2004-11-24 15:02:00 +00:00
|
|
|
int event_time = 0;
|
|
|
|
int voice_len;
|
|
|
|
int voice_pad = 50;
|
|
|
|
TEXTLIST_ENTRY text_entry;
|
|
|
|
TEXTLIST_ENTRY *entry_p;
|
|
|
|
int i;
|
|
|
|
int font_flags = FONT_OUTLINE | FONT_CENTERED;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
switch (param) {
|
|
|
|
case SCENE_BEGIN:
|
2004-11-24 15:02:00 +00:00
|
|
|
_vm->_anim->setFlag(0, ANIM_LOOP);
|
|
|
|
_vm->_anim->play(0, 0);
|
|
|
|
|
2004-11-24 10:37:33 +00:00
|
|
|
// More music
|
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = MUSIC_EVENT;
|
|
|
|
event.param = 32;
|
|
|
|
event.param2 = MUSIC_LOOP;
|
|
|
|
event.op = EVENT_PLAY;
|
|
|
|
event.time = 0;
|
|
|
|
|
|
|
|
q_event = _vm->_events->queue(&event);
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Background for intro scene is the first frame of the
|
|
|
|
// intro animation; display it and set the palette
|
2004-10-27 21:32:28 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = BG_EVENT;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.param = SET_PALETTE;
|
|
|
|
event.time = 0;
|
|
|
|
|
2004-08-10 19:00:30 +00:00
|
|
|
q_event = _vm->_events->queue(&event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-11-24 15:02:00 +00:00
|
|
|
// Queue narrator dialogue list
|
|
|
|
text_entry.color = 1;
|
|
|
|
text_entry.effect_color = 11;
|
|
|
|
text_entry.text_x = 640 / 2;
|
|
|
|
text_entry.text_y = 400;
|
|
|
|
text_entry.font_id = MEDIUM_FONT_ID;
|
|
|
|
text_entry.flags = font_flags;
|
|
|
|
|
|
|
|
// FIXME: There should be several scene changes here, but for
|
|
|
|
// now let's just do the easy part -- the narration.
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAYSIZE(IntroDiag); i++) {
|
|
|
|
text_entry.string = IntroDiag[i].i_str;
|
|
|
|
entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
|
|
|
|
|
|
|
|
// Display text
|
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = TEXT_EVENT;
|
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.data = entry_p;
|
|
|
|
event.time = event_time;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
|
|
|
|
|
|
|
// Play voice
|
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = VOICE_EVENT;
|
|
|
|
event.op = EVENT_PLAY;
|
|
|
|
event.param = IntroDiag[i].i_voice_rn;
|
|
|
|
event.time = event_time;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
|
|
|
|
|
|
|
voice_len = _vm->_sndRes->getVoiceLength(IntroDiag[i].i_voice_rn);
|
|
|
|
if (voice_len < 0) {
|
|
|
|
voice_len = strlen(IntroDiag[i].i_str) * VOICE_LETTERLEN;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove text
|
|
|
|
event.type = ONESHOT_EVENT;
|
|
|
|
event.code = TEXT_EVENT;
|
|
|
|
event.op = EVENT_REMOVE;
|
|
|
|
event.data = entry_p;
|
|
|
|
event.time = voice_len;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
|
|
|
|
|
|
|
event_time = voice_pad;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// End scene after last dialogue over
|
2004-11-18 17:34:54 +00:00
|
|
|
event.type = ONESHOT_EVENT;
|
2004-11-24 15:02:00 +00:00
|
|
|
event.code = SCENE_EVENT;
|
|
|
|
event.op = EVENT_END;
|
2004-11-18 17:34:54 +00:00
|
|
|
event.time = 0;
|
|
|
|
|
2004-11-24 15:02:00 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
|
|
|
#endif
|
2004-11-18 17:34:54 +00:00
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Saga
|