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-08-02 16:20:35 +00:00
|
|
|
#include "saga/rscfile_mod.h"
|
|
|
|
|
|
|
|
#include "saga/scene.h"
|
|
|
|
#include "saga/ihnm_introproc.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
namespace Saga {
|
|
|
|
|
2004-08-04 20:28:57 +00:00
|
|
|
int IHNM_IntroMovieProc1(int param, R_SCENE_INFO *scene_info);
|
|
|
|
int IHNM_IntroMovieProc2(int param, R_SCENE_INFO *scene_info);
|
|
|
|
int IHNM_IntroMovieProc3(int param, R_SCENE_INFO *scene_info);
|
|
|
|
int IHNM_HateProc(int param, R_SCENE_INFO *scene_info);
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
R_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
|
|
|
};
|
|
|
|
|
|
|
|
R_SCENE_DESC IHNM_IntroMovie1Desc = {
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
R_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
|
|
|
};
|
|
|
|
|
|
|
|
R_SCENE_DESC IHNM_IntroMovie2Desc = {
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
R_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
|
|
|
};
|
|
|
|
|
|
|
|
R_SCENE_DESC IHNM_IntroMovie3Desc = {
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
R_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
|
|
|
};
|
|
|
|
|
|
|
|
R_SCENE_DESC IHNM_IntroMovie4Desc = {
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
R_SCENE_QUEUE IHNM_IntroList[] = {
|
2004-08-11 22:27:39 +00:00
|
|
|
{0, &IHNM_IntroMovie1Desc, BY_DESC, IHNM_IntroMovieProc1, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie2Desc, BY_DESC, IHNM_IntroMovieProc2, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie3Desc, BY_DESC, IHNM_IntroMovieProc3, 0, SCENE_NOFADE},
|
|
|
|
{0, &IHNM_IntroMovie4Desc, BY_DESC, IHNM_HateProc, 0, SCENE_NOFADE}
|
2004-04-12 21:40:49 +00:00
|
|
|
};
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
int IHNM_StartProc() {
|
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
|
|
|
}
|
|
|
|
|
|
|
|
return R_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2004-05-01 09:19:35 +00:00
|
|
|
int IHNM_IntroMovieProc1(int param, R_SCENE_INFO *scene_info) {
|
2004-04-25 14:42:14 +00:00
|
|
|
R_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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_BG_EVENT;
|
|
|
|
event.op = EVENT_DISPLAY;
|
|
|
|
event.param = SET_PALETTE;
|
|
|
|
event.time = 0;
|
2004-08-10 19:00:30 +00:00
|
|
|
_vm->_events->queue(&event);
|
2004-07-31 13:34:43 +00:00
|
|
|
_vm->_anim->setFrameTime(0, R_IHNM_INTRO_FRAMETIME);
|
|
|
|
_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-05-01 09:19:35 +00:00
|
|
|
int IHNM_IntroMovieProc2(int param, R_SCENE_INFO *scene_info) {
|
2004-04-25 14:42:14 +00:00
|
|
|
R_EVENT event;
|
2004-04-12 21:40:49 +00:00
|
|
|
R_EVENT *q_event;
|
|
|
|
PALENTRY *pal;
|
|
|
|
|
|
|
|
static PALENTRY current_pal[R_PAL_ENTRIES];
|
|
|
|
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
|
|
|
|
|
|
|
event.type = R_CONTINUOUS_EVENT;
|
|
|
|
event.code = R_PAL_EVENT;
|
|
|
|
event.op = EVENT_PALTOBLACK;
|
|
|
|
event.time = 0;
|
|
|
|
event.duration = R_IHNM_PALFADE_TIME;
|
|
|
|
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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_BG_EVENT;
|
|
|
|
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
|
|
|
|
|
|
|
event.type = R_CONTINUOUS_EVENT;
|
|
|
|
event.code = R_PAL_EVENT;
|
|
|
|
event.op = EVENT_BLACKTOPAL;
|
|
|
|
event.time = 0;
|
|
|
|
event.duration = R_IHNM_PALFADE_TIME;
|
|
|
|
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);
|
|
|
|
_vm->_anim->play(0, R_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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_SCENE_EVENT;
|
|
|
|
event.op = EVENT_END;
|
|
|
|
event.time = R_IHNM_DGLOGO_TIME;
|
|
|
|
|
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-05-01 09:19:35 +00:00
|
|
|
int IHNM_IntroMovieProc3(int param, R_SCENE_INFO *scene_info) {
|
2004-04-25 14:42:14 +00:00
|
|
|
R_EVENT event;
|
2004-04-12 21:40:49 +00:00
|
|
|
R_EVENT *q_event;
|
|
|
|
PALENTRY *pal;
|
|
|
|
static PALENTRY current_pal[R_PAL_ENTRIES];
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
event.type = R_CONTINUOUS_EVENT;
|
|
|
|
event.code = R_PAL_EVENT;
|
|
|
|
event.op = EVENT_PALTOBLACK;
|
|
|
|
event.time = 0;
|
|
|
|
event.duration = R_IHNM_PALFADE_TIME;
|
|
|
|
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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_BG_EVENT;
|
|
|
|
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
|
|
|
|
|
|
|
event.type = R_CONTINUOUS_EVENT;
|
|
|
|
event.code = R_PAL_EVENT;
|
|
|
|
event.op = EVENT_BLACKTOPAL;
|
|
|
|
event.time = 0;
|
|
|
|
event.duration = R_IHNM_PALFADE_TIME;
|
|
|
|
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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_SCENE_EVENT;
|
|
|
|
event.op = EVENT_END;
|
|
|
|
event.time = R_IHNM_TITLE_TIME;
|
|
|
|
|
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-05-01 09:19:35 +00:00
|
|
|
int IHNM_HateProc(int param, R_SCENE_INFO *scene_info) {
|
2004-04-25 14:42:14 +00:00
|
|
|
R_EVENT event;
|
2004-04-12 21:40:49 +00:00
|
|
|
R_EVENT *q_event;
|
|
|
|
|
|
|
|
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-04-12 21:40:49 +00:00
|
|
|
event.type = R_ONESHOT_EVENT;
|
|
|
|
event.code = R_BG_EVENT;
|
|
|
|
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-07-31 13:34:43 +00:00
|
|
|
_vm->_anim->setFlag(0, ANIM_LOOP);
|
|
|
|
_vm->_anim->play(0, 0);
|
2004-04-12 21:40:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Saga
|