mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
move sceneproc.cpp/h into scene.cpp/h
svn-id: r14416
This commit is contained in:
parent
5833e67076
commit
69cf6a070a
@ -143,7 +143,7 @@ int ITE_StartProc() {
|
|||||||
first_scene.load_flag = BY_SCENE;
|
first_scene.load_flag = BY_SCENE;
|
||||||
first_scene.scene_n = gs_desc.first_scene;
|
first_scene.scene_n = gs_desc.first_scene;
|
||||||
first_scene.scene_skiptarget = 1;
|
first_scene.scene_skiptarget = 1;
|
||||||
first_scene.scene_proc = InitialSceneProc;
|
first_scene.scene_proc = initialScene;
|
||||||
|
|
||||||
SCENE_Queue(&first_scene);
|
SCENE_Queue(&first_scene);
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ MODULE_OBJS = \
|
|||||||
saga/rscfile.o \
|
saga/rscfile.o \
|
||||||
saga/saga.o \
|
saga/saga.o \
|
||||||
saga/scene.o \
|
saga/scene.o \
|
||||||
saga/sceneproc.o \
|
|
||||||
saga/script.o \
|
saga/script.o \
|
||||||
saga/sdata.o \
|
saga/sdata.o \
|
||||||
saga/sdebug.o \
|
saga/sdebug.o \
|
||||||
|
122
saga/scene.cpp
122
saga/scene.cpp
@ -39,6 +39,8 @@
|
|||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "rscfile_mod.h"
|
#include "rscfile_mod.h"
|
||||||
#include "text_mod.h"
|
#include "text_mod.h"
|
||||||
|
#include "sound.h"
|
||||||
|
#include "music.h"
|
||||||
|
|
||||||
#include "scene_mod.h"
|
#include "scene_mod.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
@ -302,7 +304,7 @@ int SCENE_Change(int scene_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SCENE_End();
|
SCENE_End();
|
||||||
SCENE_Load(scene_num, BY_SCENE, DefaultSceneProc, NULL);
|
SCENE_Load(scene_num, BY_SCENE, defaultScene, NULL);
|
||||||
|
|
||||||
return R_SUCCESS;
|
return R_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -476,7 +478,7 @@ int SCENE_Load(int scene_num, int load_flag, R_SCENE_PROC scene_proc, R_SCENE_DE
|
|||||||
SceneModule.scene_loaded = 1;
|
SceneModule.scene_loaded = 1;
|
||||||
|
|
||||||
if (scene_proc == NULL) {
|
if (scene_proc == NULL) {
|
||||||
SceneModule.scene_proc = DefaultSceneProc;
|
SceneModule.scene_proc = defaultScene;
|
||||||
} else {
|
} else {
|
||||||
SceneModule.scene_proc = scene_proc;
|
SceneModule.scene_proc = scene_proc;
|
||||||
}
|
}
|
||||||
@ -840,4 +842,120 @@ void CF_sceneinfo(int argc, char *argv[], void *refCon) {
|
|||||||
CON_Print(fmt, "Music R#", SceneModule.desc.music_rn);
|
CON_Print(fmt, "Music R#", SceneModule.desc.music_rn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int initialScene(int param, R_SCENE_INFO *scene_info) {
|
||||||
|
R_EVENT event;
|
||||||
|
R_EVENT *q_event;
|
||||||
|
int delay_time = 0;
|
||||||
|
static PALENTRY current_pal[R_PAL_ENTRIES];
|
||||||
|
PALENTRY *pal;
|
||||||
|
|
||||||
|
switch (param) {
|
||||||
|
case SCENE_BEGIN:
|
||||||
|
_vm->_music->stop();
|
||||||
|
_vm->_sound->stopVoice();
|
||||||
|
|
||||||
|
// Fade palette to black from intro scene
|
||||||
|
GFX_GetCurrentPal(current_pal);
|
||||||
|
|
||||||
|
event.type = R_CONTINUOUS_EVENT;
|
||||||
|
event.code = R_PAL_EVENT;
|
||||||
|
event.op = EVENT_PALTOBLACK;
|
||||||
|
event.time = 0;
|
||||||
|
event.duration = PALETTE_FADE_DURATION;
|
||||||
|
event.data = current_pal;
|
||||||
|
|
||||||
|
delay_time += PALETTE_FADE_DURATION;
|
||||||
|
|
||||||
|
q_event = EVENT_Queue(&event);
|
||||||
|
|
||||||
|
// Activate user interface
|
||||||
|
event.type = R_ONESHOT_EVENT;
|
||||||
|
event.code = R_INTERFACE_EVENT;
|
||||||
|
event.op = EVENT_ACTIVATE;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
q_event = EVENT_Chain(q_event, &event);
|
||||||
|
|
||||||
|
// Set first scene background w/o changing palette
|
||||||
|
event.type = R_ONESHOT_EVENT;
|
||||||
|
event.code = R_BG_EVENT;
|
||||||
|
event.op = EVENT_DISPLAY;
|
||||||
|
event.param = NO_SET_PALETTE;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
q_event = EVENT_Chain(q_event, &event);
|
||||||
|
|
||||||
|
// Fade in to first scene background palette
|
||||||
|
SCENE_GetBGPal(&pal);
|
||||||
|
|
||||||
|
event.type = R_CONTINUOUS_EVENT;
|
||||||
|
event.code = R_PAL_EVENT;
|
||||||
|
event.op = EVENT_BLACKTOPAL;
|
||||||
|
event.time = delay_time;
|
||||||
|
event.duration = PALETTE_FADE_DURATION;
|
||||||
|
event.data = pal;
|
||||||
|
|
||||||
|
q_event = EVENT_Chain(q_event, &event);
|
||||||
|
|
||||||
|
event.code = R_PALANIM_EVENT;
|
||||||
|
event.op = EVENT_CYCLESTART;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
q_event = EVENT_Chain(q_event, &event);
|
||||||
|
|
||||||
|
_vm->_anim->setFlag(0, ANIM_LOOP);
|
||||||
|
_vm->_anim->play(0, delay_time);
|
||||||
|
|
||||||
|
debug(0, "InitialSceneproc(): Scene started");
|
||||||
|
break;
|
||||||
|
case SCENE_END:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
warning("Illegal scene procedure parameter");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int defaultScene(int param, R_SCENE_INFO *scene_info) {
|
||||||
|
R_EVENT event;
|
||||||
|
|
||||||
|
switch (param) {
|
||||||
|
case SCENE_BEGIN:
|
||||||
|
// Set scene background
|
||||||
|
event.type = R_ONESHOT_EVENT;
|
||||||
|
event.code = R_BG_EVENT;
|
||||||
|
event.op = EVENT_DISPLAY;
|
||||||
|
event.param = SET_PALETTE;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
EVENT_Queue(&event);
|
||||||
|
|
||||||
|
// Activate user interface
|
||||||
|
event.type = R_ONESHOT_EVENT;
|
||||||
|
event.code = R_INTERFACE_EVENT;
|
||||||
|
event.op = EVENT_ACTIVATE;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
EVENT_Queue(&event);
|
||||||
|
|
||||||
|
// Begin palette cycle animation if present
|
||||||
|
event.type = R_ONESHOT_EVENT;
|
||||||
|
event.code = R_PALANIM_EVENT;
|
||||||
|
event.op = EVENT_CYCLESTART;
|
||||||
|
event.time = 0;
|
||||||
|
|
||||||
|
EVENT_Queue(&event);
|
||||||
|
break;
|
||||||
|
case SCENE_END:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
warning("Illegal scene procedure parameter");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace Saga
|
} // End of namespace Saga
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
namespace Saga {
|
namespace Saga {
|
||||||
|
|
||||||
|
#define PALETTE_FADE_DURATION 1000
|
||||||
|
|
||||||
enum SCENE_LOAD_FLAGS {
|
enum SCENE_LOAD_FLAGS {
|
||||||
BY_RESOURCE = 0,
|
BY_RESOURCE = 0,
|
||||||
BY_SCENE,
|
BY_SCENE,
|
||||||
@ -147,8 +149,8 @@ void CF_sceneinfo(int argc, char *argv[], void *refCon);
|
|||||||
|
|
||||||
int IHNM_StartProc();
|
int IHNM_StartProc();
|
||||||
|
|
||||||
int InitialSceneProc(int param, R_SCENE_INFO *scene_info);
|
int initialScene(int param, R_SCENE_INFO *scene_info);
|
||||||
int DefaultSceneProc(int param, R_SCENE_INFO *scene_info);
|
int defaultScene(int param, R_SCENE_INFO *scene_info);
|
||||||
|
|
||||||
int ITE_StartProc();
|
int ITE_StartProc();
|
||||||
int ITE_IntroAnimProc(int param, R_SCENE_INFO *scene_info);
|
int ITE_IntroAnimProc(int param, R_SCENE_INFO *scene_info);
|
||||||
|
@ -1,159 +0,0 @@
|
|||||||
/* 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$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Initial and default scene procedures
|
|
||||||
|
|
||||||
#include "saga.h"
|
|
||||||
#include "yslib.h"
|
|
||||||
|
|
||||||
#include "gfx_mod.h"
|
|
||||||
#include "animation.h"
|
|
||||||
#include "events_mod.h"
|
|
||||||
#include "scene_mod.h"
|
|
||||||
#include "palanim_mod.h"
|
|
||||||
#include "sound.h"
|
|
||||||
#include "music.h"
|
|
||||||
|
|
||||||
#include "scene.h"
|
|
||||||
#include "sceneproc.h"
|
|
||||||
|
|
||||||
namespace Saga {
|
|
||||||
|
|
||||||
int InitialSceneProc(int param, R_SCENE_INFO *scene_info) {
|
|
||||||
R_EVENT event;
|
|
||||||
R_EVENT *q_event;
|
|
||||||
int delay_time = 0;
|
|
||||||
static PALENTRY current_pal[R_PAL_ENTRIES];
|
|
||||||
PALENTRY *pal;
|
|
||||||
|
|
||||||
switch (param) {
|
|
||||||
case SCENE_BEGIN:
|
|
||||||
_vm->_music->stop();
|
|
||||||
_vm->_sound->stopVoice();
|
|
||||||
|
|
||||||
// Fade palette to black from intro scene
|
|
||||||
GFX_GetCurrentPal(current_pal);
|
|
||||||
|
|
||||||
event.type = R_CONTINUOUS_EVENT;
|
|
||||||
event.code = R_PAL_EVENT;
|
|
||||||
event.op = EVENT_PALTOBLACK;
|
|
||||||
event.time = 0;
|
|
||||||
event.duration = PALETTE_FADE_DURATION;
|
|
||||||
event.data = current_pal;
|
|
||||||
|
|
||||||
delay_time += PALETTE_FADE_DURATION;
|
|
||||||
|
|
||||||
q_event = EVENT_Queue(&event);
|
|
||||||
|
|
||||||
// Activate user interface
|
|
||||||
event.type = R_ONESHOT_EVENT;
|
|
||||||
event.code = R_INTERFACE_EVENT;
|
|
||||||
event.op = EVENT_ACTIVATE;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
q_event = EVENT_Chain(q_event, &event);
|
|
||||||
|
|
||||||
// Set first scene background w/o changing palette
|
|
||||||
event.type = R_ONESHOT_EVENT;
|
|
||||||
event.code = R_BG_EVENT;
|
|
||||||
event.op = EVENT_DISPLAY;
|
|
||||||
event.param = NO_SET_PALETTE;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
q_event = EVENT_Chain(q_event, &event);
|
|
||||||
|
|
||||||
// Fade in to first scene background palette
|
|
||||||
SCENE_GetBGPal(&pal);
|
|
||||||
|
|
||||||
event.type = R_CONTINUOUS_EVENT;
|
|
||||||
event.code = R_PAL_EVENT;
|
|
||||||
event.op = EVENT_BLACKTOPAL;
|
|
||||||
event.time = delay_time;
|
|
||||||
event.duration = PALETTE_FADE_DURATION;
|
|
||||||
event.data = pal;
|
|
||||||
|
|
||||||
q_event = EVENT_Chain(q_event, &event);
|
|
||||||
|
|
||||||
event.code = R_PALANIM_EVENT;
|
|
||||||
event.op = EVENT_CYCLESTART;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
q_event = EVENT_Chain(q_event, &event);
|
|
||||||
|
|
||||||
_vm->_anim->setFlag(0, ANIM_LOOP);
|
|
||||||
_vm->_anim->play(0, delay_time);
|
|
||||||
|
|
||||||
debug(0, "InitialSceneproc(): Scene started");
|
|
||||||
break;
|
|
||||||
case SCENE_END:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
warning("Illegal scene procedure parameter");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DefaultSceneProc(int param, R_SCENE_INFO *scene_info) {
|
|
||||||
R_EVENT event;
|
|
||||||
|
|
||||||
switch (param) {
|
|
||||||
case SCENE_BEGIN:
|
|
||||||
// Set scene background
|
|
||||||
event.type = R_ONESHOT_EVENT;
|
|
||||||
event.code = R_BG_EVENT;
|
|
||||||
event.op = EVENT_DISPLAY;
|
|
||||||
event.param = SET_PALETTE;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
EVENT_Queue(&event);
|
|
||||||
|
|
||||||
// Activate user interface
|
|
||||||
event.type = R_ONESHOT_EVENT;
|
|
||||||
event.code = R_INTERFACE_EVENT;
|
|
||||||
event.op = EVENT_ACTIVATE;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
EVENT_Queue(&event);
|
|
||||||
|
|
||||||
// Begin palette cycle animation if present
|
|
||||||
event.type = R_ONESHOT_EVENT;
|
|
||||||
event.code = R_PALANIM_EVENT;
|
|
||||||
event.op = EVENT_CYCLESTART;
|
|
||||||
event.time = 0;
|
|
||||||
|
|
||||||
EVENT_Queue(&event);
|
|
||||||
break;
|
|
||||||
case SCENE_END:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
warning("Illegal scene procedure parameter");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Saga
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
/* 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$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Initial and default scene procedures header file
|
|
||||||
|
|
||||||
#ifndef SAGA_SCENEPROC_H
|
|
||||||
#define SAGA_SCENEPROC_H
|
|
||||||
|
|
||||||
namespace Saga {
|
|
||||||
|
|
||||||
#define PALETTE_FADE_DURATION 1000
|
|
||||||
|
|
||||||
} // End of namespace Saga
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user