diff options
author | Eugene Sandulenko | 2004-04-30 23:02:23 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-04-30 23:02:23 +0000 |
commit | 1353e2d2dc8cf794279f4bc8f9ae12eb31accc35 (patch) | |
tree | 15b6bdcdce6449ce4f245cfd0fb200b8b2beeb30 /saga | |
parent | 06d9f402df8c1be896f0b369ceacf81d1488663d (diff) | |
download | scummvm-rg350-1353e2d2dc8cf794279f4bc8f9ae12eb31accc35.tar.gz scummvm-rg350-1353e2d2dc8cf794279f4bc8f9ae12eb31accc35.tar.bz2 scummvm-rg350-1353e2d2dc8cf794279f4bc8f9ae12eb31accc35.zip |
Move from custom unsigned types to those provided by main config.h
svn-id: r13687
Diffstat (limited to 'saga')
63 files changed, 510 insertions, 522 deletions
diff --git a/saga/actionmap.cpp b/saga/actionmap.cpp index 20b3a7f250..474d62ba6a 100644 --- a/saga/actionmap.cpp +++ b/saga/actionmap.cpp @@ -68,7 +68,7 @@ int ACTIONMAP_Init(void) return R_SUCCESS; } -int ACTIONMAP_Load(const uchar * exmap_res, size_t exmap_res_len) +int ACTIONMAP_Load(const byte * exmap_res, size_t exmap_res_len) /*--------------------------------------------------------------------------*\ * Loads exit map data from specified exit map resource \*--------------------------------------------------------------------------*/ @@ -80,7 +80,7 @@ int ACTIONMAP_Load(const uchar * exmap_res, size_t exmap_res_len) int exit_ct; int i, pt; - const uchar *read_p = exmap_res; + const byte *read_p = exmap_res; size_t read_len = exmap_res_len; assert(ActmapModule.init); diff --git a/saga/actionmap.h b/saga/actionmap.h index f41ec37479..920484bd4f 100644 --- a/saga/actionmap.h +++ b/saga/actionmap.h @@ -54,7 +54,7 @@ struct R_ACTIONMAP_INFO { int n_exits; R_ACTIONMAP_ENTRY *exits_tbl; - const uchar *exmap_res; + const byte *exmap_res; size_t exmap_res_len; }; diff --git a/saga/actionmap_mod.h b/saga/actionmap_mod.h index f424ef1304..a051cbbcaa 100644 --- a/saga/actionmap_mod.h +++ b/saga/actionmap_mod.h @@ -37,7 +37,7 @@ namespace Saga { int ACTIONMAP_Register(void); int ACTIONMAP_Init(void); -int ACTIONMAP_Load(const uchar * exmap_res, size_t exmap_res_len); +int ACTIONMAP_Load(const byte * exmap_res, size_t exmap_res_len); int ACTIONMAP_Draw(R_SURFACE * ds, int color); int ACTIONMAP_Free(void); diff --git a/saga/actor.cpp b/saga/actor.cpp index 9ffc3b00f9..7e849f54e6 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -522,9 +522,9 @@ int AddActor(R_ACTOR * actor) return R_SUCCESS; } -int ACTOR_GetActorIndex(uint actor_id) +int ACTOR_GetActorIndex(uint16 actor_id) { - uint actor_idx; + uint16 actor_idx; if (actor_id == 1) { actor_idx = 0; @@ -539,9 +539,9 @@ int ACTOR_GetActorIndex(uint actor_id) return actor_idx; } -int ACTOR_ActorExists(uint actor_id) +int ACTOR_ActorExists(uint16 actor_id) { - uint actor_idx; + uint16 actor_idx; if (actor_id == 1) { actor_idx = 0; @@ -556,7 +556,7 @@ int ACTOR_ActorExists(uint actor_id) return 1; } -int ACTOR_Speak(int index, const char *d_string, uint d_voice_rn, R_SEMAPHORE * sem) +int ACTOR_Speak(int index, const char *d_string, uint16 d_voice_rn, R_SEMAPHORE * sem) { YS_DL_NODE *node; @@ -730,7 +730,7 @@ HandleSpeakIntent(R_ACTOR * actor, return R_SUCCESS; } -int ACTOR_GetSpeechTime(const char *d_string, uint d_voice_rn) +int ACTOR_GetSpeechTime(const char *d_string, uint16 d_voice_rn) { int voice_len; @@ -767,7 +767,7 @@ int ACTOR_SetOrientation(int index, int orient) return R_SUCCESS; } -int ACTOR_SetAction(int index, int action_n, uint action_flags) +int ACTOR_SetAction(int index, int action_n, uint16 action_flags) { R_ACTOR *actor; @@ -795,7 +795,7 @@ int ACTOR_SetAction(int index, int action_n, uint action_flags) return R_SUCCESS; } -int ACTOR_SetDefaultAction(int index, int action_n, uint action_flags) +int ACTOR_SetDefaultAction(int index, int action_n, uint16 action_flags) { R_ACTOR *actor; @@ -847,10 +847,10 @@ R_ACTOR *LookupActor(int index) int LoadActorSpriteIndex(R_ACTOR * actor, int si_rn, int *last_frame_p) { - uchar *res_p; + byte *res_p; size_t res_len; - const uchar *read_p; + const byte *read_p; int s_action_ct; R_ACTORACTION *action_p; @@ -950,7 +950,7 @@ int DeleteActor(int index) return R_SUCCESS; } -int ACTOR_WalkTo(int id, R_POINT * walk_pt, uint flags, R_SEMAPHORE * sem) +int ACTOR_WalkTo(int id, R_POINT * walk_pt, uint16 flags, R_SEMAPHORE * sem) /*--------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------*/ { @@ -1341,7 +1341,7 @@ static void CF_actor_add(int argc, char *argv[]) if (argc < 3) return; - actor.id = (uint) atoi(argv[0]); + actor.id = (uint16) atoi(argv[0]); actor.a_pt.x = atoi(argv[1]); actor.a_pt.y = atoi(argv[2]); diff --git a/saga/actor.h b/saga/actor.h index 1c4fb4b1ba..29fa8c9c85 100644 --- a/saga/actor.h +++ b/saga/actor.h @@ -71,7 +71,7 @@ struct R_ACTORACTION { struct R_WALKINTENT { int wi_active; - uint wi_flags; + uint16 wi_flags; int wi_init; int time; @@ -100,7 +100,7 @@ struct R_WALKNODE { struct R_SPEAKINTENT { int si_init; - uint si_flags; + uint16 si_flags; int si_last_action; YS_DL_LIST *si_diaglist; /* Actor dialogue list */ @@ -110,7 +110,7 @@ struct R_SPEAKINTENT { struct R_ACTORINTENT { int a_itype; - uint a_iflags; + uint16 a_iflags; int a_idone; void *a_data; @@ -123,7 +123,7 @@ struct R_ACTOR { int id; /* Actor id */ int name_i; /* Actor's index in actor name string list */ - uint flags; + uint16 flags; R_POINT a_pt; /* Actor's logical coordinates */ R_POINT s_pt; /* Actor's screen coordinates */ @@ -149,10 +149,10 @@ struct R_ACTOR { */ int def_action; - uint def_action_flags; + uint16 def_action_flags; int action; - uint action_flags; + uint16 action_flags; int action_frame; int action_time; @@ -170,7 +170,7 @@ struct R_ACTORDIALOGUE { int d_playing; const char *d_string; - uint d_voice_rn; + uint16 d_voice_rn; long d_time; int d_sem_held; @@ -193,7 +193,7 @@ struct R_ACTOR_MODULE { R_RSCFILE_CONTEXT *actor_ctxt; - uint count; + uint16 count; int *alias_tbl; YS_DL_NODE **tbl; diff --git a/saga/actor_mod.h b/saga/actor_mod.h index c94cf7ae00..d53f851029 100644 --- a/saga/actor_mod.h +++ b/saga/actor_mod.h @@ -72,7 +72,7 @@ int ACTOR_Shutdown(void); int ACTOR_Direct(int msec); int ACTOR_Create(int actor_id, int x, int y); -int ACTOR_ActorExists(uint actor_id); +int ACTOR_ActorExists(uint16 actor_id); int ACTOR_DrawList(void); int ACTOR_AtoS(R_POINT * logical, const R_POINT * actor); @@ -81,18 +81,18 @@ int ACTOR_StoA(R_POINT * actor, const R_POINT * screen); int ACTOR_Move(int index, R_POINT * move_pt); int ACTOR_MoveRelative(int index, R_POINT * move_pt); -int ACTOR_WalkTo(int index, R_POINT * walk_pt, uint flags, R_SEMAPHORE * sem); +int ACTOR_WalkTo(int index, R_POINT * walk_pt, uint16 flags, R_SEMAPHORE * sem); -int ACTOR_GetActorIndex(uint actor_id); +int ACTOR_GetActorIndex(uint16 actor_id); -int ACTOR_Speak(int index, const char *d_string, uint d_voice_rn, R_SEMAPHORE * sem); +int ACTOR_Speak(int index, const char *d_string, uint16 d_voice_rn, R_SEMAPHORE * sem); int ACTOR_SkipDialogue(void); -int ACTOR_GetSpeechTime(const char *d_string, uint d_voice_rn); +int ACTOR_GetSpeechTime(const char *d_string, uint16 d_voice_rn); int ACTOR_SetOrientation(int index, int orient); -int ACTOR_SetAction(int index, int action_n, uint action_flags); -int ACTOR_SetDefaultAction(int index, int action_n, uint action_flags); +int ACTOR_SetAction(int index, int action_n, uint16 action_flags); +int ACTOR_SetDefaultAction(int index, int action_n, uint16 action_flags); } // End of namespace Saga diff --git a/saga/animation.cpp b/saga/animation.cpp index 70f6d8dac0..e21b2aef92 100644 --- a/saga/animation.cpp +++ b/saga/animation.cpp @@ -71,7 +71,7 @@ int ANIM_Init(void) int ANIM_Shutdown(void) { - uint i; + uint16 i; for (i = 0; i < R_MAX_ANIMATIONS; i++) { @@ -84,13 +84,13 @@ int ANIM_Shutdown(void) } int -ANIM_Load(const uchar * anim_resdata, - size_t anim_resdata_len, uint * anim_id_p) +ANIM_Load(const byte * anim_resdata, + size_t anim_resdata_len, uint16 * anim_id_p) { R_ANIMATION *new_anim; - uint anim_id = 0; - uint i; + uint16 anim_id = 0; + uint16 i; if (!AnimInfo.initialized) { return R_FAILURE; @@ -176,7 +176,7 @@ ANIM_Load(const uchar * anim_resdata, return R_SUCCESS; } -int ANIM_Link(uint anim_id1, uint anim_id2) +int ANIM_Link(uint16 anim_id1, uint16 anim_id2) { R_ANIMATION *anim1; R_ANIMATION *anim2; @@ -202,22 +202,22 @@ int ANIM_Link(uint anim_id1, uint anim_id2) return R_SUCCESS; } -int ANIM_Play(uint anim_id, int vector_time) +int ANIM_Play(uint16 anim_id, int vector_time) { R_EVENT event; R_ANIMATION *anim; R_ANIMATION *link_anim; - uint link_anim_id; + uint16 link_anim_id; R_BUFFER_INFO buf_info; - uchar *display_buf; + byte *display_buf; - const uchar *nextf_p; + const byte *nextf_p; size_t nextf_len; - uint frame; + uint16 frame; int result; R_GAME_DISPLAYINFO disp_info; @@ -354,7 +354,7 @@ int ANIM_Play(uint anim_id, int vector_time) int ANIM_Reset(void) { - uint i; + uint16 i; for (i = 0; i < R_MAX_ANIMATIONS; i++) { @@ -366,7 +366,7 @@ int ANIM_Reset(void) return R_SUCCESS; } -int ANIM_SetFlag(uint anim_id, uint flag) +int ANIM_SetFlag(uint16 anim_id, uint16 flag) { R_ANIMATION *anim; @@ -386,7 +386,7 @@ int ANIM_SetFlag(uint anim_id, uint flag) return R_SUCCESS; } -int ANIM_SetFrameTime(uint anim_id, int time) +int ANIM_SetFrameTime(uint16 anim_id, int time) { R_ANIMATION *anim; @@ -406,7 +406,7 @@ int ANIM_SetFrameTime(uint anim_id, int time) return R_SUCCESS; } -int ANIM_Free(uint anim_id) +int ANIM_Free(uint16 anim_id) { R_ANIMATION *anim; @@ -434,7 +434,7 @@ int ANIM_Free(uint anim_id) return R_SUCCESS; } -int ANIM_GetNumFrames(const uchar * anim_resource, uint * n_frames) +int ANIM_GetNumFrames(const byte * anim_resource, uint16 * n_frames) /*--------------------------------------------------------------------------*\ * The actual number of frames present in an animation resource is * sometimes less than number present in the .nframes member of the @@ -449,7 +449,7 @@ int ANIM_GetNumFrames(const uchar * anim_resource, uint * n_frames) int x; - const uchar *read_p = anim_resource; + const byte *read_p = anim_resource; if (!AnimInfo.initialized) { @@ -495,34 +495,34 @@ int ANIM_GetNumFrames(const uchar * anim_resource, uint * n_frames) } int -ITE_DecodeFrame(const uchar * resdata, - size_t frame_offset, uchar * buf, size_t buf_len) +ITE_DecodeFrame(const byte * resdata, + size_t frame_offset, byte * buf, size_t buf_len) { R_ANIMATION_HEADER ah; R_FRAME_HEADER fh; - const uchar *read_p = resdata; - uchar *write_p; + const byte *read_p = resdata; + byte *write_p; - uint magic; + uint16 magic; - uint x_start; - uint y_start; - ulong screen_w; - ulong screen_h; + uint16 x_start; + uint16 y_start; + uint32 screen_w; + uint32 screen_h; int mark_byte; - uchar data_byte; + byte data_byte; int new_row; - uint control_ch; - uint param_ch; + uint16 control_ch; + uint16 param_ch; - uint runcount; + uint16 runcount; int x_vector; - uint i; + uint16 i; if (!AnimInfo.initialized) { @@ -705,10 +705,10 @@ ITE_DecodeFrame(const uchar * resdata, } int -IHNM_DecodeFrame(uchar * decode_buf, +IHNM_DecodeFrame(byte * decode_buf, size_t decode_buf_len, - const uchar * thisf_p, - size_t thisf_len, const uchar ** nextf_p, size_t * nextf_len) + const byte * thisf_p, + size_t thisf_len, const byte ** nextf_p, size_t * nextf_len) { int in_ch; @@ -719,23 +719,23 @@ IHNM_DecodeFrame(uchar * decode_buf, int control_ch; int param_ch; - uchar data_pixel; + byte data_pixel; int x_origin = 0; int y_origin = 0; int x_vector; int new_row; - uint runcount; - uint c; + uint16 runcount; + uint16 c; size_t in_ch_offset; - const uchar *inbuf_p = thisf_p; + const byte *inbuf_p = thisf_p; size_t inbuf_remain = thisf_len; - uchar *outbuf_p = decode_buf; - uchar *outbuf_endp = (decode_buf + decode_buf_len) - 1; + byte *outbuf_p = decode_buf; + byte *outbuf_endp = (decode_buf + decode_buf_len) - 1; size_t outbuf_remain = decode_buf_len; R_GAME_DISPLAYINFO di; @@ -1017,22 +1017,22 @@ IHNM_DecodeFrame(uchar * decode_buf, } int -ANIM_GetFrameOffset(const uchar * resdata, - uint find_frame, size_t * frame_offset_p) +ANIM_GetFrameOffset(const byte * resdata, + uint16 find_frame, size_t * frame_offset_p) { R_ANIMATION_HEADER ah; - uint num_frames; - uint current_frame; + uint16 num_frames; + uint16 current_frame; - const uchar *read_p = resdata; - const uchar *search_ptr; + const byte *read_p = resdata; + const byte *search_ptr; - uchar mark_byte; - uint control; - uint runcount; + byte mark_byte; + uint16 control; + uint16 runcount; - uint magic; + uint16 magic; if (!AnimInfo.initialized) { @@ -1163,9 +1163,9 @@ ANIM_GetFrameOffset(const uchar * resdata, static void CF_anim_info(int argc, char *argv[]) { - uint anim_ct; - uint i; - uint idx; + uint16 anim_ct; + uint16 i; + uint16 idx; YS_IGNORE_PARAM(argc); YS_IGNORE_PARAM(argv); diff --git a/saga/animation.h b/saga/animation.h index ca86509017..b4e5db5177 100644 --- a/saga/animation.h +++ b/saga/animation.h @@ -45,19 +45,19 @@ namespace Saga { struct R_ANIMATION_HEADER { - uint magic; + uint16 magic; - uint screen_w; - uint screen_h; + uint16 screen_w; + uint16 screen_h; - uint unknown06; - uint unknown07; + uint16 unknown06; + uint16 unknown07; - uint nframes; - uint flags; + uint16 nframes; + uint16 flags; - uint unknown10; - uint unknown11; + uint16 unknown10; + uint16 unknown11; }; @@ -81,26 +81,26 @@ struct R_FRAME_HEADER { /* Animation info array member */ struct R_ANIMATION { - const uchar *resdata; + const byte *resdata; size_t resdata_len; - uint n_frames; + uint16 n_frames; size_t *frame_offsets; - uint current_frame; - uint end_frame; - uint stop_frame; + uint16 current_frame; + uint16 end_frame; + uint16 stop_frame; - const uchar *cur_frame_p; + const byte *cur_frame_p; size_t cur_frame_len; int frame_time; - uint play_flag; + uint16 play_flag; int link_flag; - uint link_id; + uint16 link_id; - uint flags; + uint16 flags; }; @@ -108,28 +108,28 @@ struct R_ANIMINFO { int initialized; - uint anim_count; - uint anim_limit; + uint16 anim_count; + uint16 anim_limit; R_ANIMATION *anim_tbl[R_MAX_ANIMATIONS]; }; -int ANIM_GetNumFrames(const uchar * anim_resource, uint * n_frames); +int ANIM_GetNumFrames(const byte * anim_resource, uint16 * n_frames); int -ITE_DecodeFrame(const uchar * anim_resource, - size_t frame_offset, uchar * buf, size_t buf_len); +ITE_DecodeFrame(const byte * anim_resource, + size_t frame_offset, byte * buf, size_t buf_len); int -IHNM_DecodeFrame(uchar * decode_buf, +IHNM_DecodeFrame(byte * decode_buf, size_t decode_buf_len, - const uchar * thisf_p, - size_t thisf_len, const uchar ** nextf_p, size_t * nextf_len); + const byte * thisf_p, + size_t thisf_len, const byte ** nextf_p, size_t * nextf_len); int -ANIM_GetFrameOffset(const uchar * anim_resource, - uint find_frame, size_t * frame_offset); +ANIM_GetFrameOffset(const byte * anim_resource, + uint16 find_frame, size_t * frame_offset); static void CF_anim_info(int argc, char *argv[]); diff --git a/saga/animation_mod.h b/saga/animation_mod.h index 6bb8a1fcd6..3afda9ed5f 100644 --- a/saga/animation_mod.h +++ b/saga/animation_mod.h @@ -46,18 +46,18 @@ int ANIM_Init(void); int ANIM_Shutdown(void); int -ANIM_Load(const uchar * anim_resdata, - size_t anim_resdata_len, uint * anim_id_p); +ANIM_Load(const byte * anim_resdata, + size_t anim_resdata_len, uint16 * anim_id_p); -int ANIM_Free(uint anim_id); +int ANIM_Free(uint16 anim_id); -int ANIM_Play(uint anim_id, int vector_time); +int ANIM_Play(uint16 anim_id, int vector_time); -int ANIM_Link(uint anim_id1, uint anim_id2); +int ANIM_Link(uint16 anim_id1, uint16 anim_id2); -int ANIM_SetFlag(uint anim_id, uint flag); +int ANIM_SetFlag(uint16 anim_id, uint16 flag); -int ANIM_SetFrameTime(uint anim_id, int time); +int ANIM_SetFrameTime(uint16 anim_id, int time); int ANIM_Reset(void); diff --git a/saga/cvar.cpp b/saga/cvar.cpp index 41d52f6867..fddaddd8ee 100644 --- a/saga/cvar.cpp +++ b/saga/cvar.cpp @@ -216,7 +216,7 @@ int CVAR_SetValue(R_CVAR_P cvar, char *r_value) { long int int_param; - unsigned long uint_param; + unsigned long uint16_param; char *end_p; ptrdiff_t scan_len; @@ -288,16 +288,16 @@ int CVAR_SetValue(R_CVAR_P cvar, char *r_value) return R_FAILURE; } - uint_param = strtoul(r_value, &end_p, 10); + uint16_param = strtoul(r_value, &end_p, 10); - if (uint_param == ULONG_MAX) { + if (uint16_param == ULONG_MAX) { CVAR_ErrorState = CVERR_PARSEOVERFLOW; return R_FAILURE; } scan_len = end_p - r_value; - if (uint_param == 0) { + if (uint16_param == 0) { if (!scan_len || r_value[scan_len - 1] != '0') { /* strtol() returned 0, but string isn't "0". Invalid. */ @@ -312,7 +312,7 @@ int CVAR_SetValue(R_CVAR_P cvar, char *r_value) return R_FAILURE; } - if (uint_param > CV_UINTMAX) { + if (uint16_param > CV_UINTMAX) { /* Overflows destination type */ CVAR_ErrorState = CVERR_DESTOVERFLOW; return R_FAILURE; @@ -321,18 +321,18 @@ int CVAR_SetValue(R_CVAR_P cvar, char *r_value) /* Ignore bounds if equal */ if (cvar->t.ui.lbound != cvar->t.ui.ubound) { - if ((uint_param < cvar->t.ui.lbound) || - (uint_param > cvar->t.ui.ubound)) { + if ((uint16_param < cvar->t.ui.lbound) || + (uint16_param > cvar->t.ui.ubound)) { /* Value is outside cvar bounds */ CVAR_ErrorState = CVERR_BOUND; return R_FAILURE; } } - *(cvar->t.ui.var_p) = (cv_uint_t) uint_param; + *(cvar->t.ui.var_p) = (cv_uint16_t) uint16_param; #ifdef R_CVAR_TRACE - printf("Set cvar to value %lu.\n", uint_param); + printf("Set cvar to value %lu.\n", uint16_param); #endif break; @@ -413,7 +413,7 @@ int CVAR_IsFunc(R_CVAR_P cvar_func) int CVAR_RegisterFunc(cv_func_t func, const char *func_name, - const char *func_argstr, uint flags, int min_args, int max_args) + const char *func_argstr, uint16 flags, int min_args, int max_args) /****************************************************************************\ Registers a console function 'cvar' (could think of a better place to put these...?) @@ -444,7 +444,7 @@ CVAR_RegisterFunc(cv_func_t func, int CVAR_Register_I(cv_int_t * var_p, const char *var_name, - const char *section, uint flags, cv_int_t lbound, cv_int_t ubound) + const char *section, uint16 flags, cv_int_t lbound, cv_int_t ubound) /****************************************************************************\ Registers an integer type cvar. \****************************************************************************/ @@ -473,9 +473,9 @@ CVAR_Register_I(cv_int_t * var_p, } int -CVAR_Register_UI(cv_uint_t * var_p, +CVAR_Register_UI(cv_uint16_t * var_p, const char *var_name, - const char *section, uint flags, cv_uint_t lbound, cv_uint_t ubound) + const char *section, uint16 flags, cv_uint16_t lbound, cv_uint16_t ubound) /****************************************************************************\ Registers an unsigned integer type cvar. \****************************************************************************/ @@ -506,7 +506,7 @@ CVAR_Register_UI(cv_uint_t * var_p, int CVAR_Register_F(cv_float_t * var_p, const char *var_name, - const char *section, uint flags, cv_float_t lbound, cv_float_t ubound) + const char *section, uint16 flags, cv_float_t lbound, cv_float_t ubound) /****************************************************************************\ Registers a floating point type cvar. \****************************************************************************/ @@ -536,7 +536,7 @@ CVAR_Register_F(cv_float_t * var_p, int CVAR_Register_S(cv_char_t * var_str, - const char *var_name, const char *section, uint flags, int ubound) + const char *var_name, const char *section, uint16 flags, int ubound) /****************************************************************************\ Registers a string type cvar. Storage must be provided in var_p for 'ubound' characters plus 1 for NUL char. diff --git a/saga/cvar.h b/saga/cvar.h index 4600150c82..b87f36c71f 100644 --- a/saga/cvar.h +++ b/saga/cvar.h @@ -45,9 +45,9 @@ struct R_SUBCVAR_INT { struct R_SUBCVAR_UINT { - cv_uint_t *var_p; - cv_uint_t ubound; - cv_uint_t lbound; + cv_uint16_t *var_p; + cv_uint16_t ubound; + cv_uint16_t lbound; }; @@ -80,7 +80,7 @@ typedef struct R_CVAR_tag { int type; const char *name; const char *section; - uint flags; + uint16 flags; union { R_SUBCVAR_INT i; diff --git a/saga/cvar_mod.h b/saga/cvar_mod.h index d410fe68a7..04b0e07560 100644 --- a/saga/cvar_mod.h +++ b/saga/cvar_mod.h @@ -39,7 +39,7 @@ namespace Saga { #define CV_UINTMAX UINT_MAX typedef int cv_int_t; -typedef unsigned int cv_uint_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[]); @@ -80,22 +80,22 @@ 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, uint flags, int min_args, int max_args); + const char *func_argstr, uint16 flags, int min_args, int max_args); int CVAR_Register_I(cv_int_t * var_p, const char *var_name, - const char *section, uint flags, cv_int_t lbound, cv_int_t ubound); + const char *section, uint16 flags, cv_int_t lbound, cv_int_t ubound); -int CVAR_Register_UI(cv_uint_t * var_p, +int CVAR_Register_UI(cv_uint16_t * var_p, const char *var_name, - const char *section, uint flags, cv_uint_t lbound, cv_uint_t ubound); + const char *section, uint16 flags, cv_uint16_t lbound, cv_uint16_t ubound); int CVAR_Register_F(cv_float_t * var_p, const char *var_name, - const char *section, uint flags, cv_float_t lbound, cv_float_t ubound); + const char *section, uint16 flags, cv_float_t lbound, cv_float_t ubound); int CVAR_Register_S(cv_char_t * var_str, - const char *var_name, const char *section, uint flags, int ubound); + const char *var_name, const char *section, uint16 flags, int ubound); int EXPR_Parse(const char **exp_pp, int *len, R_CVAR_P * expr_cvar, char **rvalue); diff --git a/saga/events.cpp b/saga/events.cpp index b1e104a623..3db350da08 100644 --- a/saga/events.cpp +++ b/saga/events.cpp @@ -594,7 +594,7 @@ static int ProcessEventTime(long msec) YS_DL_NODE *walk_node; R_EVENT *event_p; - uint event_count = 0; + uint16 event_count = 0; for (walk_node = ys_dll_head(EventList); walk_node != NULL; walk_node = ys_dll_next(walk_node)) { diff --git a/saga/font.cpp b/saga/font.cpp index 5894b0d6c3..ce3f497396 100644 --- a/saga/font.cpp +++ b/saga/font.cpp @@ -125,18 +125,18 @@ int FONT_Shutdown(void) return R_SUCCESS; } -int FONT_Load(ulong font_rn, int font_id) +int FONT_Load(uint32 font_rn, int font_id) { R_FONT_HEADER fh; R_FONT *font; R_FONT_STYLE *normal_font; - uchar *fontres_p; + byte *fontres_p; size_t fontres_len; size_t remain; - const uchar *read_p; + const byte *read_p; int nbits; int c; @@ -498,7 +498,7 @@ FONT_GetStringWidth(int font_id, size_t ct; int width = 0; int ch; - const uchar *txt_p; + const byte *txt_p; if (!FontModule.init) { return R_FAILURE; @@ -516,7 +516,7 @@ FONT_GetStringWidth(int font_id, font = FontModule.fonts[font_id]; assert(font != NULL); - txt_p = (const uchar *) test_str; + txt_p = (const byte *) test_str; for (ct = test_str_ct; *txt_p && (!test_str_ct || ct > 0); txt_p++, ct--) { @@ -598,16 +598,16 @@ FONT_Out(R_FONT_STYLE * draw_font, size_t draw_str_ct, int text_x, int text_y, int color) { - const uchar *draw_str_p; + const byte *draw_str_p; - uchar *c_data_ptr; + byte *c_data_ptr; int c_code; int char_row; - uchar *output_ptr; - uchar *output_ptr_min; - uchar *output_ptr_max; + byte *output_ptr; + byte *output_ptr_min; + byte *output_ptr_max; int row; int row_limit; @@ -623,7 +623,7 @@ FONT_Out(R_FONT_STYLE * draw_font, return R_SUCCESS; } - draw_str_p = (const uchar *) draw_str; + draw_str_p = (const byte *) draw_str; ct = draw_str_ct; /* Draw string one character at a time, maximum of 'draw_str'_ct @@ -700,7 +700,7 @@ FONT_Out(R_FONT_STYLE * draw_font, c_bit--) { if ((*c_data_ptr >> c_bit) & 0x01) { - *output_ptr = (uchar) color; + *output_ptr = (byte) color; } output_ptr++; diff --git a/saga/font.h b/saga/font.h index 1fda4f6248..7370e6b2a4 100644 --- a/saga/font.h +++ b/saga/font.h @@ -78,14 +78,14 @@ struct R_FONT_STYLE { R_FONT_HEADER hdr; FONT_CHAR_ENTRY fce[256]; - uchar *font_free_p; - uchar *font_p; + byte *font_free_p; + byte *font_p; }; struct R_FONT { - ulong font_rn; + uint32 font_rn; int font_id; int normal_loaded; @@ -93,7 +93,7 @@ struct R_FONT { int outline_loaded; R_FONT_STYLE *outline; - uchar *res_data; + byte *res_data; size_t res_len; }; @@ -112,7 +112,7 @@ struct R_FONT_MODULE { }; -int FONT_Load(ulong font_rn, int font_id); +int FONT_Load(uint32 font_rn, int font_id); static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font); diff --git a/saga/game.cpp b/saga/game.cpp index 902b27295b..63ab09da47 100644 --- a/saga/game.cpp +++ b/saga/game.cpp @@ -406,7 +406,7 @@ int GAME_Register(void) int GAME_Init(void) { - uint game_n; + uint16 game_n; char *game_dir; game_dir = GameModule.game_dir; @@ -445,7 +445,7 @@ int LoadLanguage(void) char lang_file[R_MAXPATH]; // char lang_path[R_MAXPATH]; - uint game_n; + uint16 game_n; File test_file; @@ -508,11 +508,11 @@ const char *GAME_GetErrS(void) ? "No error description." : GameModule.err_str; } -int GAME_GetFileContext(R_RSCFILE_CONTEXT ** ctxt_p, uint r_type, int param) +int GAME_GetFileContext(R_RSCFILE_CONTEXT ** ctxt_p, uint16 r_type, int param) { R_RSCFILE_CONTEXT *found_ctxt = NULL; - uint i; + uint16 i; YS_IGNORE_PARAM(param); @@ -540,13 +540,13 @@ int GAME_GetFileContext(R_RSCFILE_CONTEXT ** ctxt_p, uint r_type, int param) return R_SUCCESS; } -int DetectGame(const char *game_dir, uint * game_n_p) +int DetectGame(const char *game_dir, uint16 * game_n_p) { - uint game_count = ARRAYSIZE(GameDescs); - uint game_n; + uint16 game_count = ARRAYSIZE(GameDescs); + uint16 game_n; - uint file_count; - uint file_n; + uint16 file_count; + uint16 file_n; File test_file; @@ -604,17 +604,17 @@ int DetectGame(const char *game_dir, uint * game_n_p) return R_FAILURE; } -int LoadGame(const char *game_dir, uint game_n) +int LoadGame(const char *game_dir, uint16 game_n) { R_RSCFILE_CONTEXT *load_ctxt; - uint game_count = ARRAYSIZE(GameDescs); + uint16 game_count = ARRAYSIZE(GameDescs); const char *game_fname; - uint game_filect; + uint16 game_filect; - uint i; + uint16 i; if ((game_dir == NULL) || (game_n >= game_count)) { @@ -755,8 +755,8 @@ int Verify_ITEDISK(const char *game_dir) R_RSCFILE_CONTEXT *test_ctx; - ulong script_lut_len; - ulong script_lut_rn; + uint32 script_lut_len; + uint32 script_lut_rn; int verified = 0; diff --git a/saga/game.h b/saga/game.h index dc6bb47ee1..3e8a1642af 100644 --- a/saga/game.h +++ b/saga/game.h @@ -48,7 +48,7 @@ typedef int (*R_GAME_VERIFYFUNC) (const char *); struct R_GAME_FILEDESC { const char *gf_fname; - uint gf_type; + uint16 gf_type; }; @@ -85,8 +85,8 @@ struct R_GAME_FILEDATA { R_RSCFILE_CONTEXT *file_ctxt; - uint file_types; - uint file_flags; + uint16 file_types; + uint16 file_flags; }; @@ -104,10 +104,10 @@ struct R_GAMEMODULE { char game_language[R_GAME_LANGSTR_LIMIT]; - uint gfile_n; + uint16 gfile_n; R_GAME_FILEDATA *gfile_data; - uint gd_fontct; + uint16 gd_fontct; R_GAME_FONTDESC *gd_fontdescs; int err_n; @@ -117,9 +117,9 @@ struct R_GAMEMODULE { int LoadLanguage(void); -int DetectGame(const char *game_dir, uint * game_n_p); +int DetectGame(const char *game_dir, uint16 * game_n_p); -int LoadGame(const char *game_dir, uint game_n_p); +int LoadGame(const char *game_dir, uint16 game_n_p); int Verify_ITEDEMO(const char *game_dir); int Verify_ITEDISK(const char *game_dir); diff --git a/saga/game_mod.h b/saga/game_mod.h index 880eec1577..023d1eb0f0 100644 --- a/saga/game_mod.h +++ b/saga/game_mod.h @@ -95,24 +95,24 @@ struct R_GAME_SOUNDINFO { struct R_GAME_FONTDESC { - uint font_id; - ulong font_rn; + uint16 font_id; + uint32 font_rn; }; struct R_GAME_SCENEDESC { - ulong scene_lut_rn; - ulong first_scene; + uint32 scene_lut_rn; + uint32 first_scene; }; struct R_GAME_RESOURCEDESC { - ulong scene_lut_rn; - ulong script_lut_rn; - ulong command_panel_rn; - ulong dialogue_panel_rn; + uint32 scene_lut_rn; + uint32 script_lut_rn; + uint32 command_panel_rn; + uint32 dialogue_panel_rn; }; @@ -120,7 +120,7 @@ int GAME_Register(void); int GAME_Init(void); -int GAME_GetFileContext(R_RSCFILE_CONTEXT ** ctxt_p, uint r_type, int param); +int GAME_GetFileContext(R_RSCFILE_CONTEXT ** ctxt_p, uint16 r_type, int param); int GAME_GetFontInfo(R_GAME_FONTDESC **, int *); diff --git a/saga/gfx.cpp b/saga/gfx.cpp index 13034d161c..993fe4732d 100644 --- a/saga/gfx.cpp +++ b/saga/gfx.cpp @@ -97,8 +97,8 @@ int GFX_DrawPalette(R_SURFACE *dst_s) { } int GFX_SimpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s) { - uchar *src_p; - uchar *dst_p; + byte *src_p; + byte *dst_p; int y, w, p; assert((dst_s != NULL) && (src_s != NULL)); @@ -148,11 +148,11 @@ int GFX_Scale2x8(R_SURFACE *dst_s, R_SURFACE *src_s) { int src_skip = src_s->buf_pitch - src_s->buf_w; int dst_skip = dst_s->buf_pitch - dst_s->buf_w; - uchar *src_ptr = src_s->buf; - uchar *dst_ptr = dst_s->buf; + byte *src_ptr = src_s->buf; + byte *dst_ptr = dst_s->buf; - uchar *src_row; - uchar *dst_row; + byte *src_row; + byte *dst_row; assert(dst_s->buf_w == (src_s->buf_w * 2)); assert(dst_s->buf_h == (src_s->buf_h * 2)); @@ -183,8 +183,8 @@ int GFX_Scale2x16(R_SURFACE *dst_s, R_SURFACE *src_s) { int src_skip; int dest_skip; - uchar *src_ptr = src_s->buf; - uchar *dest_ptr = dst_s->buf; + byte *src_ptr = src_s->buf; + byte *dest_ptr = dst_s->buf; short *src_row; short *dest_row; @@ -226,10 +226,10 @@ int GFX_Scale2x16(R_SURFACE *dst_s, R_SURFACE *src_s) { * - The surface must match the logical dimensions of the buffer exactly. * - Returns R_FAILURE on error \*--------------------------------------------------------------------------*/ -int GFX_BufToSurface(R_SURFACE *ds, const uchar *src, int src_w, int src_h, +int GFX_BufToSurface(R_SURFACE *ds, const byte *src, int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt) { - const uchar *read_p; - uchar *write_p; + const byte *read_p; + byte *write_p; int row; @@ -352,10 +352,10 @@ int GFX_BufToSurface(R_SURFACE *ds, const uchar *src, int src_w, int src_h, return R_SUCCESS; } -int GFX_BufToBuffer(uchar *dst_buf, int dst_w, int dst_h, const uchar *src, +int GFX_BufToBuffer(byte *dst_buf, int dst_w, int dst_h, const byte *src, int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt) { - const uchar *read_p; - uchar *write_p; + const byte *read_p; + byte *write_p; int row; @@ -475,7 +475,7 @@ int GFX_BufToBuffer(uchar *dst_buf, int dst_w, int dst_h, const uchar *src, } int GFX_DrawCursor(R_SURFACE *ds, R_POINT *p1) { - static uchar cursor_img[R_CURSOR_W * R_CURSOR_H] = { + static byte cursor_img[R_CURSOR_W * R_CURSOR_H] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -487,7 +487,7 @@ int GFX_DrawCursor(R_SURFACE *ds, R_POINT *p1) { R_CLIPINFO ci; - uchar *src_p, *dst_p; + byte *src_p, *dst_p; int x, y; int src_skip, dst_skip; @@ -547,7 +547,7 @@ int GFX_DrawCursor(R_SURFACE *ds, R_POINT *p1) { * the specified color. \*--------------------------------------------------------------------------*/ int GFX_DrawRect(R_SURFACE *ds, R_RECT *dst_rect, int color) { - uchar *write_p; + byte *write_p; int w; int h; @@ -821,7 +821,7 @@ int GFX_ClipLine(R_SURFACE *ds, const R_POINT *src_p1, const R_POINT *src_p2, * Performs no clipping \*--------------------------------------------------------------------------*/ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { - uchar *write_p; + byte *write_p; int clip_result; @@ -892,21 +892,21 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { if (dx == 0) { for (i = 0; i <= dy; i++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += ds->buf_pitch; } return; } if (dy == 0) { for (i = 0; i <= dx; i++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += x_vector; } return; } if (dx == dy) { for (i = 0; i <= dx; i++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += x_vector + ds->buf_pitch; } return; @@ -929,7 +929,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Horiz. seg */ for (k = 0; k < init_run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += x_vector; } write_p += ds->buf_pitch; @@ -945,7 +945,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Horiz. seg */ for (k = 0; k < run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += x_vector; } write_p += ds->buf_pitch; @@ -954,7 +954,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Horiz. seg */ for (k = 0; k < end_run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += x_vector; } write_p += ds->buf_pitch; @@ -983,7 +983,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Vertical seg */ for (k = 0; k < init_run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += ds->buf_pitch; } write_p += x_vector; @@ -998,7 +998,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Vertical seg */ for (k = 0; k < run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += ds->buf_pitch; } write_p += x_vector; @@ -1007,7 +1007,7 @@ void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) { /* Vertical seg */ for (k = 0; k < end_run; k++) { - *write_p = (uchar) color; + *write_p = (byte) color; write_p += ds->buf_pitch; } write_p += x_vector; diff --git a/saga/gfx_mod.h b/saga/gfx_mod.h index 3804e00368..ca793888e0 100644 --- a/saga/gfx_mod.h +++ b/saga/gfx_mod.h @@ -69,14 +69,14 @@ int GFX_ClearSurface16(char *buf, int w, int h, int p); int GFX_DrawPalette(R_SURFACE * dst_s); int GFX_BufToSurface(R_SURFACE * ds, - const uchar * src, + const byte * src, int src_w, int src_h, R_RECT * src_rect, R_POINT * dst_pt); int -GFX_BufToBuffer(uchar * dst_buf, +GFX_BufToBuffer(byte * dst_buf, int dst_w, int dst_h, - const uchar * src, + const byte * src, int src_w, int src_h, R_RECT * src_rect, R_POINT * dst_pt); int GFX_DrawCursor(R_SURFACE * ds, R_POINT * p1); diff --git a/saga/image.cpp b/saga/image.cpp index cb8ccc2545..99e63ae19d 100644 --- a/saga/image.cpp +++ b/saga/image.cpp @@ -67,24 +67,24 @@ static int granulate(int value, int granularity) } int -IMG_DecodeBGImage(const uchar * image_data, +IMG_DecodeBGImage(const byte * image_data, size_t image_size, - uchar ** output_buf, size_t * output_buf_len, int *w, int *h) + byte ** output_buf, size_t * output_buf_len, int *w, int *h) { R_IMAGE_HEADER hdr; int modex_height; - const uchar *RLE_data_ptr; + const byte *RLE_data_ptr; size_t RLE_data_len; - uchar *decode_buf; + byte *decode_buf; size_t decode_buf_len; - uchar *out_buf; + byte *out_buf; size_t out_buf_len; - const uchar *read_p = image_data; + const byte *read_p = image_data; if (image_size <= SAGA_IMAGE_DATA_OFFSET) { /* Image size is way too small */ @@ -102,10 +102,10 @@ IMG_DecodeBGImage(const uchar * image_data, modex_height = granulate(hdr.height, 4); decode_buf_len = hdr.width * modex_height; - decode_buf = (uchar *)malloc(decode_buf_len); + decode_buf = (byte *)malloc(decode_buf_len); out_buf_len = hdr.width * hdr.height; - out_buf = (uchar *)malloc(out_buf_len); + out_buf = (byte *)malloc(out_buf_len); if (DecodeBGImageRLE(RLE_data_ptr, RLE_data_len, decode_buf, decode_buf_len) != R_SUCCESS) { @@ -137,31 +137,31 @@ IMG_DecodeBGImage(const uchar * image_data, } int -DecodeBGImageRLE(const uchar * inbuf, - size_t inbuf_len, uchar * outbuf, size_t outbuf_len) +DecodeBGImageRLE(const byte * inbuf, + size_t inbuf_len, byte * outbuf, size_t outbuf_len) { - const uchar *inbuf_ptr; - uchar *outbuf_ptr; - size_t inbuf_remain; + const byte *inbuf_ptr; + byte *outbuf_ptr; + uint16 inbuf_remain; - const uchar *inbuf_end; - uchar *outbuf_end; - size_t outbuf_remain; + const byte *inbuf_end; + byte *outbuf_end; + uint16 outbuf_remain; - uchar mark_byte; + byte mark_byte; int test_byte; - uint runcount; + uint16 runcount; - uchar bitfield; - uchar bitfield_byte1; - uchar bitfield_byte2; + byte bitfield; + byte bitfield_byte1; + byte bitfield_byte2; - uchar *backtrack_ptr; + byte *backtrack_ptr; int backtrack_amount; - uint c, b; + uint16 c, b; int decode_err = 0; @@ -368,18 +368,18 @@ DecodeBGImageRLE(const uchar * inbuf, return R_SUCCESS; } -int FlipImage(uchar * img_buf, int columns, int scanlines) +int FlipImage(byte * img_buf, int columns, int scanlines) { int line; - uchar *tmp_scan; + byte *tmp_scan; - uchar *flip_p1; - uchar *flip_p2; + byte *flip_p1; + byte *flip_p2; int flipcount = scanlines / 2; - tmp_scan = (uchar *)malloc(columns); + tmp_scan = (byte *)malloc(columns); if (tmp_scan == NULL) { return R_FAILURE; } @@ -403,8 +403,8 @@ int FlipImage(uchar * img_buf, int columns, int scanlines) } int -UnbankBGImage(uchar * dst_buf, - const uchar * src_buf, int columns, int scanlines) +UnbankBGImage(byte * dst_buf, + const byte * src_buf, int columns, int scanlines) { int x, y; @@ -416,11 +416,11 @@ UnbankBGImage(uchar * dst_buf, int rowjump_src; int rowjump_dest; - const uchar *src_p; - uchar *dst_p; + const byte *src_p; + byte *dst_p; - const uchar *srcptr1, *srcptr2, *srcptr3, *srcptr4; - uchar *dstptr1, *dstptr2, *dstptr3, *dstptr4; + const byte *srcptr1, *srcptr2, *srcptr3, *srcptr4; + byte *dstptr1, *dstptr2, *dstptr3, *dstptr4; quadruple_rows = scanlines - (scanlines % 4); remain_rows = scanlines - quadruple_rows; @@ -519,7 +519,7 @@ UnbankBGImage(uchar * dst_buf, return R_SUCCESS; } -const uchar *IMG_GetImagePal(const uchar * image_data, size_t image_size) +const byte *IMG_GetImagePal(const byte * image_data, size_t image_size) { if (image_size <= SAGA_IMAGE_HEADER_LEN) { return NULL; diff --git a/saga/image.h b/saga/image.h index f1ecc7c471..66de2b07f1 100644 --- a/saga/image.h +++ b/saga/image.h @@ -49,14 +49,14 @@ struct R_IMAGE_HEADER { }; int -DecodeBGImageRLE(const uchar * inbuf, - size_t inbuf_len, uchar * outbuf, size_t outbuf_len); +DecodeBGImageRLE(const byte * inbuf, + size_t inbuf_len, byte * outbuf, size_t outbuf_len); -int FlipImage(uchar * img_buf, int columns, int scanlines); +int FlipImage(byte * img_buf, int columns, int scanlines); int -UnbankBGImage(uchar * dest_buf, - const uchar * src_buf, int columns, int scanlines); +UnbankBGImage(byte * dest_buf, + const byte * src_buf, int columns, int scanlines); } // End of namespace Saga diff --git a/saga/image_mod.h b/saga/image_mod.h index 290a9ae1da..ac902c5208 100644 --- a/saga/image_mod.h +++ b/saga/image_mod.h @@ -34,11 +34,11 @@ namespace Saga { int -IMG_DecodeBGImage(const uchar * image_data, +IMG_DecodeBGImage(const byte * image_data, size_t image_size, - uchar ** output_buf, size_t * output_buf_len, int *w, int *h); + byte ** output_buf, size_t * output_buf_len, int *w, int *h); -const uchar *IMG_GetImagePal(const uchar * image_data, size_t image_size); +const byte *IMG_GetImagePal(const byte * image_data, size_t image_size); } // End of namespace Saga diff --git a/saga/interface.cpp b/saga/interface.cpp index b9b96ed064..ff9ea5eba1 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -544,7 +544,7 @@ int HandleCommandUpdate(R_SURFACE *ds, R_POINT *imouse_pt) { int HandlePlayfieldClick(R_SURFACE *ds, R_POINT *imouse_pt) { int hit_object; int object_num; - uint object_flags = 0; + uint16 object_flags = 0; int script_num; R_POINT iactor_pt; @@ -588,7 +588,7 @@ int HandlePlayfieldClick(R_SURFACE *ds, R_POINT *imouse_pt) { int HandlePlayfieldUpdate(R_SURFACE *ds, R_POINT *imouse_pt) { const char *object_name; int object_num; - uint object_flags = 0; + uint16 object_flags = 0; char new_status[R_STATUS_TEXT_LEN]; diff --git a/saga/interface.h b/saga/interface.h index 6c3ded1a56..ab38fd41ea 100644 --- a/saga/interface.h +++ b/saga/interface.h @@ -106,11 +106,11 @@ struct R_INTERFACE_BUTTON { struct R_INTERFACE_PANEL { - uchar *res; + byte *res; size_t res_len; int x; int y; - uchar *img; + byte *img; size_t img_len; int img_w; int img_h; diff --git a/saga/isomap.cpp b/saga/isomap.cpp index 12228efa54..1e1d91bb97 100644 --- a/saga/isomap.cpp +++ b/saga/isomap.cpp @@ -55,15 +55,15 @@ int ISOMAP_Init(void) return R_SUCCESS; } -int ISOMAP_LoadTileset(const uchar * tileres_p, size_t tileres_len) +int ISOMAP_LoadTileset(const byte * tileres_p, size_t tileres_len) { R_ISOTILE_ENTRY first_entry; R_ISOTILE_ENTRY *tile_tbl; - uint i; + uint16 i; - const uchar *read_p = tileres_p; + const byte *read_p = tileres_p; size_t read_len = tileres_len; assert((IsoModule.init) && (!IsoModule.tiles_loaded)); @@ -100,16 +100,16 @@ int ISOMAP_LoadTileset(const uchar * tileres_p, size_t tileres_len) return R_SUCCESS; } -int ISOMAP_LoadMetaTileset(const uchar * mtileres_p, size_t mtileres_len) +int ISOMAP_LoadMetaTileset(const byte * mtileres_p, size_t mtileres_len) { R_ISO_METATILE_ENTRY *mtile_tbl; - const uchar *read_p = mtileres_p; + const byte *read_p = mtileres_p; size_t read_len = mtileres_len; - uint mtile_ct; - uint ct; + uint16 mtile_ct; + uint16 ct; int i; @@ -148,10 +148,10 @@ int ISOMAP_LoadMetaTileset(const uchar * mtileres_p, size_t mtileres_len) return R_SUCCESS; } -int ISOMAP_LoadMetamap(const uchar * mm_res_p, size_t mm_res_len) +int ISOMAP_LoadMetamap(const byte * mm_res_p, size_t mm_res_len) { - const uchar *read_p = mm_res_p; + const byte *read_p = mm_res_p; size_t read_len = mm_res_len; int i; @@ -225,7 +225,7 @@ int ISOMAP_DrawMetamap(R_SURFACE * dst_s, int map_x, int map_y) } int -ISOMAP_DrawMetaTile(R_SURFACE * dst_s, uint mtile_i, int mtile_x, int mtile_y) +ISOMAP_DrawMetaTile(R_SURFACE * dst_s, uint16 mtile_i, int mtile_x, int mtile_y) { int tile_xi; @@ -276,13 +276,13 @@ ISOMAP_DrawMetaTile(R_SURFACE * dst_s, uint mtile_i, int mtile_x, int mtile_y) return R_SUCCESS; } -int ISOMAP_DrawTile(R_SURFACE * dst_s, uint tile_i, int tile_x, int tile_y) +int ISOMAP_DrawTile(R_SURFACE * dst_s, uint16 tile_i, int tile_x, int tile_y) { - const uchar *tile_p; - const uchar *read_p; + const byte *tile_p; + const byte *read_p; - uchar *draw_p; + byte *draw_p; int draw_x; int draw_y; diff --git a/saga/isomap.h b/saga/isomap.h index f3a3ca7993..413d4bde6c 100644 --- a/saga/isomap.h +++ b/saga/isomap.h @@ -73,29 +73,29 @@ struct R_ISOMAP_MODULE { int init; int tiles_loaded; - const uchar *tileres_p; + const byte *tileres_p; size_t tileres_len; - uint tile_ct; + uint16 tile_ct; R_ISOTILE_ENTRY *tile_tbl; int mtiles_loaded; - const uchar *mtileres_p; + const byte *mtileres_p; size_t mtileres_len; - uint mtile_ct; + uint16 mtile_ct; R_ISO_METATILE_ENTRY *mtile_tbl; int metamap_loaded; int metamap_n; - uint metamap_tbl[SAGA_METAMAP_SIZE]; - const uchar *mm_res_p; + uint16 metamap_tbl[SAGA_METAMAP_SIZE]; + const byte *mm_res_p; size_t mm_res_len; }; -int ISOMAP_DrawTile(R_SURFACE * dst_s, uint tile_i, int tile_x, int tile_y); +int ISOMAP_DrawTile(R_SURFACE * dst_s, uint16 tile_i, int tile_x, int tile_y); int -ISOMAP_DrawMetaTile(R_SURFACE * dst_s, uint mtile_i, int mtile_x, int mtile_y); +ISOMAP_DrawMetaTile(R_SURFACE * dst_s, uint16 mtile_i, int mtile_x, int mtile_y); int ISOMAP_DrawMetamap(R_SURFACE * dst_s, int map_x, int map_y); diff --git a/saga/isomap_mod.h b/saga/isomap_mod.h index f18200758a..c9a8261537 100644 --- a/saga/isomap_mod.h +++ b/saga/isomap_mod.h @@ -35,11 +35,11 @@ namespace Saga { int ISOMAP_Init(void); -int ISOMAP_LoadTileset(const uchar *, size_t); +int ISOMAP_LoadTileset(const byte *, size_t); -int ISOMAP_LoadMetaTileset(const uchar *, size_t); +int ISOMAP_LoadMetaTileset(const byte *, size_t); -int ISOMAP_LoadMetamap(const uchar * mm_res_p, size_t mm_res_len); +int ISOMAP_LoadMetamap(const byte * mm_res_p, size_t mm_res_len); int ISOMAP_Draw(R_SURFACE * dst_s); diff --git a/saga/ite_introproc.h b/saga/ite_introproc.h index 95c94ef8b1..b8a7f07b1d 100644 --- a/saga/ite_introproc.h +++ b/saga/ite_introproc.h @@ -63,7 +63,7 @@ enum R_INTRO_SCENE_DIALOGUE_INFO { struct R_INTRO_DIALOGUE { - ulong i_voice_rn; + uint32 i_voice_rn; const char *i_cvar_name; char i_str[R_INTRO_STRMAX]; diff --git a/saga/music.cpp b/saga/music.cpp index a23ace3a07..845a0fa551 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -158,11 +158,11 @@ Music::~Music() { delete _player; } -int Music::play(ulong music_rn, uint flags) { +int Music::play(uint32 music_rn, uint16 flags) { R_RSCFILE_CONTEXT *rsc_ctxt = NULL; const char *midi_file = NULL; - uchar *resource_data; + byte *resource_data; size_t resource_size; if (!_musicInitialized) { @@ -310,7 +310,7 @@ int Music::play(ulong music_rn, uint flags) { if (midi_file) { debug(0, "Using external MIDI file: %s.mid", midi_file); resource_size = f_midi.size(); - resource_data = (uchar *) malloc(resource_size); + resource_data = (byte *) malloc(resource_size); f_midi.read(resource_data, resource_size); f_midi.close(); diff --git a/saga/music.h b/saga/music.h index 3b2065a858..201efab566 100644 --- a/saga/music.h +++ b/saga/music.h @@ -100,7 +100,7 @@ class Music { ~Music(void); void hasNativeMT32(bool b) { _player->hasNativeMT32(b); } - int play(ulong music_rn, uint flags); + int play(uint32 music_rn, uint16 flags); int pause(void); int resume(void); int stop(void); diff --git a/saga/objectmap.cpp b/saga/objectmap.cpp index 5105bb54df..6d912185fd 100644 --- a/saga/objectmap.cpp +++ b/saga/objectmap.cpp @@ -101,7 +101,7 @@ int OBJECTMAP_Shutdown(void) return R_SUCCESS; } -int OBJECTMAP_Load(const uchar * om_res, size_t om_res_len) +int OBJECTMAP_Load(const byte * om_res, size_t om_res_len) /*--------------------------------------------------------------------------*\ * Loads an object map resource ( objects ( clickareas ( points ) ) ) \*--------------------------------------------------------------------------*/ @@ -320,7 +320,7 @@ int OBJECTMAP_GetName(int object, const char **name) return R_SUCCESS; } -int OBJECTMAP_GetFlags(int object, uint * flags) +int OBJECTMAP_GetFlags(int object, uint16 * flags) { int i; diff --git a/saga/objectmap.h b/saga/objectmap.h index 12ffd76d28..d95c563bb6 100644 --- a/saga/objectmap.h +++ b/saga/objectmap.h @@ -44,7 +44,7 @@ struct R_CLICKAREA { struct R_OBJECTMAP_ENTRY { int unknown0; - uint flags; + uint16 flags; int object_num; int script_num; diff --git a/saga/objectmap_mod.h b/saga/objectmap_mod.h index b1a1c13ae6..ac130ab761 100644 --- a/saga/objectmap_mod.h +++ b/saga/objectmap_mod.h @@ -45,17 +45,17 @@ int OBJECTMAP_Init(void); int OBJECTMAP_Shutdown(void); -int OBJECTMAP_Load(const uchar * om_res, size_t om_res_len); +int OBJECTMAP_Load(const byte * om_res, size_t om_res_len); int OBJECTMAP_Free(void); -int OBJECTMAP_LoadNames(const uchar * onl_res, size_t onl_res_len); +int OBJECTMAP_LoadNames(const byte * onl_res, size_t onl_res_len); int OBJECTMAP_FreeNames(void); int OBJECTMAP_GetName(int object, const char **name); -int OBJECTMAP_GetFlags(int object, uint * flags); +int OBJECTMAP_GetFlags(int object, uint16 * flags); int OBJECTMAP_GetEPNum(int object, int *ep_num); diff --git a/saga/palanim.cpp b/saga/palanim.cpp index a780794ae8..9d36a32b3d 100644 --- a/saga/palanim.cpp +++ b/saga/palanim.cpp @@ -48,12 +48,12 @@ namespace Saga { static PALANIM_DATA PAnimData; -int PALANIM_Load(const uchar * resdata, size_t resdata_len) +int PALANIM_Load(const byte * resdata, size_t resdata_len) { - const uchar *read_p = resdata; + const byte *read_p = resdata; void *test_p; - uint i; + uint16 i; YS_IGNORE_PARAM(resdata_len); @@ -108,7 +108,7 @@ int PALANIM_Load(const uchar * resdata, size_t resdata_len) return R_MEM; } - PAnimData.entries[i].pal_index = (uchar *)test_p; + PAnimData.entries[i].pal_index = (byte *)test_p; # if 0 R_printf(R_STDOUT, @@ -127,18 +127,18 @@ int PALANIM_Load(const uchar * resdata, size_t resdata_len) for (p = 0; p < pal_count; p++) { PAnimData.entries[i].pal_index[p] = - (uchar) ys_read_u8(read_p, &read_p); + (byte) ys_read_u8(read_p, &read_p); } for (c = 0; c < color_count; c++) { PAnimData.entries[i].colors[c].red = - (uchar) ys_read_u8(read_p, &read_p); + (byte) ys_read_u8(read_p, &read_p); PAnimData.entries[i].colors[c].green = - (uchar) ys_read_u8(read_p, &read_p); + (byte) ys_read_u8(read_p, &read_p); PAnimData.entries[i].colors[c].blue = - (uchar) ys_read_u8(read_p, &read_p); + (byte) ys_read_u8(read_p, &read_p); } } @@ -172,12 +172,12 @@ int PALANIM_CycleStep(int vectortime) R_SURFACE *back_buf; static PALENTRY pal[256]; - uint pal_index; - uint col_index; + uint16 pal_index; + uint16 col_index; - uint i, j; - uint cycle; - uint cycle_limit; + uint16 i, j; + uint16 cycle; + uint16 cycle_limit; R_EVENT event; @@ -200,14 +200,14 @@ int PALANIM_CycleStep(int vectortime) col_index = (cycle + j) % cycle_limit; pal[pal_index].red = - (uchar) PAnimData.entries[i].colors[col_index].red; + (byte) PAnimData.entries[i].colors[col_index].red; pal[pal_index].green = - (uchar) PAnimData.entries[i].colors[col_index]. + (byte) PAnimData.entries[i].colors[col_index]. green; pal[pal_index].blue = - (uchar) PAnimData.entries[i].colors[col_index]. + (byte) PAnimData.entries[i].colors[col_index]. blue; } @@ -234,7 +234,7 @@ int PALANIM_CycleStep(int vectortime) int PALANIM_Free(void) { - uint i; + uint16 i; if (!PAnimData.loaded) { return R_FAILURE; diff --git a/saga/palanim.h b/saga/palanim.h index 8fb4a87372..b8e7a44c42 100644 --- a/saga/palanim.h +++ b/saga/palanim.h @@ -39,11 +39,11 @@ namespace Saga { struct PALANIM_ENTRY { - uint pal_count; - uint color_count; - uint cycle; + uint16 pal_count; + uint16 color_count; + uint16 cycle; - uchar *pal_index; + byte *pal_index; R_COLOR *colors; }; @@ -51,7 +51,7 @@ struct PALANIM_ENTRY { struct PALANIM_DATA { int loaded; - uint entry_count; + uint16 entry_count; PALANIM_ENTRY *entries; diff --git a/saga/palanim_mod.h b/saga/palanim_mod.h index 516af1374c..da7a9ba186 100644 --- a/saga/palanim_mod.h +++ b/saga/palanim_mod.h @@ -33,7 +33,7 @@ namespace Saga { -int PALANIM_Load(const uchar *, size_t); +int PALANIM_Load(const byte *, size_t); int PALANIM_CycleStart(void); diff --git a/saga/reinherit.h b/saga/reinherit.h index 49f30b3ace..57adf759b7 100644 --- a/saga/reinherit.h +++ b/saga/reinherit.h @@ -69,16 +69,6 @@ typedef struct R_SEMAPHORE_tag R_SEMAPHORE; * Define common data types \*--------------------------------------------------------------------------*/ -#ifndef HAVE_UCHAR -typedef unsigned char uchar; -#endif -#ifndef HAVE_ULONG -typedef unsigned long ulong; -#endif -#ifndef HAVE_UINT -typedef unsigned int uint; -#endif - typedef Common::Point R_POINT; typedef Common::Rect R_RECT; @@ -91,7 +81,7 @@ struct R_COLOR { }; struct R_SURFACE { - uchar *buf; + byte *buf; int buf_w; int buf_h; int buf_pitch; @@ -132,10 +122,10 @@ enum R_ERRORCODE { /* * r_transitions.c \*--------------------------------------------------------------------------*/ -int TRANSITION_Dissolve(uchar *dst_img, +int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h, - int dst_p, const uchar *src_img, int src_p, int flags, double percent); + int dst_p, const byte *src_img, int src_p, int flags, double percent); /*--------------------------------------------------------------------------*\ * System specific routines @@ -147,7 +137,6 @@ int TRANSITION_Dissolve(uchar *dst_img, #define R_PAL_ENTRIES 256 struct R_SYSGFX_INIT { - int backbuf_w; int backbuf_h; int backbuf_bpp; @@ -157,7 +146,6 @@ struct R_SYSGFX_INIT { int screen_bpp; int fullscreen; - }; int SYSGFX_Init(R_SYSGFX_INIT *); diff --git a/saga/render.cpp b/saga/render.cpp index ba0f3e5c7f..bae8b25360 100644 --- a/saga/render.cpp +++ b/saga/render.cpp @@ -171,7 +171,7 @@ int RENDER_Init(void) RenderModule.r_bg_buf_w = disp_info.logical_w; RenderModule.r_bg_buf_h = disp_info.logical_h; - RenderModule.r_bg_buf = (uchar *)calloc(disp_info.logical_w, + RenderModule.r_bg_buf = (byte *)calloc(disp_info.logical_w, disp_info.logical_h); if (RenderModule.r_bg_buf == NULL) { @@ -194,7 +194,7 @@ int RENDER_Init(void) tmp_bytepp = 2; } - RenderModule.r_tmp_buf = (uchar *)calloc(1, tmp_w * tmp_h * tmp_bytepp); + RenderModule.r_tmp_buf = (byte *)calloc(1, tmp_w * tmp_h * tmp_bytepp); if (RenderModule.r_tmp_buf == NULL) { free(RenderModule.r_bg_buf); diff --git a/saga/render.h b/saga/render.h index 30bf3e8c88..4b30e14705 100644 --- a/saga/render.h +++ b/saga/render.h @@ -58,11 +58,11 @@ struct R_RENDER_MODULE { R_SURFACE *r_display_surface; R_SURFACE *r_backbuf_surface; - uchar *r_bg_buf; + byte *r_bg_buf; int r_bg_buf_w; int r_bg_buf_h; - uchar *r_tmp_buf; + byte *r_tmp_buf; int r_tmp_buf_w; int r_tmp_buf_h; diff --git a/saga/render_mod.h b/saga/render_mod.h index bc5d83af3e..25ca125e96 100644 --- a/saga/render_mod.h +++ b/saga/render_mod.h @@ -55,11 +55,11 @@ enum RENDER_MODES { struct R_BUFFER_INFO { - uchar *r_bg_buf; + byte *r_bg_buf; int r_bg_buf_w; int r_bg_buf_h; - uchar *r_tmp_buf; + byte *r_tmp_buf; int r_tmp_buf_w; int r_tmp_buf_h; diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp index 5a9ec29afa..712707237d 100644 --- a/saga/rscfile.cpp +++ b/saga/rscfile.cpp @@ -114,17 +114,17 @@ int RSC_DestroyContext(R_RSCFILE_CONTEXT * rsc_context) int RSC_LoadRSC(R_RSCFILE_CONTEXT * rsc) { - ulong res_tbl_ct; - ulong res_tbl_offset; + uint32 res_tbl_ct; + uint32 res_tbl_offset; - uchar tblinfo_buf[RSC_TABLEINFO_SIZE]; - uchar *tbl_buf; + byte tblinfo_buf[RSC_TABLEINFO_SIZE]; + byte *tbl_buf; size_t tbl_len; - ulong i; + uint32 i; R_RSCFILE_RESOURCE *rsc_restbl; - const uchar *read_p; + const byte *read_p; read_p = tblinfo_buf; @@ -155,7 +155,7 @@ int RSC_LoadRSC(R_RSCFILE_CONTEXT * rsc) * \*------------------------------------------------------------- */ tbl_len = RSC_TABLEENTRY_SIZE * res_tbl_ct; - tbl_buf = (uchar *)malloc(tbl_len); + tbl_buf = (byte *)malloc(tbl_len); if (tbl_buf == NULL) { return R_FAILURE; } @@ -208,13 +208,13 @@ int RSC_FreeRSC(R_RSCFILE_CONTEXT * rsc) return R_SUCCESS; } -ulong RSC_GetResourceCount(R_RSCFILE_CONTEXT * rsc) +uint32 RSC_GetResourceCount(R_RSCFILE_CONTEXT * rsc) { return (rsc == NULL) ? 0 : rsc->rc_res_ct; } int -RSC_GetResourceSize(R_RSCFILE_CONTEXT * rsc, ulong res_num, ulong * res_size) +RSC_GetResourceSize(R_RSCFILE_CONTEXT * rsc, uint32 res_num, uint32 * res_size) { if ((rsc == NULL) || (res_size == NULL)) { return R_FAILURE; @@ -231,7 +231,7 @@ RSC_GetResourceSize(R_RSCFILE_CONTEXT * rsc, ulong res_num, ulong * res_size) int RSC_GetResourceOffset(R_RSCFILE_CONTEXT * rsc, - ulong res_num, ulong * res_offset) + uint32 res_num, uint32 * res_offset) { if ((rsc == NULL) || (res_offset == NULL)) { return R_FAILURE; @@ -248,11 +248,11 @@ RSC_GetResourceOffset(R_RSCFILE_CONTEXT * rsc, int RSC_LoadResource(R_RSCFILE_CONTEXT * rsc, - ulong res_num, uchar ** res_p, size_t * res_size_p) + uint32 res_num, byte ** res_p, size_t * res_size_p) { - ulong res_offset; + uint32 res_offset; size_t res_size; - uchar *res_buf; + byte *res_buf; if ((rsc == NULL) || (res_p == NULL)) { return R_FAILURE; @@ -267,7 +267,7 @@ RSC_LoadResource(R_RSCFILE_CONTEXT * rsc, rsc->rc_file.seek((long)res_offset, SEEK_SET); - res_buf = (uchar *)malloc(res_size); + res_buf = (byte *)malloc(res_size); if (res_buf == NULL) { return R_MEM; } @@ -286,7 +286,7 @@ RSC_LoadResource(R_RSCFILE_CONTEXT * rsc, return R_SUCCESS; } -int RSC_FreeResource(uchar * resource_ptr) +int RSC_FreeResource(byte * resource_ptr) { free(resource_ptr); diff --git a/saga/rscfile_mod.h b/saga/rscfile_mod.h index c337ff41e0..47d56cc744 100644 --- a/saga/rscfile_mod.h +++ b/saga/rscfile_mod.h @@ -44,15 +44,15 @@ int RSC_OpenContext(R_RSCFILE_CONTEXT *, const char *); int RSC_CloseContext(R_RSCFILE_CONTEXT *); -ulong RSC_GetResourceCount(R_RSCFILE_CONTEXT *); +uint32 RSC_GetResourceCount(R_RSCFILE_CONTEXT *); -int RSC_GetResourceSize(R_RSCFILE_CONTEXT *, ulong, ulong *); +int RSC_GetResourceSize(R_RSCFILE_CONTEXT *, uint32, uint32 *); -int RSC_GetResourceOffset(R_RSCFILE_CONTEXT *, ulong, ulong *); +int RSC_GetResourceOffset(R_RSCFILE_CONTEXT *, uint32, uint32 *); -int RSC_LoadResource(R_RSCFILE_CONTEXT *, ulong, uchar **, size_t *); +int RSC_LoadResource(R_RSCFILE_CONTEXT *, uint32, byte **, size_t *); -int RSC_FreeResource(uchar *); +int RSC_FreeResource(byte *); } // End of namespace Saga diff --git a/saga/scene.cpp b/saga/scene.cpp index 26e1630860..a675d0b9ad 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -80,10 +80,10 @@ int SCENE_Init(void) R_GAME_SCENEDESC gs_desc; - uchar *scene_lut_p; + byte *scene_lut_p; size_t scene_lut_len; - const uchar *read_p; + const byte *read_p; int result; int i; @@ -478,7 +478,7 @@ int SCENE_GetBGPal(PALENTRY ** pal) return R_SUCCESS; } -int SCENE_GetBGMaskInfo(int *w, int *h, uchar ** buf, size_t * buf_len) +int SCENE_GetBGMaskInfo(int *w, int *h, byte ** buf, size_t * buf_len) { assert(SceneModule.init); @@ -519,7 +519,7 @@ SCENE_Load(int scene_num, { R_SCENE_INFO scene_info; - ulong res_number = 0; + uint32 res_number = 0; int result; int i; @@ -652,13 +652,13 @@ SCENE_Load(int scene_num, return R_SUCCESS; } -int LoadSceneDescriptor(ulong res_number) +int LoadSceneDescriptor(uint32 res_number) { - uchar *scene_desc_data; + byte *scene_desc_data; size_t scene_desc_len; - const uchar *read_p; + const byte *read_p; int result; @@ -694,13 +694,13 @@ int LoadSceneDescriptor(ulong res_number) return R_SUCCESS; } -int LoadSceneResourceList(ulong reslist_rn) +int LoadSceneResourceList(uint32 reslist_rn) { - uchar *resource_list; + byte *resource_list; size_t resource_list_len; - const uchar *read_p; + const byte *read_p; int result; int i; @@ -759,10 +759,10 @@ int LoadSceneResourceList(ulong reslist_rn) int ProcessSceneResources(void) { - const uchar *res_data; + const byte *res_data; size_t res_data_len; - const uchar *pal_p; + const byte *pal_p; int i; @@ -951,7 +951,7 @@ int ProcessSceneResources(void) case SAGA_ANIM_7: { SCENE_ANIMINFO *new_animinfo; - uint new_anim_id; + uint16 new_anim_id; R_printf(R_STDOUT, "Loading animation resource...\n"); diff --git a/saga/scene.h b/saga/scene.h index 06035008e3..cc5af55644 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -71,10 +71,10 @@ enum SAGA_RESOURCE_TYPES { struct R_SCENE_RESLIST { - ulong res_number; + uint32 res_number; int res_type; - uchar *res_data; + byte *res_data; size_t res_data_len; }; @@ -105,10 +105,10 @@ struct SCENE_IMAGE { int h; int p; - uchar *buf; + byte *buf; size_t buf_len; - uchar *res_buf; + byte *res_buf; size_t res_len; PALENTRY pal[256]; @@ -126,7 +126,7 @@ struct SCENE_ANIMINFO { struct R_SCENE_QUEUE { - ulong scene_n; + uint32 scene_n; R_SCENE_DESC *scene_desc; int load_flag; @@ -181,9 +181,9 @@ int SCENE_Load(int scene, int load_flag, R_SCENE_PROC scene_proc, R_SCENE_DESC *); -int LoadSceneDescriptor(ulong res_number); +int LoadSceneDescriptor(uint32 res_number); -int LoadSceneResourceList(ulong res_number); +int LoadSceneResourceList(uint32 res_number); int ProcessSceneResources(void); diff --git a/saga/scene_mod.h b/saga/scene_mod.h index 7caaf2abef..9f3c007122 100644 --- a/saga/scene_mod.h +++ b/saga/scene_mod.h @@ -61,7 +61,7 @@ struct SCENE_BGINFO { int bg_h; int bg_p; - uchar *bg_buf; + byte *bg_buf; size_t bg_buflen; }; @@ -89,7 +89,7 @@ int SCENE_End(void); int SCENE_Draw(R_SURFACE *); int SCENE_GetMode(void); -int SCENE_GetBGMaskInfo(int *w, int *h, uchar ** buf, size_t * buf_len); +int SCENE_GetBGMaskInfo(int *w, int *h, byte ** buf, size_t * buf_len); int SCENE_IsBGMaskPresent(void); int SCENE_GetBGInfo(SCENE_BGINFO * bginfo); diff --git a/saga/script.cpp b/saga/script.cpp index 5c9a0db422..d90b257f08 100644 --- a/saga/script.cpp +++ b/saga/script.cpp @@ -77,11 +77,11 @@ int SCRIPT_Init(void) { R_RSCFILE_CONTEXT *s_lut_ctxt; - uchar *rsc_ptr; + byte *rsc_ptr; size_t rsc_len; - const uchar *read_ptr; - const uchar *read_ptr2; + const byte *read_ptr; + const byte *read_ptr2; int result; int i; @@ -232,17 +232,17 @@ int SCRIPT_Load(int script_num) R_SCRIPTDATA *script_data; - uchar *bytecode_p; + byte *bytecode_p; size_t bytecode_len; - ulong scriptl_rn; + uint32 scriptl_rn; - uchar *diagl_p; + byte *diagl_p; size_t diagl_len; - ulong diagl_rn; + uint32 diagl_rn; - uchar *voicelut_p; + byte *voicelut_p; size_t voicelut_len; - ulong voicelut_rn; + uint32 voicelut_rn; int result; @@ -415,7 +415,7 @@ int SCRIPT_Free(void) return R_SUCCESS; } -R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(uchar * bytecode_p, +R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(byte * bytecode_p, size_t bytecode_len) /*--------------------------------------------------------------------------*\ * Reads the entrypoint table from a script bytecode resource in memory. @@ -423,7 +423,7 @@ R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(uchar * bytecode_p, \*--------------------------------------------------------------------------*/ { - const uchar *read_p = bytecode_p; + const byte *read_p = bytecode_p; R_PROC_TBLENTRY *bc_ep_tbl = NULL; R_SCRIPT_BYTECODE *bc_new_data = NULL; @@ -494,7 +494,7 @@ R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(uchar * bytecode_p, } } - bc_new_data->bytecode_p = (uchar *) bytecode_p; + bc_new_data->bytecode_p = (byte *) bytecode_p; bc_new_data->bytecode_len = bytecode_len; bc_new_data->n_entrypoints = n_entrypoints; @@ -504,19 +504,19 @@ R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(uchar * bytecode_p, return bc_new_data; } -R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const uchar * dialogue_p, +R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const byte * dialogue_p, size_t dialogue_len) /*--------------------------------------------------------------------------*\ * Reads a logical dialogue list from a dialogue list resource in memory. * Returns NULL on failure. \*--------------------------------------------------------------------------*/ { - const uchar *read_p = dialogue_p; + const byte *read_p = dialogue_p; R_DIALOGUE_LIST *dialogue_list; - uint n_dialogue; + uint16 n_dialogue; - uint i; + uint16 i; size_t offset; R_printf(R_STDOUT, "Loading dialogue list...\n"); @@ -572,19 +572,19 @@ R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const uchar * dialogue_p, return dialogue_list; } -R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const uchar * voicelut_p, +R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const byte * voicelut_p, size_t voicelut_len, R_SCRIPTDATA * script) /*--------------------------------------------------------------------------*\ * Reads a logical voice LUT from a voice LUT resource in memory. * Returns NULL on failure. \*--------------------------------------------------------------------------*/ { - const uchar *read_p = voicelut_p; + const byte *read_p = voicelut_p; R_VOICE_LUT *voice_lut; - uint n_voices; - uint i; + uint16 n_voices; + uint16 i; voice_lut = (R_VOICE_LUT *)malloc(sizeof *voice_lut); if (voice_lut == NULL) { @@ -615,8 +615,8 @@ R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const uchar * voicelut_p, void CF_script_info(int argc, char *argv[]) { - ulong n_entrypoints; - ulong i; + uint32 n_entrypoints; + uint32 i; char *name_ptr; if (ScriptModule.current_script == NULL) { @@ -645,7 +645,7 @@ void CF_script_info(int argc, char *argv[]) void CF_script_exec(int argc, char *argv[]) { - uint ep_num; + uint16 ep_num; if (argc < 1) { return; diff --git a/saga/script.h b/saga/script.h index 961258cd9d..1522221a5b 100644 --- a/saga/script.h +++ b/saga/script.h @@ -118,7 +118,7 @@ struct R_SCRIPT_MODULE { int voice_lut_present; R_SCRIPT_LUT_ENTRY *script_lut; int script_lut_max; - uint script_lut_entrylen; + uint16 script_lut_entrylen; R_SCRIPTDATA *current_script; YS_DL_LIST *thread_list; @@ -133,13 +133,13 @@ struct R_SCRIPT_MODULE { extern R_SCRIPT_MODULE ScriptModule; -R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(uchar * bytecode_p, +R_SCRIPT_BYTECODE *SCRIPT_LoadBytecode(byte * bytecode_p, size_t bytecode_len); -R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const uchar * dialogue_p, +R_DIALOGUE_LIST *SCRIPT_LoadDialogue(const byte * dialogue_p, size_t dialogue_len); -R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const uchar * voicelut_p, +R_VOICE_LUT *SCRIPT_LoadVoiceLUT(const byte * voicelut_p, size_t voicelut_len, R_SCRIPTDATA * script); int diff --git a/saga/script_mod.h b/saga/script_mod.h index ec824e6ce2..ad3dc8b9ef 100644 --- a/saga/script_mod.h +++ b/saga/script_mod.h @@ -70,7 +70,7 @@ int SDATA_GetBit(int n_buf, SDataWord_T n_bit, int *bitstate); int SDATA_ReadWordS(SDataWord_T word); -uint SDATA_ReadWordU(SDataWord_T word); +uint16 SDATA_ReadWordU(SDataWord_T word); R_SCRIPT_THREAD *STHREAD_Create(void); diff --git a/saga/sdata.cpp b/saga/sdata.cpp index 7ab9e4c056..bb7f69e772 100644 --- a/saga/sdata.cpp +++ b/saga/sdata.cpp @@ -188,7 +188,7 @@ int SDATA_GetBit(int n_buf, SDataWord_T n_bit, int *bitstate) int SDATA_ReadWordS(SDataWord_T word) { - uint u_int = word; + uint16 u_int = word; int s_int; if (u_int & 0x8000U) { @@ -200,9 +200,9 @@ int SDATA_ReadWordS(SDataWord_T word) return s_int; } -uint SDATA_ReadWordU(SDataWord_T word) +uint16 SDATA_ReadWordU(SDataWord_T word) { - uint u_int = (uint) word; + uint16 u_int = (uint16) word; return u_int; } diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp index fa8986238e..b7e24d61c0 100644 --- a/saga/sdebug.cpp +++ b/saga/sdebug.cpp @@ -59,8 +59,8 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD * thread) R_TEXTLIST_ENTRY tl_e; - const uchar *start_p; - const uchar *read_p; + const byte *start_p; + const byte *read_p; char tmp_buf[80] = { 0 }; static char disp_buf[SD_DISPLAY_LEN] = { 0 }; diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 782fa56878..8e586983cb 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -598,7 +598,7 @@ int SF_SetActorAct(R_SCRIPTFUNC_PARAMS) int actor_idx; int action; - /*uint flags; */ + /*uint16 flags; */ SSTACK_Pop(thread->stack, &actor_parm); @@ -644,7 +644,7 @@ int SF_SetActorAct2(R_SCRIPTFUNC_PARAMS) int actor_idx; int action; - /*uint flags; */ + /*uint16 flags; */ SSTACK_Pop(thread->stack, &actor_parm); @@ -687,8 +687,8 @@ int SF_LinkAnim(R_SCRIPTFUNC_PARAMS) int tframes; - uint anim_id1; - uint anim_id2; + uint16 anim_id1; + uint16 anim_id2; SSTACK_Pop(thread->stack, &anim1_parm); SSTACK_Pop(thread->stack, &anim2_parm); diff --git a/saga/sndres.cpp b/saga/sndres.cpp index 854422c576..3e6d45e895 100644 --- a/saga/sndres.cpp +++ b/saga/sndres.cpp @@ -71,7 +71,7 @@ SndRes::SndRes(SagaEngine *vm) { _init = 1; } -int SndRes::playVoice(ulong voice_rn) { +int SndRes::playVoice(uint32 voice_rn) { R_SOUNDBUFFER snd_buffer; int result; @@ -92,8 +92,8 @@ int SndRes::playVoice(ulong voice_rn) { return R_SUCCESS; } -int SndRes::load(R_RSCFILE_CONTEXT *snd_ctxt, ulong snd_rn, R_SOUNDBUFFER *snd_buf_i) { - uchar *snd_res; +int SndRes::load(R_RSCFILE_CONTEXT *snd_ctxt, uint32 snd_rn, R_SOUNDBUFFER *snd_buf_i) { + byte *snd_res; size_t snd_res_len; int result; @@ -149,8 +149,8 @@ int SndRes::loadVocSound(byte *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_b long byte_rate; - const uchar *read_p; - size_t read_len; + const byte *read_p; + uint16 read_len; read_p = snd_res; read_len = snd_res_len; @@ -235,8 +235,8 @@ int SndRes::loadVocSound(byte *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_b return R_SUCCESS; } -int SndRes::getVoiceLength(ulong voice_rn) { - ulong length; +int SndRes::getVoiceLength(uint32 voice_rn) { + uint32 length; double ms_f; int ms_i = -1; @@ -267,20 +267,20 @@ int SndRes::getVoiceLength(ulong voice_rn) { return ms_i; } -int SndRes::ITEVOC_Resample(long src_freq, long dst_freq, uchar *src_buf, - size_t src_buf_len, uchar **dst_buf, size_t *dst_buf_len) { - uchar *resamp_buf; +int SndRes::ITEVOC_Resample(long src_freq, long dst_freq, byte *src_buf, + size_t src_buf_len, byte **dst_buf, size_t *dst_buf_len) { + byte *resamp_buf; size_t resamp_len; - uchar src_samp_a; - uchar src_samp_b; + byte src_samp_a; + byte src_samp_b; - const uchar *read_pa; - const uchar *read_pb; + const byte *read_pa; + const byte *read_pb; - uchar *write_pa; - uchar *write_pb; - uchar *write_pc; + byte *write_pa; + byte *write_pb; + byte *write_pc; size_t src_i; @@ -288,7 +288,7 @@ int SndRes::ITEVOC_Resample(long src_freq, long dst_freq, uchar *src_buf, assert(dst_freq == 22050); resamp_len = (size_t) (src_buf_len * 1.5); - resamp_buf = (uchar *)malloc(resamp_len); + resamp_buf = (byte *)malloc(resamp_len); if (resamp_buf == NULL) { return R_FAILURE; } @@ -308,7 +308,7 @@ int SndRes::ITEVOC_Resample(long src_freq, long dst_freq, uchar *src_buf, read_pb += 2; *write_pa = src_samp_a; - *write_pb = (uchar) ((src_samp_a / 2) + (src_samp_b / 2)); + *write_pb = (byte) ((src_samp_a / 2) + (src_samp_b / 2)); *write_pc = src_samp_b; write_pa += 3; diff --git a/saga/sndres.h b/saga/sndres.h index 1d4e797d87..759a62ee0d 100644 --- a/saga/sndres.h +++ b/saga/sndres.h @@ -45,24 +45,24 @@ namespace Saga { struct R_VOC_HEADER_BLOCK { char ft_desc[20]; /* BYTE [20] */ - uint db_offset; /* WORD */ - uint voc_version; /* WORD */ - uint voc_fileid; /* WORD */ + uint16 db_offset; /* WORD */ + uint16 voc_version; /* WORD */ + uint16 voc_fileid; /* WORD */ }; #define R_VOC_HEADER_BLOCK_LEN 26 struct R_VOC_GENBLOCK { int block_id; /* BYTE */ - ulong block_len; /* BYTE[3] */ + uint32 block_len; /* BYTE[3] */ }; #define R_VOC_GENBLOCK_LEN 4 struct R_VOC_BLOCK1 { int block_id; /* BYTE */ - ulong block_len; /* BYTE[3] */ - uint time_constant; /* BYTE */ + uint32 block_len; /* BYTE[3] */ + uint16 time_constant; /* BYTE */ int pack_method; /* BYTE */ }; @@ -71,14 +71,14 @@ class SndRes { SndRes(SagaEngine *vm); - int loadSound(ulong sound_rn); - int playVoice(ulong voice_rn); - int getVoiceLength(ulong voice_rn); - int ITEVOC_Resample(long src_freq, long dst_freq, uchar *src_buf, - size_t src_buf_len, uchar **dst_buf, size_t *dst_buf_len); + int loadSound(uint32 sound_rn); + int playVoice(uint32 voice_rn); + int getVoiceLength(uint32 voice_rn); + int ITEVOC_Resample(long src_freq, long dst_freq, byte *src_buf, + size_t src_buf_len, byte **dst_buf, size_t *dst_buf_len); private: - int load(R_RSCFILE_CONTEXT *snd_ctxt, ulong snd_rn, R_SOUNDBUFFER *snd_buf_i); + int load(R_RSCFILE_CONTEXT *snd_ctxt, uint32 snd_rn, R_SOUNDBUFFER *snd_buf_i); int loadVocSound(byte *snd_res, size_t snd_res_len, R_SOUNDBUFFER *snd_buf_i); int _init; diff --git a/saga/sound.h b/saga/sound.h index 8101925c3a..9aeaa5799a 100644 --- a/saga/sound.h +++ b/saga/sound.h @@ -41,12 +41,12 @@ struct R_SOUNDBUFFER { byte *res_data; uint32 res_len; - uint s_freq; + uint16 s_freq; int s_samplebits; int s_stereo; int s_signed; - const uchar *s_buf; + const byte *s_buf; size_t s_buf_len; }; diff --git a/saga/sprite.cpp b/saga/sprite.cpp index 9eec66e78b..0339e5f00a 100644 --- a/saga/sprite.cpp +++ b/saga/sprite.cpp @@ -74,7 +74,7 @@ int SPRITE_Init(void) SpriteModule.decode_buf_len = R_DECODE_BUF_LEN; - SpriteModule.decode_buf = (uchar *)malloc(R_DECODE_BUF_LEN); + SpriteModule.decode_buf = (byte *)malloc(R_DECODE_BUF_LEN); if (SpriteModule.decode_buf == NULL) { return R_MEM; } @@ -101,13 +101,13 @@ int SPRITE_LoadList(int resource_num, R_SPRITELIST ** sprite_list_p) { R_SPRITELIST *new_slist; - uchar *spritelist_data; + byte *spritelist_data; size_t spritelist_len; - const uchar *read_p; + const byte *read_p; - uint sprite_count; - uint i; + uint16 sprite_count; + uint16 i; new_slist = (R_SPRITELIST *)malloc(sizeof *new_slist); if (new_slist == NULL) { @@ -153,16 +153,16 @@ int SPRITE_LoadList(int resource_num, R_SPRITELIST ** sprite_list_p) int SPRITE_AppendList(int resource_num, R_SPRITELIST * spritelist) { - uchar *spritelist_data; + byte *spritelist_data; size_t spritelist_len; - const uchar *read_p; + const byte *read_p; void *test_p; - uint old_sprite_count; - uint new_sprite_count; - uint sprite_count; + uint16 old_sprite_count; + uint16 new_sprite_count; + uint16 sprite_count; int i; @@ -236,15 +236,15 @@ SPRITE_Draw(R_SURFACE * ds, int offset; int offset_idx; - uchar *sprite_p; + byte *sprite_p; - const uchar *sprite_data_p; - const uchar *read_p; + const byte *sprite_data_p; + const byte *read_p; int i, j; - uchar *buf_row_p; - uchar *src_row_p; + byte *buf_row_p; + byte *src_row_p; int s_width; int s_height; @@ -265,7 +265,7 @@ SPRITE_Draw(R_SURFACE * ds, sprite_p = sprite_list->sprite_data[offset_idx]; sprite_p += offset; - read_p = (uchar *) sprite_p; + read_p = (byte *) sprite_p; x_align = ys_read_s8(read_p, &read_p); y_align = ys_read_s8(read_p, &read_p); @@ -326,18 +326,18 @@ SPRITE_DrawOccluded(R_SURFACE * ds, int offset; int offset_idx; - uchar *sprite_p; - const uchar *sprite_data_p; - const uchar *read_p; + byte *sprite_p; + const byte *sprite_data_p; + const byte *read_p; int i; int x, y; - uchar *dst_row_p; - uchar *src_row_p; - uchar *src_p; - uchar *dst_p; - uchar *mask_p; + byte *dst_row_p; + byte *src_row_p; + byte *src_p; + byte *dst_p; + byte *mask_p; int s_width; int s_height; @@ -357,10 +357,10 @@ SPRITE_DrawOccluded(R_SURFACE * ds, /* BG mask variables */ int mask_w; int mask_h; - uchar *mask_buf; + byte *mask_buf; size_t mask_buf_len; - uchar *mask_row_p; + byte *mask_row_p; int mask_z; /* Z info variables */ @@ -499,18 +499,18 @@ SPRITE_DrawOccluded(R_SURFACE * ds, } int -DecodeRLESprite(const uchar * inbuf, - size_t inbuf_len, uchar * outbuf, size_t outbuf_len) +DecodeRLESprite(const byte * inbuf, + size_t inbuf_len, byte * outbuf, size_t outbuf_len) { int bg_runcount; int fg_runcount; - const uchar *inbuf_ptr; - uchar *outbuf_ptr; + const byte *inbuf_ptr; + byte *outbuf_ptr; - const uchar *inbuf_end; - uchar *outbuf_end; + const byte *inbuf_end; + byte *outbuf_end; int c; @@ -540,7 +540,7 @@ DecodeRLESprite(const uchar * inbuf, for (c = 0; c < bg_runcount; c++) { - *outbuf_ptr = (uchar) 0; + *outbuf_ptr = (byte) 0; if (outbuf_ptr < outbuf_end) outbuf_ptr++; else diff --git a/saga/sprite.h b/saga/sprite.h index c3c5b445ef..4279e93296 100644 --- a/saga/sprite.h +++ b/saga/sprite.h @@ -51,7 +51,7 @@ struct R_SPRITELIST_ENTRY { struct R_SPRITELIST_OFFSET { - uint data_idx; + uint16 data_idx; size_t offset; }; @@ -64,7 +64,7 @@ struct R_SPRITELIST_tag { R_SPRITELIST_OFFSET *offset_list; int slist_rn; - uchar *sprite_data[R_APPENDMAX]; + byte *sprite_data[R_APPENDMAX]; }; @@ -74,14 +74,14 @@ struct R_SPRITE_MODULE { R_RSCFILE_CONTEXT *sprite_ctxt; - uchar *decode_buf; + byte *decode_buf; size_t decode_buf_len; }; int -DecodeRLESprite(const uchar * inbuf, - size_t inbuf_len, uchar * outbuf, size_t outbuf_len); +DecodeRLESprite(const byte * inbuf, + size_t inbuf_len, byte * outbuf, size_t outbuf_len); } // End of namespace Saga diff --git a/saga/sthread.cpp b/saga/sthread.cpp index b72d3da07c..c63e3088ed 100644 --- a/saga/sthread.cpp +++ b/saga/sthread.cpp @@ -170,7 +170,7 @@ unsigned char *GetReadPtr(R_SCRIPT_THREAD * thread) thread->i_offset; } -unsigned long GetReadOffset(const uchar * read_p) +unsigned long GetReadOffset(const byte * read_p) { return (unsigned long)(read_p - (unsigned char *) @@ -217,8 +217,8 @@ int STHREAD_Run(R_SCRIPT_THREAD * thread, int instr_limit, int msec) int instr_count; - const uchar *read_p; - ulong saved_offset; + const byte *read_p; + uint32 saved_offset; SDataWord_T param1; SDataWord_T param2; @@ -448,7 +448,7 @@ int STHREAD_Run(R_SCRIPT_THREAD * thread, int instr_limit, int msec) case 0x18: { int n_args; - uint func_num; + uint16 func_num; int FIXME_SHADOWED_result; SFunc_T sfunc; diff --git a/saga/sthread.h b/saga/sthread.h index 0ab86dfff1..e796da0a95 100644 --- a/saga/sthread.h +++ b/saga/sthread.h @@ -60,7 +60,7 @@ int STHREAD_Destroy(R_SCRIPT_THREAD *thread); int STHREAD_SetEntrypoint(R_SCRIPT_THREAD *thread, int ep_num); int STHREAD_Execute(R_SCRIPT_THREAD *thread, int ep_num); int STHREAD_Run(R_SCRIPT_THREAD *thread, int instr_limit, int msec); -unsigned long GetReadOffset(const uchar *read_p); +unsigned long GetReadOffset(const byte *read_p); unsigned char *GetReadPtr(R_SCRIPT_THREAD *thread); int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread); diff --git a/saga/sysgfx.cpp b/saga/sysgfx.cpp index 2be4f50e73..f205d2074a 100644 --- a/saga/sysgfx.cpp +++ b/saga/sysgfx.cpp @@ -86,7 +86,7 @@ int SYSGFX_Init(R_SYSGFX_INIT *gfx_init) { sdl_screen->w, sdl_screen->h, sdl_screen->format->BitsPerPixel); /* Convert sdl surface data to R surface data */ - r_screen.buf = (uchar *)sdl_screen->pixels; + r_screen.buf = (byte *)sdl_screen->pixels; r_screen.buf_w = sdl_screen->w; r_screen.buf_h = sdl_screen->h; r_screen.buf_pitch = sdl_screen->pitch; @@ -116,7 +116,7 @@ int SYSGFX_Init(R_SYSGFX_INIT *gfx_init) { } /* Convert sdl surface data to R surface data */ - r_back_buf.buf = (uchar *)sdl_back_buf->pixels; + r_back_buf.buf = (byte *)sdl_back_buf->pixels; r_back_buf.buf_w = sdl_back_buf->w; r_back_buf.buf_h = sdl_back_buf->h; r_back_buf.buf_pitch = sdl_back_buf->pitch; @@ -181,7 +181,7 @@ R_SURFACE *SYSGFX_FormatToDisplay(R_SURFACE *surface) { return NULL; } - new_r_surface->buf = (uchar *)new_sdl_surface->pixels; + new_r_surface->buf = (byte *)new_sdl_surface->pixels; new_r_surface->buf_w = new_sdl_surface->w; new_r_surface->buf_h = new_sdl_surface->h; new_r_surface->buf_pitch = new_sdl_surface->pitch; @@ -295,9 +295,9 @@ int SYSGFX_MatchColor(unsigned long colormask) { int SYSGFX_SetPalette(R_SURFACE *surface, PALENTRY *pal) { - uchar red; - uchar green; - uchar blue; + byte red; + byte green; + byte blue; int color_delta; int best_wdelta = 0; @@ -388,7 +388,7 @@ int SYSGFX_PalToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].r = 0; } else { - cur_pal[i].r = (uchar) new_entry; + cur_pal[i].r = (byte) new_entry; } new_entry = (int)(src_pal[i].green * fpercent); @@ -396,7 +396,7 @@ int SYSGFX_PalToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].g = 0; } else { - cur_pal[i].g = (uchar) new_entry; + cur_pal[i].g = (byte) new_entry; } new_entry = (int)(src_pal[i].blue * fpercent); @@ -404,7 +404,7 @@ int SYSGFX_PalToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].b = 0; } else { - cur_pal[i].b = (uchar) new_entry; + cur_pal[i].b = (byte) new_entry; } } @@ -450,7 +450,7 @@ int SYSGFX_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].r = 0; } else { - cur_pal[i].r = (uchar) new_entry; + cur_pal[i].r = (byte) new_entry; } new_entry = @@ -459,7 +459,7 @@ int SYSGFX_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].g = 0; } else { - cur_pal[i].g = (uchar) new_entry; + cur_pal[i].g = (byte) new_entry; } new_entry = @@ -468,7 +468,7 @@ int SYSGFX_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent) { if (new_entry < 0) { cur_pal[i].b = 0; } else { - cur_pal[i].b = (uchar) new_entry; + cur_pal[i].b = (byte) new_entry; } } diff --git a/saga/systimer.cpp b/saga/systimer.cpp index 0b0a86cdb3..ce383ebda3 100644 --- a/saga/systimer.cpp +++ b/saga/systimer.cpp @@ -106,7 +106,7 @@ int SYSTIMER_ResetMSCounter(void) return R_SUCCESS; } -int SYSTIMER_Sleep(uint msec) +int SYSTIMER_Sleep(uint16 msec) { SDL_Delay(msec); diff --git a/saga/systimer.h b/saga/systimer.h index 5a759518b3..7ddc1a260f 100644 --- a/saga/systimer.h +++ b/saga/systimer.h @@ -33,7 +33,7 @@ int SYSTIMER_InitMSCounter(void); unsigned long SYSTIMER_ReadMSCounter(void); int SYSTIMER_ResetMSCounter(void); -int SYSTIMER_Sleep(uint msec); +int SYSTIMER_Sleep(uint16 msec); int SYSTIMER_CreateTimer(R_SYSTIMER **, unsigned long, void *, R_SYSTIMER_CALLBACK); int SYSTIMER_DestroyTimer(R_SYSTIMER *); diff --git a/saga/transitions.cpp b/saga/transitions.cpp index 759652593d..1e267de599 100644 --- a/saga/transitions.cpp +++ b/saga/transitions.cpp @@ -38,10 +38,10 @@ namespace Saga { int -TRANSITION_Dissolve(uchar * dst_img, +TRANSITION_Dissolve(byte * dst_img, int dst_w, int dst_h, - int dst_p, const uchar * src_img, int src_p, int flags, double percent) + int dst_p, const byte * src_img, int src_p, int flags, double percent) { #define XOR_MASK 0xB400; |