From ade93aabffb38f96fb70856111c742b91e8c71ae Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 10 Oct 2003 16:14:52 +0000 Subject: cleanup svn-id: r10728 --- sword2/anims.cpp | 2 +- sword2/events.cpp | 16 +++++++--------- sword2/events.h | 2 +- sword2/sound.cpp | 6 ++---- sword2/sword2.cpp | 2 -- sword2/sync.cpp | 12 ++++++------ sword2/sync.h | 2 +- sword2/walker.cpp | 47 ++++++++++++++++++++++++----------------------- 8 files changed, 42 insertions(+), 47 deletions(-) (limited to 'sword2') diff --git a/sword2/anims.cpp b/sword2/anims.cpp index 988eea2449..55f014b1ed 100644 --- a/sword2/anims.cpp +++ b/sword2/anims.cpp @@ -44,7 +44,7 @@ namespace Sword2 { // stores resource id of wav to use as lead-out from smacker -uint32 smackerLeadOut = 0; +static uint32 smackerLeadOut = 0; int32 Animate(int32 *params, uint8 reverse_flag); int32 Mega_table_animate(int32 *params, uint8 reverse_flag); diff --git a/sword2/events.cpp b/sword2/events.cpp index 5a7ec32583..0174715bc3 100644 --- a/sword2/events.cpp +++ b/sword2/events.cpp @@ -74,12 +74,12 @@ int32 FN_request_speech(int32 *params) { if (j == MAX_events) Con_fatal_error("FN_set_event out of event slots"); - //found that slot + // found that slot - //id of person to stop + // id of person to stop event_list[j].id = params[0]; - //full script id to interact with - megas run their own 7th script + // full script id to interact with - megas run their own 7th script event_list[j].interact_id = (params[0] * 65536) + 6; return IR_CONT; @@ -276,15 +276,13 @@ int32 FN_pause_for_event(int32 *params) { } } -uint32 Check_event_waiting(void) { - // returns yes/no - +bool Check_event_waiting(void) { for (int j = 0; j < MAX_events; j++) { if (event_list[j].id == ID) - return 1; + return true; } - return 0; + return false; } int32 FN_clear_event(int32 *params) { @@ -334,7 +332,7 @@ int32 FN_start_event(int32 *params) { // oh dear - stop the system Con_fatal_error("FN_start_event can't find event for id %d", ID); - return 0; //never called - but lets stop them bloody errors + return 0; // never called - but lets stop them bloody errors } void Kill_all_ids_events(uint32 id) { diff --git a/sword2/events.h b/sword2/events.h index 600f8b3932..78ff68df52 100644 --- a/sword2/events.h +++ b/sword2/events.h @@ -39,7 +39,7 @@ void Set_player_action_event(uint32 id, uint32 interact_id); int32 FN_check_event_waiting(void); void Start_event(void); int32 FN_start_event(void); -uint32 Check_event_waiting(void); +bool Check_event_waiting(void); void Kill_all_ids_events(uint32 id); #ifdef _SWORD2_DEBUG diff --git a/sword2/sound.cpp b/sword2/sound.cpp index 9c6c72aa85..f1d04b701e 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -51,13 +51,11 @@ typedef struct { // max number of fx in queue at once [DO NOT EXCEED 255] #define FXQ_LENGTH 32 -_fxq_entry fxq[FXQ_LENGTH]; +static _fxq_entry fxq[FXQ_LENGTH]; // used to store id of tunes that loop, for save & restore uint32 looping_music_id = 0; -char musicDirectory[120]; - void Trigger_fx(uint8 j); // initialise the fxq by clearing all the entries @@ -254,7 +252,7 @@ int32 FN_play_fx(int32 *params) { } int32 FN_sound_fetch(int32 *params) { - return (IR_CONT); + return IR_CONT; } // to alter the volume and pan of a currently playing fx diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index b045b8bbb1..42e671762b 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -395,8 +395,6 @@ void Sword2Engine::go() { #endif } - // James (24mar97) - #ifdef _SWORD2_DEBUG // if not in console & 'renderSkip' is set, only render // display once every 4 game-cycles diff --git a/sword2/sync.cpp b/sword2/sync.cpp index c77059f02b..0e25e4d29a 100644 --- a/sword2/sync.cpp +++ b/sword2/sync.cpp @@ -34,7 +34,7 @@ typedef struct { // there wont be many will there. probably 2 at most i reckon #define MAX_syncs 10 -_sync_unit sync_list[MAX_syncs]; +static _sync_unit sync_list[MAX_syncs]; void Init_sync_system(void) { // set list to 0's @@ -43,8 +43,8 @@ void Init_sync_system(void) { } int32 FN_send_sync(int32 *params) { - //param 0 sync's recipient - //param 1 sync value + // param 0 sync's recipient + // 1 sync value for (int i = 0; i < MAX_syncs; i++) { if (sync_list[i].id == 0) { @@ -76,7 +76,7 @@ void Clear_syncs(uint32 id) { } } -uint32 Get_sync(void) { +bool Get_sync(void) { // check for a sync waiting for this character // - called from system code eg. from inside FN_anim(), to see if // animation to be quit @@ -84,12 +84,12 @@ uint32 Get_sync(void) { for (int i = 0; i < MAX_syncs; i++) { if (sync_list[i].id == ID) { // means sync found - return 1; + return true; } } // no sync found - return 0; + return false; } int32 FN_get_sync(int32 *params) { diff --git a/sword2/sync.h b/sword2/sync.h index 8bec326874..53bf4038da 100644 --- a/sword2/sync.h +++ b/sword2/sync.h @@ -26,7 +26,7 @@ namespace Sword2 { void Init_sync_system(void); void Clear_syncs(uint32 id); -uint32 Get_sync(void); +bool Get_sync(void); } // End of namespace Sword2 diff --git a/sword2/walker.cpp b/sword2/walker.cpp index 0f1d2bdde2..2ce5fd03a0 100644 --- a/sword2/walker.cpp +++ b/sword2/walker.cpp @@ -22,17 +22,6 @@ // script functions for moving megas about the place & also for keeping tabs // on them -// FN_walk() // walk to (x,y,dir) -// FN_walk_to_anim() // walk to start position of anim -// FN_turn() // turn to (dir) -// FN_stand_at() // stand at (x,y,dir) -// FN_stand() // stand facing (dir) -// FN_stand_after_anim() // stand at end position of anim -// FN_face_id() // turn to face object (id) -// FN_face_xy() // turn to face point (x,y) -// FN_is_facing() // is mega (id) facing us? -// FN_get_pos() // get details of another mega's position - #include "stdafx.h" #include "bs2/console.h" #include "bs2/defs.h" @@ -51,7 +40,9 @@ int16 standby_x; // see FN_set_standby_coords int16 standby_y; uint8 standby_dir; -// walk mega to (x,y,dir) +/** + * Walk mega to (x,y,dir) + */ int32 FN_walk(int32 *params) { // params: 0 pointer to object's logic structure @@ -252,7 +243,9 @@ int32 FN_walk(int32 *params) { return IR_REPEAT; } -// walk mega to start position of anim +/** + * Walk mega to start position of anim + */ int32 FN_walk_to_anim(int32 *params) { // params: 0 pointer to object's logic structure @@ -313,9 +306,11 @@ int32 FN_walk_to_anim(int32 *params) { return FN_walk(pars); } -// turn mega to -// just needs to call FN_walk() with current feet coords, so router can -// produce anim of turn frames +/** + * turn mega to + * just needs to call FN_walk() with current feet coords, so router can + * produce anim of turn frames + */ int32 FN_turn(int32 *params) { // params: 0 pointer to object's logic structure @@ -355,9 +350,11 @@ int32 FN_turn(int32 *params) { return FN_walk(pars); } -// stand mega at (x,y,dir) -// sets up the graphic object, but also needs to set the new 'current_dir' in -// the mega object, so the router knows in future +/** + * stand mega at (x,y,dir) + * sets up the graphic object, but also needs to set the new 'current_dir' in + * the mega object, so the router knows in future + */ int32 FN_stand_at(int32 *params) { // params: 0 pointer to object's graphic structure @@ -416,7 +413,9 @@ int32 FN_stand(int32 *params) { return FN_stand_at(pars); } -// stand mega at end position of anim +/** + * stand mega at end position of anim + */ int32 FN_stand_after_anim(int32 *params) { // params: 0 pointer to object's graphic structure @@ -542,9 +541,11 @@ int What_target(int startX, int startY, int destX, int destY) { return (deltaY > 0) ? 5 : 7; } -// turn mega to face point (x,y) on the floor -// just needs to call FN_walk() with current feet coords & direction computed -// by What_target() +/** + * turn mega to face point (x,y) on the floor + * just needs to call FN_walk() with current feet coords & direction computed + * by What_target() + */ int32 FN_face_xy(int32 *params) { // params: 0 pointer to object's logic structure -- cgit v1.2.3