diff options
Diffstat (limited to 'saga')
-rw-r--r-- | saga/actionmap.cpp | 4 | ||||
-rw-r--r-- | saga/actionmap.h | 2 | ||||
-rw-r--r-- | saga/actor.cpp | 24 | ||||
-rw-r--r-- | saga/actor.h | 12 | ||||
-rw-r--r-- | saga/animation.cpp | 72 | ||||
-rw-r--r-- | saga/animation.h | 16 | ||||
-rw-r--r-- | saga/cvar.cpp | 5 | ||||
-rw-r--r-- | saga/cvar.h | 1 | ||||
-rw-r--r-- | saga/cvar_mod.h | 4 | ||||
-rw-r--r-- | saga/objectmap.cpp | 4 | ||||
-rw-r--r-- | saga/objectmap.h | 2 | ||||
-rw-r--r-- | saga/render.cpp | 2 | ||||
-rw-r--r-- | saga/saga.cpp | 14 | ||||
-rw-r--r-- | saga/scene.cpp | 8 | ||||
-rw-r--r-- | saga/scene.h | 4 | ||||
-rw-r--r-- | saga/script.cpp | 12 | ||||
-rw-r--r-- | saga/script.h | 6 |
17 files changed, 99 insertions, 93 deletions
diff --git a/saga/actionmap.cpp b/saga/actionmap.cpp index 57238d51ff..96cbac96b0 100644 --- a/saga/actionmap.cpp +++ b/saga/actionmap.cpp @@ -37,7 +37,7 @@ static R_ACTIONMAP_INFO ActmapModule; int ACTIONMAP_Register(void) { CVAR_RegisterFunc(CF_action_info, - "action_info", NULL, R_CVAR_NONE, 0, 0); + "action_info", NULL, R_CVAR_NONE, 0, 0, NULL); return R_SUCCESS; } @@ -159,7 +159,7 @@ int ACTIONMAP_Draw(R_SURFACE * ds, int color) { return R_SUCCESS; } -void CF_action_info(int argc, char *argv[]) { +void CF_action_info(int argc, char *argv[], void *refCon) { R_POINT *pt; int i; diff --git a/saga/actionmap.h b/saga/actionmap.h index aaf1b033cc..05c768df7f 100644 --- a/saga/actionmap.h +++ b/saga/actionmap.h @@ -47,7 +47,7 @@ struct R_ACTIONMAP_INFO { size_t exmap_res_len; }; -void CF_action_info(int argc, char *argv[]); +void CF_action_info(int argc, char *argv[], void *refCon); } // End of namespace Saga diff --git a/saga/actor.cpp b/saga/actor.cpp index 5d627ad1a4..d69f9581dd 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -52,12 +52,12 @@ R_ACTIONTIMES ActionTDeltas[] = { }; int ACTOR_Register() { - CVAR_RegisterFunc(CF_actor_add, "actor_add", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3); - CVAR_RegisterFunc(CF_actor_del, "actor_del", "<Actor id>", R_CVAR_NONE, 1, 1); - CVAR_RegisterFunc(CF_actor_move, "actor_move", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3); - CVAR_RegisterFunc(CF_actor_moverel, "actor_moverel", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3); - CVAR_RegisterFunc(CF_actor_seto, "actor_seto", "<Actor id> <Orientation>", R_CVAR_NONE, 2, 2); - CVAR_RegisterFunc(CF_actor_setact, "actor_setact", "<Actor id> <Action #>", R_CVAR_NONE, 2, 2); + CVAR_RegisterFunc(CF_actor_add, "actor_add", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3, NULL); + CVAR_RegisterFunc(CF_actor_del, "actor_del", "<Actor id>", R_CVAR_NONE, 1, 1, NULL); + CVAR_RegisterFunc(CF_actor_move, "actor_move", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3, NULL); + CVAR_RegisterFunc(CF_actor_moverel, "actor_moverel", "<Actor id> <lx> <ly>", R_CVAR_NONE, 3, 3, NULL); + CVAR_RegisterFunc(CF_actor_seto, "actor_seto", "<Actor id> <Orientation>", R_CVAR_NONE, 2, 2, NULL); + CVAR_RegisterFunc(CF_actor_setact, "actor_setact", "<Actor id> <Action #>", R_CVAR_NONE, 2, 2, NULL); return R_SUCCESS; } @@ -1051,7 +1051,7 @@ int ACTOR_StoA(R_POINT *actor, const R_POINT *screen) { return R_SUCCESS; } -static void CF_actor_add(int argc, char *argv[]) { +static void CF_actor_add(int argc, char *argv[], void *refCon) { R_ACTOR actor; if (argc < 3) @@ -1067,7 +1067,7 @@ static void CF_actor_add(int argc, char *argv[]) { return; } -static void CF_actor_del(int argc, char *argv[]) { +static void CF_actor_del(int argc, char *argv[], void *refCon) { int id; if (argc < 0) @@ -1080,7 +1080,7 @@ static void CF_actor_del(int argc, char *argv[]) { return; } -static void CF_actor_move(int argc, char *argv[]) { +static void CF_actor_move(int argc, char *argv[], void *refCon) { int id; R_POINT move_pt; @@ -1097,7 +1097,7 @@ static void CF_actor_move(int argc, char *argv[]) { return; } -static void CF_actor_moverel(int argc, char *argv[]) { +static void CF_actor_moverel(int argc, char *argv[], void *refCon) { int id; R_POINT move_pt; @@ -1114,7 +1114,7 @@ static void CF_actor_moverel(int argc, char *argv[]) { return; } -static void CF_actor_seto(int argc, char *argv[]) { +static void CF_actor_seto(int argc, char *argv[], void *refCon) { int id; int orient; @@ -1129,7 +1129,7 @@ static void CF_actor_seto(int argc, char *argv[]) { return; } -static void CF_actor_setact(int argc, char *argv[]) { +static void CF_actor_setact(int argc, char *argv[], void *refCon) { int index = 0; int action_n = 0; diff --git a/saga/actor.h b/saga/actor.h index 2b7d70d6a2..64b0386067 100644 --- a/saga/actor.h +++ b/saga/actor.h @@ -171,12 +171,12 @@ int HandleWalkIntent(R_ACTOR *actor, R_WALKINTENT *a_walk_int, int *complete_p, int HandleSpeakIntent(R_ACTOR *actor, R_SPEAKINTENT *a_speakint, int *complete_p, int msec); int ACTOR_SetPathNode(R_WALKINTENT *walk_int, R_POINT *src_pt, R_POINT *dst_pt, R_SEMAPHORE *sem); int LoadActorSpriteIndex(R_ACTOR *actor, int si_rn, int *last_frame_p); -static void CF_actor_add(int argc, char *argv[]); -static void CF_actor_del(int argc, char *argv[]); -static void CF_actor_move(int argc, char *argv[]); -static void CF_actor_moverel(int argc, char *argv[]); -static void CF_actor_seto(int argc, char *argv[]); -static void CF_actor_setact(int argc, char *argv[]); +static void CF_actor_add(int argc, char *argv[], void *refCon); +static void CF_actor_del(int argc, char *argv[], void *refCon); +static void CF_actor_move(int argc, char *argv[], void *refCon); +static void CF_actor_moverel(int argc, char *argv[], void *refCon); +static void CF_actor_seto(int argc, char *argv[], void *refCon); +static void CF_actor_setact(int argc, char *argv[], void *refCon); } // End of namespace Saga diff --git a/saga/animation.cpp b/saga/animation.cpp index 3f6848a0f1..6547c8b361 100644 --- a/saga/animation.cpp +++ b/saga/animation.cpp @@ -35,29 +35,27 @@ namespace Saga { -static void CF_anim_info(int argc, char *argv[]); - -static R_ANIMINFO AnimInfo; +static void CF_anim_info(int argc, char *argv[], void *refCon); int Anim::reg() { - CVAR_RegisterFunc(CF_anim_info, "anim_info", NULL, R_CVAR_NONE, 0, 0); + CVAR_RegisterFunc(CF_anim_info, "anim_info", NULL, R_CVAR_NONE, 0, 0, this); return R_SUCCESS; } Anim::Anim(void) { - AnimInfo.anim_limit = R_MAX_ANIMATIONS; - AnimInfo.anim_count = 0; - AnimInfo.initialized = 1; + _anim_limit = R_MAX_ANIMATIONS; + _anim_count = 0; + _initialized = true; } Anim::~Anim(void) { uint16 i; for (i = 0; i < R_MAX_ANIMATIONS; i++) { - free(AnimInfo.anim_tbl[i]); + free(_anim_tbl[i]); } - AnimInfo.initialized = 0; + _initialized = false; } int Anim::load(const byte *anim_resdata, size_t anim_resdata_len, uint16 *anim_id_p) { @@ -66,13 +64,13 @@ int Anim::load(const byte *anim_resdata, size_t anim_resdata_len, uint16 *anim_i uint16 anim_id = 0; uint16 i; - if (!AnimInfo.initialized) { + if (!_initialized) { return R_FAILURE; } // Find an unused animation slot for (i = 0; i < R_MAX_ANIMATIONS; i++) { - if (AnimInfo.anim_tbl[i] == NULL) { + if (_anim_tbl[i] == NULL) { anim_id = i; break; } @@ -124,11 +122,11 @@ int Anim::load(const byte *anim_resdata, size_t anim_resdata_len, uint16 *anim_i new_anim->link_flag = 0; new_anim->link_id = 0; - AnimInfo.anim_tbl[anim_id] = new_anim; + _anim_tbl[anim_id] = new_anim; *anim_id_p = anim_id; - AnimInfo.anim_count++; + _anim_count++; return R_SUCCESS; } @@ -137,12 +135,12 @@ int Anim::link(uint16 anim_id1, uint16 anim_id2) { R_ANIMATION *anim1; R_ANIMATION *anim2; - if ((anim_id1 >= AnimInfo.anim_count) || (anim_id2 >= AnimInfo.anim_count)) { + if ((anim_id1 >= _anim_count) || (anim_id2 >= _anim_count)) { return R_FAILURE; } - anim1 = AnimInfo.anim_tbl[anim_id1]; - anim2 = AnimInfo.anim_tbl[anim_id2]; + anim1 = _anim_tbl[anim_id1]; + anim2 = _anim_tbl[anim_id2]; if ((anim1 == NULL) || (anim2 == NULL)) { return R_FAILURE; @@ -174,7 +172,7 @@ int Anim::play(uint16 anim_id, int vector_time) { R_GAME_DISPLAYINFO disp_info; - if (anim_id >= AnimInfo.anim_count) { + if (anim_id >= _anim_count) { return R_FAILURE; } @@ -183,7 +181,7 @@ int Anim::play(uint16 anim_id, int vector_time) { _vm->_render->getBufferInfo(&buf_info); display_buf = buf_info.r_bg_buf; - anim = AnimInfo.anim_tbl[anim_id]; + anim = _anim_tbl[anim_id]; if (anim == NULL) { return R_FAILURE; } @@ -228,7 +226,7 @@ int Anim::play(uint16 anim_id, int vector_time) { anim->current_frame = 1; link_anim_id = anim->link_id; - link_anim = AnimInfo.anim_tbl[link_anim_id]; + link_anim = _anim_tbl[link_anim_id]; if (link_anim != NULL) { link_anim->current_frame = 1; @@ -277,7 +275,7 @@ int Anim::reset() { freeId(i); } - AnimInfo.anim_count = 0; + _anim_count = 0; return R_SUCCESS; } @@ -285,11 +283,11 @@ int Anim::reset() { int Anim::setFlag(uint16 anim_id, uint16 flag) { R_ANIMATION *anim; - if (anim_id > AnimInfo.anim_count) { + if (anim_id > _anim_count) { return R_FAILURE; } - anim = AnimInfo.anim_tbl[anim_id]; + anim = _anim_tbl[anim_id]; if (anim == NULL) { return R_FAILURE; } @@ -302,11 +300,11 @@ int Anim::setFlag(uint16 anim_id, uint16 flag) { int Anim::setFrameTime(uint16 anim_id, int time) { R_ANIMATION *anim; - if (anim_id > AnimInfo.anim_count) { + if (anim_id > _anim_count) { return R_FAILURE; } - anim = AnimInfo.anim_tbl[anim_id]; + anim = _anim_tbl[anim_id]; if (anim == NULL) { return R_FAILURE; } @@ -319,11 +317,11 @@ int Anim::setFrameTime(uint16 anim_id, int time) { int Anim::freeId(uint16 anim_id) { R_ANIMATION *anim; - if (anim_id > AnimInfo.anim_count) { + if (anim_id > _anim_count) { return R_FAILURE; } - anim = AnimInfo.anim_tbl[anim_id]; + anim = _anim_tbl[anim_id]; if (anim == NULL) { return R_FAILURE; } @@ -334,8 +332,8 @@ int Anim::freeId(uint16 anim_id) { } free(anim); - AnimInfo.anim_tbl[anim_id] = NULL; - AnimInfo.anim_count--; + _anim_tbl[anim_id] = NULL; + _anim_count--; return R_SUCCESS; } @@ -352,7 +350,7 @@ int Anim::getNumFrames(const byte *anim_resource, size_t anim_resource_len, uint int x; - if (!AnimInfo.initialized) { + if (!_initialized) { return R_FAILURE; } @@ -414,7 +412,7 @@ int Anim::ITE_DecodeFrame(const byte *resdata, size_t resdata_len, size_t frame_ uint16 i; - if (!AnimInfo.initialized) { + if (!_initialized) { return R_FAILURE; } @@ -788,7 +786,7 @@ int Anim::getFrameOffset(const byte *resdata, size_t resdata_len, uint16 find_fr int i; - if (!AnimInfo.initialized) { + if (!_initialized) { return R_FAILURE; } @@ -890,7 +888,7 @@ int Anim::getFrameOffset(const byte *resdata, size_t resdata_len, uint16 find_fr return R_SUCCESS; } -static void CF_anim_info(int argc, char *argv[]) { +void Anim::animInfo(int argc, char *argv[]) { uint16 anim_ct; uint16 i; uint16 idx; @@ -898,19 +896,21 @@ static void CF_anim_info(int argc, char *argv[]) { (void)(argc); (void)(argv); - anim_ct = AnimInfo.anim_count; + anim_ct = _anim_count; CON_Print("There are %d animations loaded:", anim_ct); for (idx = 0, i = 0; i < anim_ct; idx++, i++) { - while (AnimInfo.anim_tbl[idx] == NULL) { + while (_anim_tbl[idx] == NULL) { idx++; } - CON_Print("%02d: Frames: %u Flags: %u", i, AnimInfo.anim_tbl[idx]->n_frames, AnimInfo.anim_tbl[idx]->flags); + CON_Print("%02d: Frames: %u Flags: %u", i, _anim_tbl[idx]->n_frames, _anim_tbl[idx]->flags); } +} - return; +static void CF_anim_info(int argc, char *argv[], void *refCon) { + ((Anim *)refCon)->animInfo(argc, argv); } } // End of namespace Saga diff --git a/saga/animation.h b/saga/animation.h index 6befec524d..837c2f6a2b 100644 --- a/saga/animation.h +++ b/saga/animation.h @@ -86,13 +86,6 @@ struct R_ANIMATION { uint16 flags; }; -struct R_ANIMINFO { - int initialized; - uint16 anim_count; - uint16 anim_limit; - R_ANIMATION *anim_tbl[R_MAX_ANIMATIONS]; -}; - enum ANIM_FLAGS { ANIM_LOOP = 0x01, ANIM_ENDSCENE = 0x80 // When animation ends, dispatch scene end event @@ -110,12 +103,21 @@ public: int setFlag(uint16 anim_id, uint16 flag); int setFrameTime(uint16 anim_id, int time); int reset(void); + void animInfo(int argc, char *argv[]); + private: int getNumFrames(const byte *anim_resource, size_t anim_resource_len, uint16 *n_frames); int ITE_DecodeFrame(const byte *anim_resource, size_t anim_resource_len, size_t frame_offset, byte *buf, size_t buf_len); int IHNM_DecodeFrame(byte *decode_buf, size_t decode_buf_len, const byte *thisf_p, size_t thisf_len, const byte **nextf_p, size_t *nextf_len); int getFrameOffset(const byte *anim_resource, size_t anim_resource_len, uint16 find_frame, size_t *frame_offset); + + bool _initialized; + + uint16 _anim_count; + uint16 _anim_limit; + R_ANIMATION *_anim_tbl[R_MAX_ANIMATIONS]; + }; } // End of namespace Saga diff --git a/saga/cvar.cpp b/saga/cvar.cpp index 84fd9888ff..fe531f9162 100644 --- a/saga/cvar.cpp +++ b/saga/cvar.cpp @@ -160,7 +160,7 @@ int CVAR_Exec(R_CVAR_P cvar_func, char *r_value) { } // Call function - (cvar_func->t.func.func_p) (cf_argc, cf_argv); + (cvar_func->t.func.func_p) (cf_argc, cf_argv, cvar_func->refCon); if (cf_argv) free(cf_argv); @@ -334,13 +334,14 @@ int CVAR_IsFunc(R_CVAR_P cvar_func) { // Registers a console function 'cvar' // (could think of a better place to put these...?) int CVAR_RegisterFunc(cv_func_t func, const char *func_name, - const char *func_argstr, uint16 flags, int min_args, int max_args) { + const char *func_argstr, uint16 flags, int min_args, int max_args, void *refCon) { R_CVAR new_cvar; int hash; new_cvar.name = func_name; new_cvar.type = R_CVAR_FUNC; new_cvar.section = NULL; + new_cvar.refCon = refCon; new_cvar.flags = flags; new_cvar.t.func.func_p = func; new_cvar.t.func.func_argstr = func_argstr; diff --git a/saga/cvar.h b/saga/cvar.h index 806885edd1..f63d6cd88d 100644 --- a/saga/cvar.h +++ b/saga/cvar.h @@ -66,6 +66,7 @@ typedef struct R_CVAR_tag { const char *name; const char *section; uint16 flags; + void *refCon; union { R_SUBCVAR_INT i; diff --git a/saga/cvar_mod.h b/saga/cvar_mod.h index ddeaf3d40b..d31b1cded7 100644 --- a/saga/cvar_mod.h +++ b/saga/cvar_mod.h @@ -37,7 +37,7 @@ typedef int cv_int_t; typedef unsigned int cv_uint16_t; typedef float cv_float_t; typedef char cv_char_t; -typedef void (*cv_func_t) (int cv_argc, char *cv_argv[]); +typedef void (*cv_func_t) (int cv_argc, char *cv_argv[], void *refCon); /******************************************/ typedef struct R_CVAR_tag *R_CVAR_P; // opaque typedef @@ -70,7 +70,7 @@ int CVAR_GetError(const char **err_str); int CVAR_IsFunc(R_CVAR_P cvar_func); int CVAR_Exec(R_CVAR_P cvar_func, char *r_value); int CVAR_RegisterFunc(cv_func_t func, const char *func_name, - const char *func_argstr, uint16 flags, int min_args, int max_args); + const char *func_argstr, uint16 flags, int min_args, int max_args, void *refCon); int CVAR_Register_I(cv_int_t * var_p, const char *var_name, const char *section, uint16 flags, cv_int_t lbound, cv_int_t ubound); int CVAR_Register_UI(cv_uint16_t * var_p, const char *var_name, diff --git a/saga/objectmap.cpp b/saga/objectmap.cpp index 23fc284396..5da2eb22a3 100644 --- a/saga/objectmap.cpp +++ b/saga/objectmap.cpp @@ -42,7 +42,7 @@ namespace Saga { static R_OBJECTMAP_INFO OMInfo; int OBJECTMAP_Register() { - CVAR_RegisterFunc(CF_object_info, "object_info", NULL, R_CVAR_NONE, 0, 0); + CVAR_RegisterFunc(CF_object_info, "object_info", NULL, R_CVAR_NONE, 0, 0, NULL); return R_SUCCESS; } @@ -426,7 +426,7 @@ int OBJECTMAP_HitTest(R_POINT * imouse_pt, int *object_num) { return R_FAILURE; } -static void CF_object_info(int argc, char *argv[]) { +static void CF_object_info(int argc, char *argv[], void *refCon) { int i; (void)(argc); diff --git a/saga/objectmap.h b/saga/objectmap.h index 4981b0572b..b24af2c06a 100644 --- a/saga/objectmap.h +++ b/saga/objectmap.h @@ -56,7 +56,7 @@ struct R_OBJECTMAP_INFO { const char **names; }; -static void CF_object_info(int argc, char *argv[]); +static void CF_object_info(int argc, char *argv[], void *refCon); } // End of namespace Saga diff --git a/saga/render.cpp b/saga/render.cpp index b56a965123..50c84866a0 100644 --- a/saga/render.cpp +++ b/saga/render.cpp @@ -96,6 +96,8 @@ Render::Render(OSystem *system) : _system(system), _initialized(false) { Render::~Render(void) { free(_bg_buf); free(_tmp_buf); + + _initialized = false; } bool Render::initialized() { diff --git a/saga/saga.cpp b/saga/saga.cpp index 7433e294a7..5afe5d3b7a 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -82,8 +82,8 @@ struct R_MAIN_DATA { int music_enabled; }; -static void CF_quitfunc(int argc, char *argv[]); -static void CF_testfunc(int argc, char *argv[]); +static void CF_quitfunc(int argc, char *argv[], void *refCon); +static void CF_testfunc(int argc, char *argv[], void *refCon); static R_MAIN_DATA MainData; @@ -128,13 +128,13 @@ void SagaEngine::go() { MainData.sound_enabled = 1; MainData.music_enabled = 1; - CVAR_RegisterFunc(CF_testfunc, "testfunc", "foo [ optional foo ]", R_CVAR_NONE, 0, -1); + CVAR_RegisterFunc(CF_testfunc, "testfunc", "foo [ optional foo ]", R_CVAR_NONE, 0, -1, this); CVAR_Register_I(&MainData.sound_enabled, "sound", NULL, R_CVAR_CFG, 0, 1); CVAR_Register_I(&MainData.music_enabled, "music", NULL, R_CVAR_CFG, 0, 1); - CVAR_RegisterFunc(CF_quitfunc, "quit", NULL, R_CVAR_NONE, 0, 0); + CVAR_RegisterFunc(CF_quitfunc, "quit", NULL, R_CVAR_NONE, 0, 0, this); // Process config file // FIXME @@ -254,12 +254,12 @@ void SagaEngine::shutdown() { _system->quit(); } -static void CF_quitfunc(int argc, char *argv[]) { - _vm->shutdown(); +static void CF_quitfunc(int argc, char *argv[], void *refCon) { + ((SagaEngine *)refCon)->shutdown(); exit(0); } -static void CF_testfunc(int argc, char *argv[]) { +static void CF_testfunc(int argc, char *argv[], void *refCon) { int i; CON_Print("Test function invoked: Got %d arguments.", argc); diff --git a/saga/scene.cpp b/saga/scene.cpp index e59d45c78e..6c0924d0ea 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -51,8 +51,8 @@ static R_SCENE_MODULE SceneModule; int SCENE_Register() { CVAR_Register_I(&SceneModule.scene_number, "scene", NULL, R_CVAR_READONLY, 0, 0); - CVAR_RegisterFunc(CF_scenechange, "scene_change", "<Scene number>", R_CVAR_NONE, 1, 1); - CVAR_RegisterFunc(CF_sceneinfo, "scene_info", NULL, R_CVAR_NONE, 0, 0); + CVAR_RegisterFunc(CF_scenechange, "scene_change", "<Scene number>", R_CVAR_NONE, 1, 1, NULL); + CVAR_RegisterFunc(CF_sceneinfo, "scene_info", NULL, R_CVAR_NONE, 0, 0, NULL); return R_SUCCESS; } @@ -806,7 +806,7 @@ int SCENE_End() { return R_SUCCESS; } -void CF_scenechange(int argc, char *argv[]) { +void CF_scenechange(int argc, char *argv[], void *refCon) { int scene_num = 0; if ((argc == 0) || (argc > 1)) { @@ -829,7 +829,7 @@ void CF_scenechange(int argc, char *argv[]) { } } -void CF_sceneinfo(int argc, char *argv[]) { +void CF_sceneinfo(int argc, char *argv[], void *refCon) { const char *fmt = "%-20s %d"; CON_Print(fmt, "Scene number:", SceneModule.scene_number); diff --git a/saga/scene.h b/saga/scene.h index d6480038c1..ddf0371706 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -142,8 +142,8 @@ int SCENE_Load(int scene, int load_flag, R_SCENE_PROC scene_proc, R_SCENE_DESC * int LoadSceneDescriptor(uint32 res_number); int LoadSceneResourceList(uint32 res_number); int ProcessSceneResources(); -void CF_scenechange(int argc, char *argv[]); -void CF_sceneinfo(int argc, char *argv[]); +void CF_scenechange(int argc, char *argv[], void *refCon); +void CF_sceneinfo(int argc, char *argv[], void *refCon); int IHNM_StartProc(); diff --git a/saga/script.cpp b/saga/script.cpp index a449ac6934..d3019910e9 100644 --- a/saga/script.cpp +++ b/saga/script.cpp @@ -43,9 +43,9 @@ namespace Saga { R_SCRIPT_MODULE ScriptModule; int SCRIPT_Register() { - CVAR_RegisterFunc(CF_script_info, "script_info", NULL, R_CVAR_NONE, 0, 0); - CVAR_RegisterFunc(CF_script_exec, "script_exec", "<Script number>", R_CVAR_NONE, 1, 1); - CVAR_RegisterFunc(CF_script_togglestep, "script_togglestep", NULL, R_CVAR_NONE, 0, 0); + CVAR_RegisterFunc(CF_script_info, "script_info", NULL, R_CVAR_NONE, 0, 0, NULL); + CVAR_RegisterFunc(CF_script_exec, "script_exec", "<Script number>", R_CVAR_NONE, 1, 1, NULL); + CVAR_RegisterFunc(CF_script_togglestep, "script_togglestep", NULL, R_CVAR_NONE, 0, 0, NULL); return R_SUCCESS; } @@ -490,7 +490,7 @@ R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const byte *voicelut_p, size_t voicelut_len, R_ return voice_lut; } -void CF_script_info(int argc, char *argv[]) { +void CF_script_info(int argc, char *argv[], void *refCon) { uint32 n_entrypoints; uint32 i; char *name_ptr; @@ -514,7 +514,7 @@ void CF_script_info(int argc, char *argv[]) { } } -void CF_script_exec(int argc, char *argv[]) { +void CF_script_exec(int argc, char *argv[], void *refCon) { uint16 ep_num; if (argc < 1) { @@ -540,7 +540,7 @@ void CF_script_exec(int argc, char *argv[]) { STHREAD_Execute(ScriptModule.dbg_thread, ep_num); } -void CF_script_togglestep(int argc, char *argv[]) { +void CF_script_togglestep(int argc, char *argv[], void *refCon) { ScriptModule.dbg_singlestep = !ScriptModule.dbg_singlestep; } diff --git a/saga/script.h b/saga/script.h index a7f03b3a4f..285db6bedc 100644 --- a/saga/script.h +++ b/saga/script.h @@ -111,9 +111,9 @@ R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(byte *bytecode_p, size_t bytecode_len); R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const byte *dialogue_p, size_t dialogue_len); R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const byte *voicelut_p, size_t voicelut_len, R_SCRIPTDATA *script); int SCRIPT_Disassemble(R_SCRIPT_BYTECODE *script_list, R_DIALOGUE_LIST *diag_list); -void CF_script_info(int argc, char *argv[]); -void CF_script_exec(int argc, char *argv[]); -void CF_script_togglestep(int argc, char *argv[]); +void CF_script_info(int argc, char *argv[], void *refCon); +void CF_script_exec(int argc, char *argv[], void *refCon); +void CF_script_togglestep(int argc, char *argv[], void *refCon); } // End of namespace Saga |