svn-id: r13698
This commit is contained in:
Paweł Kołodziejski 2004-05-01 09:19:35 +00:00
parent ae9f6dd86a
commit 1d649b1c06
5 changed files with 75 additions and 266 deletions

View file

@ -20,13 +20,8 @@
* $Header$
*
*/
/*
Description:
"I Have No Mouth" Intro sequence scene procedures
Notes:
*/
// "I Have No Mouth" Intro sequence scene procedures
#include <stdio.h>
#include <stdlib.h>
@ -36,9 +31,6 @@
#include "reinherit.h"
/*
* Uses the following modules:
\*--------------------------------------------------------------------------*/
#include "animation_mod.h"
#include "cvar_mod.h"
#include "events_mod.h"
@ -48,126 +40,93 @@
#include "text_mod.h"
#include "palanim_mod.h"
/*
* Begin module:
\*--------------------------------------------------------------------------*/
#include "scene.h"
#include "ihnm_introproc.h"
namespace Saga {
R_SCENE_RESLIST IHNM_IntroMovie1RL[] = {
{30, SAGA_BG_IMAGE, 0, 0}
,
{30, SAGA_BG_IMAGE, 0, 0} ,
{31, SAGA_ANIM_1, 0, 0}
};
R_SCENE_DESC IHNM_IntroMovie1Desc = {
0, 0, 0, 0, 0, 0, 0, 0,
IHNM_IntroMovie1RL,
ARRAYSIZE(IHNM_IntroMovie1RL)
};
R_SCENE_RESLIST IHNM_IntroMovie2RL[] = {
{32, SAGA_BG_IMAGE, 0, 0}
,
{32, SAGA_BG_IMAGE, 0, 0} ,
{33, SAGA_ANIM_1, 0, 0}
};
R_SCENE_DESC IHNM_IntroMovie2Desc = {
0, 0, 0, 0, 0, 0, 0, 0,
IHNM_IntroMovie2RL,
ARRAYSIZE(IHNM_IntroMovie2RL)
};
R_SCENE_RESLIST IHNM_IntroMovie3RL[] = {
{34, SAGA_BG_IMAGE, 0, 0}
,
{34, SAGA_BG_IMAGE, 0, 0},
{35, SAGA_ANIM_1, 0, 0}
};
R_SCENE_DESC IHNM_IntroMovie3Desc = {
0, 0, 0, 0, 0, 0, 0, 0,
IHNM_IntroMovie3RL,
ARRAYSIZE(IHNM_IntroMovie3RL)
};
R_SCENE_RESLIST IHNM_IntroMovie4RL[] = {
{1227, SAGA_BG_IMAGE, 0, 0}
,
{1227, SAGA_BG_IMAGE, 0, 0},
{1226, SAGA_ANIM_1, 0, 0}
};
R_SCENE_DESC IHNM_IntroMovie4Desc = {
0, 0, 0, 0, 0, 0, 0, 0,
IHNM_IntroMovie4RL,
ARRAYSIZE(IHNM_IntroMovie4RL)
};
R_SCENE_QUEUE IHNM_IntroList[] = {
{0, &IHNM_IntroMovie1Desc, BY_DESC, IHNM_IntroMovieProc1, 0}
,
{0, &IHNM_IntroMovie2Desc, BY_DESC, IHNM_IntroMovieProc2, 0}
,
{0, &IHNM_IntroMovie3Desc, BY_DESC, IHNM_IntroMovieProc3, 0}
,
{0, &IHNM_IntroMovie1Desc, BY_DESC, IHNM_IntroMovieProc1, 0} ,
{0, &IHNM_IntroMovie2Desc, BY_DESC, IHNM_IntroMovieProc2, 0} ,
{0, &IHNM_IntroMovie3Desc, BY_DESC, IHNM_IntroMovieProc3, 0} ,
{0, &IHNM_IntroMovie4Desc, BY_DESC, IHNM_HateProc, 0}
};
int IHNM_StartProc(void)
{
int IHNM_StartProc() {
size_t n_introscenes;
size_t i;
n_introscenes = ARRAYSIZE(IHNM_IntroList);
for (i = 0; i < n_introscenes; i++) {
SCENE_Queue(&IHNM_IntroList[i]);
}
return R_SUCCESS;
}
int IHNM_IntroMovieProc1(int param, R_SCENE_INFO * scene_info)
{
int IHNM_IntroMovieProc1(int param, R_SCENE_INFO *scene_info) {
R_EVENT event;
YS_IGNORE_PARAM(scene_info);
switch (param) {
case SCENE_BEGIN:
/* Background for intro scene is the first frame of the
* intro animation; display it and set the palette
\*-----------------------------------------------------*/
// Background for intro scene is the first frame of the
// intro animation; display it and set the palette
event.type = R_ONESHOT_EVENT;
event.code = R_BG_EVENT;
event.op = EVENT_DISPLAY;
event.param = SET_PALETTE;
event.time = 0;
EVENT_Queue(&event);
ANIM_SetFrameTime(0, R_IHNM_INTRO_FRAMETIME);
ANIM_SetFlag(0, ANIM_ENDSCENE);
ANIM_Play(0, 0);
break;
default:
break;
}
@ -175,24 +134,17 @@ int IHNM_IntroMovieProc1(int param, R_SCENE_INFO * scene_info)
return 0;
}
int IHNM_IntroMovieProc2(int param, R_SCENE_INFO * scene_info)
{
int IHNM_IntroMovieProc2(int param, R_SCENE_INFO *scene_info) {
R_EVENT event;
R_EVENT *q_event;
PALENTRY *pal;
static PALENTRY current_pal[R_PAL_ENTRIES];
YS_IGNORE_PARAM(scene_info);
switch (param) {
case SCENE_BEGIN:
/* Fade to black out of the intro CyberDreams logo anim
* \*----------------------------------------------------- */
// Fade to black out of the intro CyberDreams logo anim
SYSGFX_GetCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
@ -204,9 +156,8 @@ int IHNM_IntroMovieProc2(int param, R_SCENE_INFO * scene_info)
q_event = EVENT_Queue(&event);
/* Background for intro scene is the first frame of the
* intro animation; display it but don't set palette
\*-----------------------------------------------------*/
// Background for intro scene is the first frame of the
// intro animation; display it but don't set palette
event.type = R_ONESHOT_EVENT;
event.code = R_BG_EVENT;
event.op = EVENT_DISPLAY;
@ -215,8 +166,7 @@ int IHNM_IntroMovieProc2(int param, R_SCENE_INFO * scene_info)
q_event = EVENT_Chain(q_event, &event);
/* Fade in from black to the scene background palette
* \*----------------------------------------------------- */
// Fade in from black to the scene background palette
SCENE_GetBGPal(&pal);
event.type = R_CONTINUOUS_EVENT;
@ -231,17 +181,14 @@ int IHNM_IntroMovieProc2(int param, R_SCENE_INFO * scene_info)
ANIM_SetFlag(0, ANIM_LOOP);
ANIM_Play(0, R_IHNM_PALFADE_TIME * 2);
/* Queue end of scene after looping animation for a while
* \*----------------------------------------------------- */
// Queue end of scene after looping animation for a while
event.type = R_ONESHOT_EVENT;
event.code = R_SCENE_EVENT;
event.op = EVENT_END;
event.time = R_IHNM_DGLOGO_TIME;
q_event = EVENT_Chain(q_event, &event);
break;
default:
break;
}
@ -249,24 +196,16 @@ int IHNM_IntroMovieProc2(int param, R_SCENE_INFO * scene_info)
return 0;
}
int IHNM_IntroMovieProc3(int param, R_SCENE_INFO * scene_info)
{
int IHNM_IntroMovieProc3(int param, R_SCENE_INFO *scene_info) {
R_EVENT event;
R_EVENT *q_event;
PALENTRY *pal;
static PALENTRY current_pal[R_PAL_ENTRIES];
YS_IGNORE_PARAM(scene_info);
switch (param) {
case SCENE_BEGIN:
/* Fade to black out of the intro DG logo anim
* \*----------------------------------------------------- */
// Fade to black out of the intro DG logo anim
SYSGFX_GetCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
@ -278,9 +217,8 @@ int IHNM_IntroMovieProc3(int param, R_SCENE_INFO * scene_info)
q_event = EVENT_Queue(&event);
/* Background for intro scene is the first frame of the
* intro animation; display it but don't set palette
\*-----------------------------------------------------*/
// Background for intro scene is the first frame of the
// intro animation; display it but don't set palette
event.type = R_ONESHOT_EVENT;
event.code = R_BG_EVENT;
event.op = EVENT_DISPLAY;
@ -289,8 +227,7 @@ int IHNM_IntroMovieProc3(int param, R_SCENE_INFO * scene_info)
q_event = EVENT_Chain(q_event, &event);
/* Fade in from black to the scene background palette
* \*----------------------------------------------------- */
// Fade in from black to the scene background palette
SCENE_GetBGPal(&pal);
event.type = R_CONTINUOUS_EVENT;
@ -304,17 +241,14 @@ int IHNM_IntroMovieProc3(int param, R_SCENE_INFO * scene_info)
ANIM_Play(0, 0);
/* Queue end of scene after a while
* \*----------------------------------------------------- */
// Queue end of scene after a while
event.type = R_ONESHOT_EVENT;
event.code = R_SCENE_EVENT;
event.op = EVENT_END;
event.time = R_IHNM_TITLE_TIME;
q_event = EVENT_Chain(q_event, &event);
break;
default:
break;
}
@ -322,21 +256,15 @@ int IHNM_IntroMovieProc3(int param, R_SCENE_INFO * scene_info)
return 0;
}
int IHNM_HateProc(int param, R_SCENE_INFO * scene_info)
{
int IHNM_HateProc(int param, R_SCENE_INFO *scene_info) {
R_EVENT event;
R_EVENT *q_event;
YS_IGNORE_PARAM(scene_info);
switch (param) {
case SCENE_BEGIN:
/* Background for intro scene is the first frame of the
* intro animation; display it and set the palette
\*-----------------------------------------------------*/
// Background for intro scene is the first frame of the
// intro animation; display it and set the palette
event.type = R_ONESHOT_EVENT;
event.code = R_BG_EVENT;
event.op = EVENT_DISPLAY;
@ -347,9 +275,7 @@ int IHNM_HateProc(int param, R_SCENE_INFO * scene_info)
ANIM_SetFlag(0, ANIM_LOOP);
ANIM_Play(0, 0);
break;
default:
break;
}