2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
2006-02-11 12:44:16 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
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/gfx.h"
|
|
|
|
|
|
|
|
#include "saga/animation.h"
|
2004-08-10 19:00:30 +00:00
|
|
|
#include "saga/events.h"
|
2005-10-07 15:36:28 +00:00
|
|
|
#include "saga/interface.h"
|
2004-11-24 15:02:00 +00:00
|
|
|
#include "saga/sndres.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 {
|
|
|
|
|
2005-07-19 19:05:52 +00:00
|
|
|
SceneResourceData IHNM_IntroMovie1RL[] = {
|
2005-07-25 17:35:35 +00:00
|
|
|
{30, 2, 0, 0, false} ,
|
|
|
|
{31, 14, 0, 0, false}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2005-01-15 20:12:49 +00:00
|
|
|
SceneDescription 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
|
|
|
};
|
|
|
|
|
2005-07-19 19:05:52 +00:00
|
|
|
SceneResourceData IHNM_IntroMovie2RL[] = {
|
2005-07-25 17:35:35 +00:00
|
|
|
{32, 2, 0, 0, false} ,
|
|
|
|
{33, 14, 0, 0, false}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2005-01-15 20:12:49 +00:00
|
|
|
SceneDescription 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
|
|
|
};
|
|
|
|
|
2005-07-19 19:05:52 +00:00
|
|
|
SceneResourceData IHNM_IntroMovie3RL[] = {
|
2005-07-25 17:35:35 +00:00
|
|
|
{34, 2, 0, 0, false},
|
|
|
|
{35, 14, 0, 0, false}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2005-01-15 20:12:49 +00:00
|
|
|
SceneDescription 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
|
|
|
};
|
|
|
|
|
2005-07-19 19:05:52 +00:00
|
|
|
SceneResourceData IHNM_IntroMovie4RL[] = {
|
2005-07-25 17:35:35 +00:00
|
|
|
{1227, 2, 0, 0, false},
|
|
|
|
{1226, 14, 0, 0, false}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2005-01-15 20:12:49 +00:00
|
|
|
SceneDescription 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
|
|
|
};
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
LoadSceneParams IHNM_IntroList[] = {
|
2005-08-06 18:28:43 +00:00
|
|
|
{0, kLoadByDescription, &IHNM_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
|
|
|
|
{0, kLoadByDescription, &IHNM_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc2, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
|
|
|
|
{0, kLoadByDescription, &IHNM_IntroMovie3Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
|
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;
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
LoadSceneParams firstScene;
|
2004-11-25 07:13:40 +00:00
|
|
|
|
2005-10-07 15:36:28 +00:00
|
|
|
// The original used the "play video" mechanism for the first part of
|
|
|
|
// the intro. We just use that panel mode.
|
|
|
|
|
2007-06-07 12:11:33 +00:00
|
|
|
_vm->_anim->setCutAwayMode(kPanelVideo);
|
2007-06-07 15:47:47 +00:00
|
|
|
_vm->_interface->setMode(kPanelVideo);
|
2005-10-07 15:36:28 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
firstScene.loadFlag = kLoadBySceneNumber;
|
2005-08-07 00:00:43 +00:00
|
|
|
firstScene.sceneDescriptor = -1;
|
2005-06-21 21:59:24 +00:00
|
|
|
firstScene.sceneDescription = NULL;
|
2005-05-08 14:04:06 +00:00
|
|
|
firstScene.sceneSkipTarget = true;
|
|
|
|
firstScene.sceneProc = NULL;
|
|
|
|
firstScene.transitionType = kTransitionFade;
|
|
|
|
firstScene.actorsEntrance = 0;
|
2005-08-06 18:28:43 +00:00
|
|
|
firstScene.chapter = -1;
|
2004-11-25 07:13:40 +00:00
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
_vm->_scene->queueScene(&firstScene);
|
2004-11-25 07:13:40 +00:00
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
return SUCCESS;
|
2004-04-12 21:40:49 +00:00
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc1(int param, void *refCon) {
|
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc1(param);
|
2004-08-11 23:42:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::IHNMIntroMovieProc1(int param) {
|
2005-08-10 14:11:22 +00:00
|
|
|
Event event;
|
|
|
|
Event *q_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
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kBgEvent;
|
|
|
|
event.op = kEventDisplay;
|
|
|
|
event.param = kEvPSetPalette;
|
2004-04-12 21:40:49 +00:00
|
|
|
event.time = 0;
|
2005-01-02 14:36:00 +00:00
|
|
|
|
|
|
|
q_event = _vm->_events->queue(&event);
|
|
|
|
|
2004-10-27 21:32:28 +00:00
|
|
|
_vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME);
|
2005-10-01 11:09:49 +00:00
|
|
|
_vm->_anim->setFlag(0, ANIM_FLAG_ENDSCENE);
|
2005-01-02 16:11:19 +00:00
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kAnimEvent;
|
|
|
|
event.op = kEventPlay;
|
2005-01-02 16:11:19 +00:00
|
|
|
event.param = 0;
|
|
|
|
event.time = 0;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc2(int param, void *refCon) {
|
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc2(param);
|
2004-08-11 23:42:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::IHNMIntroMovieProc2(int param) {
|
2005-08-10 14:11:22 +00:00
|
|
|
Event event;
|
|
|
|
Event *q_event;
|
2005-07-09 16:23:45 +00:00
|
|
|
PalEntry *pal;
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-07-09 16:23:45 +00:00
|
|
|
static PalEntry current_pal[PAL_ENTRIES];
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-01-02 14:36:00 +00:00
|
|
|
switch (param) {
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTContinuous;
|
|
|
|
event.code = kPalEvent;
|
|
|
|
event.op = kEventPalToBlack;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kBgEvent;
|
|
|
|
event.op = kEventDisplay;
|
|
|
|
event.param = kEvPNoSetPalette;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
|
|
|
2005-01-02 14:36:00 +00:00
|
|
|
_vm->_anim->setCycles(0, -1);
|
|
|
|
|
|
|
|
// Unlike the original, we keep the logo spinning during the
|
|
|
|
// palette fades. We don't have to, but I think it looks better
|
|
|
|
// that way.
|
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kAnimEvent;
|
|
|
|
event.op = kEventPlay;
|
2005-01-02 14:36:00 +00:00
|
|
|
event.param = 0;
|
|
|
|
event.time = 0;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Fade in from black to the scene background palette
|
2005-07-19 19:05:52 +00:00
|
|
|
_vm->_scene->getBGPal(pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTContinuous;
|
|
|
|
event.code = kPalEvent;
|
|
|
|
event.op = kEventBlackToPal;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
|
|
|
2005-01-02 14:36:00 +00:00
|
|
|
// Fade to black after looping animation for a while
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTContinuous;
|
|
|
|
event.code = kPalEvent;
|
|
|
|
event.op = kEventPalToBlack;
|
2005-01-02 14:36:00 +00:00
|
|
|
event.time = IHNM_DGLOGO_TIME;
|
|
|
|
event.duration = IHNM_PALFADE_TIME;
|
|
|
|
event.data = pal;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-01-02 14:36:00 +00:00
|
|
|
// Queue end of scene
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kSceneEvent;
|
|
|
|
event.op = kEventEnd;
|
2005-01-02 14:36:00 +00:00
|
|
|
event.time = 0;
|
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;
|
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::SC_IHNMIntroMovieProc3(int param, void *refCon) {
|
|
|
|
return ((Scene *)refCon)->IHNMIntroMovieProc3(param);
|
2004-08-11 23:42:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-08 14:04:06 +00:00
|
|
|
int Scene::IHNMIntroMovieProc3(int param) {
|
2005-08-10 14:11:22 +00:00
|
|
|
Event event;
|
|
|
|
Event *q_event;
|
2005-07-09 16:23:45 +00:00
|
|
|
PalEntry *pal;
|
|
|
|
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
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTContinuous;
|
|
|
|
event.code = kPalEvent;
|
|
|
|
event.op = kEventPalToBlack;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
|
|
|
2004-11-28 18:28:40 +00:00
|
|
|
// In the GM file, this music also appears as tracks 7, 13, 19,
|
|
|
|
// 25 and 31, but only track 1 sounds right with the FM music.
|
2004-11-24 10:37:33 +00:00
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kMusicEvent;
|
2004-11-19 07:41:59 +00:00
|
|
|
event.param = 1;
|
2005-07-19 19:05:52 +00:00
|
|
|
event.param2 = MUSIC_NORMAL;
|
2005-08-10 15:31:15 +00:00
|
|
|
event.op = kEventPlay;
|
2004-11-19 07:41:59 +00:00
|
|
|
event.time = 0;
|
|
|
|
|
2005-01-02 16:11:19 +00:00
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-11-19 07:41:59 +00:00
|
|
|
|
2004-11-28 18:28:40 +00:00
|
|
|
// Background for intro scene is the first frame of the intro
|
|
|
|
// animation; display it but don't set palette
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kBgEvent;
|
|
|
|
event.op = kEventDisplay;
|
|
|
|
event.param = kEvPNoSetPalette;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
2005-07-19 19:05:52 +00:00
|
|
|
_vm->_scene->getBGPal(pal);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTContinuous;
|
|
|
|
event.code = kPalEvent;
|
|
|
|
event.op = kEventBlackToPal;
|
2004-04-12 21:40:49 +00:00
|
|
|
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
|
|
|
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kAnimEvent;
|
|
|
|
event.op = kEventPlay;
|
2005-01-02 16:11:19 +00:00
|
|
|
event.param = 0;
|
|
|
|
event.time = 0;
|
|
|
|
|
|
|
|
q_event = _vm->_events->chain(q_event, &event);
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
// Queue end of scene after a while
|
2007-06-07 12:11:33 +00:00
|
|
|
// The delay has been increased so the speech won't start until the music has ended
|
2005-08-10 15:31:15 +00:00
|
|
|
event.type = kEvTOneshot;
|
|
|
|
event.code = kSceneEvent;
|
|
|
|
event.op = kEventEnd;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Saga
|