mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Replace "uint" with "uint32_t"
This commit is contained in:
parent
0556786c12
commit
a3a3797067
@ -245,7 +245,7 @@ static char pbtitle[100];
|
||||
static bool ok_to_parse_screen = false;
|
||||
static int skipped_screens;
|
||||
|
||||
static bool IsMissionMaskOK(uint set, uint unset);
|
||||
static bool IsMissionMaskOK(uint32_t set, uint32_t unset);
|
||||
static void ReplaceHotTag(char *string, int tag);
|
||||
static bool ParseForHotTags(char *src, char **dest);
|
||||
static bool PlayBriefing(tTelComInfo *tcs);
|
||||
@ -255,7 +255,7 @@ static void PBAddMovieEffect(LPTCMOVIEDESC desc, char *description);
|
||||
static void PBAddBkgEffect(LPTCBKGDESC desc, char *description);
|
||||
static void PBAddPolyEffect(LPTCPOLYDESC desc, char *description);
|
||||
static void PBAddButtonEffect(LPTCBUTTONDESC desc, char *description, int id);
|
||||
static void PBStartScreen(int screen_num, char *description, char *layout, uint mask_set, uint mask_unset);
|
||||
static void PBStartScreen(int screen_num, char *description, char *layout, uint32_t mask_set, uint32_t mask_unset);
|
||||
static void PBEndScreen();
|
||||
static bool PBLoopCallback();
|
||||
static void PBSetTitle(char *title);
|
||||
@ -263,10 +263,10 @@ static void PBSetStatic(float amount);
|
||||
static void PBSetGlitch(float amount);
|
||||
static void PBAddVoice(char *filename, int flags, char *description);
|
||||
|
||||
bool IsMissionMaskOK(uint set, uint unset) {
|
||||
uint Gamemissionmask = Current_mission.game_state_flags;
|
||||
bool IsMissionMaskOK(uint32_t set, uint32_t unset) {
|
||||
uint32_t Gamemissionmask = Current_mission.game_state_flags;
|
||||
|
||||
uint fGamemissionmask;
|
||||
uint32_t fGamemissionmask;
|
||||
fGamemissionmask = Gamemissionmask ^ 0xFFFFFFFF;
|
||||
|
||||
if (!(((set & Gamemissionmask) == set) && ((unset & fGamemissionmask) == unset))) {
|
||||
@ -504,7 +504,7 @@ void PBAddButtonEffect(LPTCBUTTONDESC desc, const char *description, int id) {
|
||||
}
|
||||
}
|
||||
|
||||
void PBStartScreen(int screen_num, const char *description, const char *layout, uint mask_set, uint mask_unset) {
|
||||
void PBStartScreen(int screen_num, const char *description, const char *layout, uint32_t mask_set, uint32_t mask_unset) {
|
||||
if (!IsMissionMaskOK(mask_set, mask_unset)) {
|
||||
ok_to_parse_screen = false;
|
||||
skipped_screens++;
|
||||
|
@ -547,7 +547,7 @@ int CBriefParse::ParseBriefing(const char *filename) {
|
||||
bool done = false;
|
||||
bool layout_found = false;
|
||||
char layout_scr[_MAX_PATH];
|
||||
uint mission_mask_set = 0, mission_mask_unset = 0;
|
||||
uint32_t mission_mask_set = 0, mission_mask_unset = 0;
|
||||
description[0] = '\0';
|
||||
PARSE_INT(current_screen);
|
||||
|
||||
@ -857,7 +857,7 @@ bool CBriefParse::ParseButtonEffect(const char *p) {
|
||||
char flash_name[256];
|
||||
char flash_name_focus[256];
|
||||
char d[128];
|
||||
uint mission_mask_set = 0, mission_mask_unset = 0;
|
||||
uint32_t mission_mask_set = 0, mission_mask_unset = 0;
|
||||
d[0] = '\0';
|
||||
|
||||
strcpy(flash_name, " ");
|
||||
|
@ -69,7 +69,7 @@ typedef struct {
|
||||
void (*AddPolyEffect)(LPTCPOLYDESC desc, const char *description);
|
||||
void (*AddSoundEffect)(LPTCSNDDESC desc, const char *description);
|
||||
void (*AddButtonEffect)(LPTCBUTTONDESC desc, const char *description, int id);
|
||||
void (*StartScreen)(int screen_num, const char *description, const char *layout, uint mask_set, uint mask_unset);
|
||||
void (*StartScreen)(int screen_num, const char *description, const char *layout, uint32_t mask_set, uint32_t mask_unset);
|
||||
void (*EndScreen)();
|
||||
bool (*LoopCallback)();
|
||||
void (*SetTitle)(const char *title);
|
||||
@ -100,7 +100,7 @@ private:
|
||||
void (*AddPolyEffect)(LPTCPOLYDESC desc, const char *description);
|
||||
void (*AddSoundEffect)(LPTCSNDDESC desc, const char *description);
|
||||
void (*AddButtonEffect)(LPTCBUTTONDESC desc, const char *description, int id);
|
||||
void (*StartScreen)(int screen_num, const char *desc, const char *layout, uint mask_set, uint mask_unset);
|
||||
void (*StartScreen)(int screen_num, const char *desc, const char *layout, uint32_t mask_set, uint32_t mask_unset);
|
||||
void (*EndScreen)();
|
||||
bool (*LoopCallback)();
|
||||
void (*SetTitle)(const char *title);
|
||||
|
@ -1635,7 +1635,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) {
|
||||
}
|
||||
|
||||
// Read the flags
|
||||
uint flags;
|
||||
uint32_t flags;
|
||||
if (fileversion >= 101)
|
||||
flags = cf_ReadInt(ifile);
|
||||
else
|
||||
|
@ -529,7 +529,7 @@ static void Osiris_SaveOMMS(CFILE *file);
|
||||
// Generates a checksum of the game's structures, to give to the modules
|
||||
// so they can use to compare to the time when they were compiled, to see
|
||||
// if they are compatible.
|
||||
uint Osiris_CreateGameChecksum(void);
|
||||
uint32_t Osiris_CreateGameChecksum(void);
|
||||
// Osiris_IsEventEnabled
|
||||
// Purpose:
|
||||
// Returns true if the event is allowed to be called
|
||||
@ -543,7 +543,7 @@ extern void Cinematic_StartCannedScript(tCannedCinematicInfo *info);
|
||||
static void Osiris_DumpLoadedObjects(char *file);
|
||||
static void Osiris_ForceUnloadModules(void);
|
||||
|
||||
uint Osiris_game_checksum;
|
||||
uint32_t Osiris_game_checksum;
|
||||
|
||||
static ubyte Osiris_event_mask = OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS;
|
||||
static bool Osiris_create_events_disabled = false;
|
||||
@ -626,8 +626,8 @@ void Osiris_InitModuleLoader(void) {
|
||||
// Generates a checksum of the game's structures, to give to the modules
|
||||
// so they can use to compare to the time when they were compiled, to see
|
||||
// if they are compatible.
|
||||
uint Osiris_CreateGameChecksum(void) {
|
||||
uint value = 0xe1e1b0b0;
|
||||
uint32_t Osiris_CreateGameChecksum(void) {
|
||||
uint32_t value = 0xe1e1b0b0;
|
||||
|
||||
value += sizeof(object);
|
||||
value += sizeof(player) * 2;
|
||||
@ -3297,7 +3297,7 @@ the script)
|
||||
// Returns -1 if there isn't enough available memory
|
||||
// Returns -2 if the unique identifier passed in is already used, but the requested amount_of_memory is different
|
||||
// If the memory has already been allocated, it will return the handle.
|
||||
OMMSHANDLE OMMS_Malloc(size_t amount_of_memory,uint unique_identifier,char *script_identifier);
|
||||
OMMSHANDLE OMMS_Malloc(size_t amount_of_memory,uint32_t unique_identifier,char *script_identifier);
|
||||
|
||||
// Attaches to a block of global OMMS memory. As long as at least one module (or script) is
|
||||
// attached to a module, the memory will not be deleted. (Increments the reference count)
|
||||
@ -3323,12 +3323,12 @@ subtracts).
|
||||
// in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
|
||||
// Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
|
||||
// Returns -1 if the module was never OMMS_Malloc()'d.
|
||||
OMMSHANDLE OMMS_Find(uint unique_identifier,char *script_identifier);
|
||||
OMMSHANDLE OMMS_Find(uint32_t unique_identifier,char *script_identifier);
|
||||
|
||||
// Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
|
||||
// OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
|
||||
// Pass NULL in for those parameters you don't need information about.
|
||||
char OMMS_GetInfo(OMMSHANDLE handle,uint *mem_size,uint *uid,ushort *reference_count,ubyte *has_free_been_called);
|
||||
char OMMS_GetInfo(OMMSHANDLE handle,uint32_t *mem_size,uint32_t *uid,ushort *reference_count,ubyte *has_free_been_called);
|
||||
|
||||
|
||||
******************************************************************************
|
||||
@ -3380,7 +3380,7 @@ tOMMSNode *Osiris_OMMS_FindHandle(OMMSHANDLE handle, tOMMSHashNode **hash = NULL
|
||||
// the script) Returns -1 if there isn't enough available memory Returns -2 if the unique identifier passed in is
|
||||
// already used, but the requested amount_of_memory is different Returns -3 if the unique identifier passed in is
|
||||
// already used, same size requested
|
||||
static OMMSHANDLE Osiris_OMMS_Malloc(size_t amount_of_memory, uint unique_identifier, char *script_identifier);
|
||||
static OMMSHANDLE Osiris_OMMS_Malloc(size_t amount_of_memory, uint32_t unique_identifier, char *script_identifier);
|
||||
|
||||
// Attaches to a block of global OMMS memory. As long as at least one module (or script) is
|
||||
// attached to a module, the memory will not be deleted. (Increments the reference count)
|
||||
@ -3406,12 +3406,12 @@ static void Osiris_OMMS_Free(OMMSHANDLE handle);
|
||||
// in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
|
||||
// Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
|
||||
// Returns -1 if the module was never OMMS_Malloc()'d.
|
||||
static OMMSHANDLE Osiris_OMMS_Find(uint unique_identifier, char *script_identifier);
|
||||
static OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_identifier);
|
||||
|
||||
// Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
|
||||
// OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
|
||||
// Pass NULL in for those parameters you don't need information about.
|
||||
static char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint *mem_size, uint *uid, ushort *reference_count,
|
||||
static char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called);
|
||||
|
||||
void Osiris_InitOMMS(void) {
|
||||
@ -3770,7 +3770,7 @@ tOMMSNode *Osiris_OMMS_FindHandle(OMMSHANDLE handle, tOMMSHashNode **hash) {
|
||||
// the script) Returns -1 if there isn't enough available memory Returns -2 if the unique identifier passed in is
|
||||
// already used, but the requested amount_of_memory is different If the memory has already been allocated, it will
|
||||
// return the handle.
|
||||
OMMSHANDLE Osiris_OMMS_Malloc(size_t amount_of_memory, uint unique_identifier, char *script_identifier) {
|
||||
OMMSHANDLE Osiris_OMMS_Malloc(size_t amount_of_memory, uint32_t unique_identifier, char *script_identifier) {
|
||||
ASSERT(amount_of_memory > 0);
|
||||
if (amount_of_memory <= 0)
|
||||
return -1;
|
||||
@ -3852,7 +3852,7 @@ void Osiris_OMMS_Free(OMMSHANDLE handle) {
|
||||
// in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
|
||||
// Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
|
||||
// Returns -1 if the module was never OMMS_Malloc()'d.
|
||||
OMMSHANDLE Osiris_OMMS_Find(uint unique_identifier, char *script_identifier) {
|
||||
OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_identifier) {
|
||||
tOMMSHashNode *hash = Osiris_OMMS_FindHashNode(script_identifier, false);
|
||||
if (!hash)
|
||||
return -1;
|
||||
@ -3869,7 +3869,7 @@ OMMSHANDLE Osiris_OMMS_Find(uint unique_identifier, char *script_identifier) {
|
||||
// Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
|
||||
// OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
|
||||
// Pass NULL in for those parameters you don't need information about.
|
||||
char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint *mem_size, uint *uid, ushort *reference_count,
|
||||
char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called) {
|
||||
if (mem_size)
|
||||
*mem_size = 0;
|
||||
|
@ -1164,7 +1164,7 @@ int Player_camera_objnum = -1;
|
||||
float Player_shields_saved_from_last_level = -1.0f;
|
||||
float Player_energy_saved_from_last_level = -1.0f;
|
||||
|
||||
uint Players_typing; // information about which players are typing messages (to display an icon)
|
||||
uint32_t Players_typing; // information about which players are typing messages (to display an icon)
|
||||
|
||||
static float Player_camera_last_sample_time = 0;
|
||||
static float Player_camera_last_follow_time = 0;
|
||||
@ -1394,7 +1394,7 @@ void InitPlayerNewGame(int slot) {
|
||||
Players[slot].num_deaths_total = 0;
|
||||
Players[slot].score = 0;
|
||||
|
||||
uint bit = (0x01 << slot);
|
||||
uint32_t bit = (0x01 << slot);
|
||||
Players_typing &= ~bit;
|
||||
}
|
||||
|
||||
@ -1449,7 +1449,7 @@ void InitPlayerNewLevel(int slot) {
|
||||
}
|
||||
}
|
||||
|
||||
uint bit = (0x01 << slot);
|
||||
uint32_t bit = (0x01 << slot);
|
||||
Players_typing &= ~bit;
|
||||
|
||||
// Give the player a GuideBot if he doesn't have one and if the GB isn't out there
|
||||
@ -2035,7 +2035,7 @@ typedef struct tDeathSeq {
|
||||
vector force_dir;
|
||||
|
||||
ubyte saved_ctrl_type;
|
||||
uint saved_phys_flags;
|
||||
uint32_t saved_phys_flags;
|
||||
float saved_drag;
|
||||
vector saved_rotthrust;
|
||||
|
||||
|
@ -186,7 +186,7 @@ typedef struct {
|
||||
// type
|
||||
int type;
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCTEXTDESC, *LPTCTEXTDESC;
|
||||
typedef struct {
|
||||
// type
|
||||
@ -206,7 +206,7 @@ typedef struct {
|
||||
// filename
|
||||
char filename[MAX_FILELEN]; // MUST BE FILLED IN
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCBMPDESC, *LPTCBMPDESC;
|
||||
typedef struct {
|
||||
// fill in with whats valid
|
||||
@ -224,7 +224,7 @@ typedef struct {
|
||||
// time to wait until starting the movie
|
||||
float waittime; //(Default: 0.0f)
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCMOVIEDESC, *LPTCMOVIEDESC;
|
||||
typedef struct {
|
||||
// whats defined for the struct
|
||||
@ -238,7 +238,7 @@ typedef struct {
|
||||
// how long to wait until effect start
|
||||
float waittime; //(Default: 0.0f)
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCBKGDESC, *LPTCBKGDESC;
|
||||
typedef struct {
|
||||
// whats defined for the struct
|
||||
@ -258,7 +258,7 @@ typedef struct {
|
||||
// polymodel name
|
||||
char polyname[MAX_FILELEN];
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCPOLYDESC, *LPTCPOLYDESC;
|
||||
typedef struct {
|
||||
// whats defined for the struct
|
||||
@ -272,7 +272,7 @@ typedef struct {
|
||||
// sound name
|
||||
char filename[MAX_FILELEN];
|
||||
// mission flag mask
|
||||
uint mission_mask_set, mission_mask_unset;
|
||||
uint32_t mission_mask_set, mission_mask_unset;
|
||||
} TCSNDDESC, *LPTCSNDDESC;
|
||||
typedef struct {
|
||||
char filename[MAX_FILELEN];
|
||||
@ -290,7 +290,7 @@ typedef struct {
|
||||
ubyte click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to)
|
||||
bool flasher;
|
||||
bool tab_stop;
|
||||
uint mission_mask_set, mission_mask_unset; // mission flag mask
|
||||
uint32_t mission_mask_set, mission_mask_unset; // mission flag mask
|
||||
} TCBUTTONDESC, *LPTCBUTTONDESC;
|
||||
|
||||
//==================
|
||||
|
@ -366,7 +366,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
// to osf format
|
||||
// start writing out data.
|
||||
tOSFDigiHdr digihdr;
|
||||
uint filelen, nblocks, i;
|
||||
uint32_t filelen, nblocks, i;
|
||||
int format;
|
||||
|
||||
StaticFileBuffer = (ubyte *)mem_malloc(FILEBUFFER_LENGTH);
|
||||
@ -385,7 +385,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
filelen = (uint)cfilelength(fpin);
|
||||
filelen = (uint32_t)cfilelength(fpin);
|
||||
nblocks = filelen / FILEBUFFER_LENGTH;
|
||||
|
||||
if (!osf.Open(outputfilename, true)) {
|
||||
|
@ -1070,7 +1070,7 @@ static inline int BSPInMinMax(vector *pos, vector *min_xyz, vector *max_xyz) {
|
||||
return 1;
|
||||
}
|
||||
// see if a point in inside a face by projecting into 2d
|
||||
extern uint check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list);
|
||||
extern uint32_t check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list);
|
||||
|
||||
// Returns true if passed in point collides with a nodes polygon
|
||||
static inline int BSPPointInPolygon(vector *pos, bspnode *node) {
|
||||
|
@ -837,7 +837,7 @@ void InitDedicatedSocket(ushort port) {
|
||||
sock_addr.sin_family = AF_INET;
|
||||
uint32_t my_ip;
|
||||
my_ip = nw_GetThisIP();
|
||||
memcpy(&sock_addr.sin_addr.s_addr, &my_ip, sizeof(uint));
|
||||
memcpy(&sock_addr.sin_addr.s_addr, &my_ip, sizeof(uint32_t));
|
||||
sock_addr.sin_port = htons(port);
|
||||
|
||||
dedicated_listen_socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
@ -469,7 +469,7 @@ void DemoWriteChangedObj(object *op) {
|
||||
|
||||
void DemoWriteWeaponFire(unsigned short objectnum, vector *pos, vector *dir, unsigned short weaponnum,
|
||||
unsigned short weapobjnum, short gunnum) {
|
||||
uint uniqueid = MultiGetMatchChecksum(OBJ_WEAPON, weaponnum);
|
||||
uint32_t uniqueid = MultiGetMatchChecksum(OBJ_WEAPON, weaponnum);
|
||||
if (weapobjnum == -1)
|
||||
return;
|
||||
if (!Weapons[weaponnum].used) {
|
||||
@ -943,7 +943,7 @@ void DemoReadHudMessage() {
|
||||
void DemoReadWeaponFire() {
|
||||
vector pos, dir;
|
||||
float gametime;
|
||||
uint uniqueid;
|
||||
uint32_t uniqueid;
|
||||
object *obj;
|
||||
short weaponnum, objnum, weapobjnum;
|
||||
vector laser_pos, laser_dir;
|
||||
|
@ -246,7 +246,7 @@ struct {
|
||||
int bmp_handle;
|
||||
int longest_line;
|
||||
|
||||
uint flags;
|
||||
uint32_t flags;
|
||||
|
||||
tHUDMode old_hudmode;
|
||||
|
||||
|
@ -1612,13 +1612,13 @@ int LGSSnapshot(CFILE *fp) {
|
||||
//@@ {
|
||||
//@@ short bound;
|
||||
//@@ gs_ReadShort(fp, bound);
|
||||
//@@ if (bound < (sizeof(op_wave->damaged_list)/sizeof(uint))) {
|
||||
//@@ if (bound < (sizeof(op_wave->damaged_list)/sizeof(uint32_t))) {
|
||||
//@@ Int3();
|
||||
//@@ retval = LGS_OUTDATEDVER;
|
||||
//@@ goto lgsobjs_fail;
|
||||
//@@ }
|
||||
//@@ for (j = 0; j < sizeof(op_wave->damaged_list)/sizeof(uint); j++)
|
||||
//@@ gs_ReadInt(fp, (uint)op_wave->damaged_list[j]);
|
||||
//@@ for (j = 0; j < sizeof(op_wave->damaged_list)/sizeof(uint32_t); j++)
|
||||
//@@ gs_ReadInt(fp, (uint32_t)op_wave->damaged_list[j]);
|
||||
//@@ }
|
||||
//@@ break;
|
||||
//@@ default:
|
||||
|
@ -1743,8 +1743,8 @@ int Num_broke_glass = 0;
|
||||
// This is for getting out a menu if in multiplayer
|
||||
bool Multi_bail_ui_menu = false;
|
||||
|
||||
uint Multi_generic_match_table[MAX_OBJECT_IDS];
|
||||
uint Multi_weapon_match_table[MAX_WEAPONS];
|
||||
uint32_t Multi_generic_match_table[MAX_OBJECT_IDS];
|
||||
uint32_t Multi_weapon_match_table[MAX_WEAPONS];
|
||||
ubyte Multi_receive_buffer[MAX_RECEIVE_SIZE];
|
||||
|
||||
ubyte Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
|
||||
@ -2073,7 +2073,7 @@ int MultiSendRobotFireWeapon(unsigned short objectnum, vector *pos, vector *dir,
|
||||
// count+=sizeof(vector);
|
||||
MultiAddVector(*dir, data, &count);
|
||||
|
||||
uint index = MultiGetMatchChecksum(OBJ_WEAPON, weaponnum);
|
||||
uint32_t index = MultiGetMatchChecksum(OBJ_WEAPON, weaponnum);
|
||||
MultiAddUint(index, data, &count);
|
||||
|
||||
END_DATA(count, data, size);
|
||||
@ -2100,7 +2100,7 @@ void MultiDoRobotFire(ubyte *data) {
|
||||
vector weapon_pos;
|
||||
vector weapon_dir;
|
||||
uint32_t weapon_num;
|
||||
uint uniqueid;
|
||||
uint32_t uniqueid;
|
||||
|
||||
if (Netgame.local_role == LR_SERVER) {
|
||||
Int3(); // Get Jason, a server got the multi do fire packet
|
||||
@ -4601,7 +4601,7 @@ void MultiDoJoinObjects(ubyte *data) {
|
||||
type = MultiGetByte(data, &count);
|
||||
}
|
||||
|
||||
uint checksum;
|
||||
uint32_t checksum;
|
||||
matrix orient;
|
||||
ubyte name_len = 0;
|
||||
ubyte num_persist_vars = 0;
|
||||
@ -5188,7 +5188,7 @@ void MultiDoObject(ubyte *data) {
|
||||
}
|
||||
|
||||
ubyte type = MultiGetByte(data, &count);
|
||||
uint checksum = MultiGetUint(data, &count);
|
||||
uint32_t checksum = MultiGetUint(data, &count);
|
||||
ubyte dummy_type = OBJ_NONE;
|
||||
if (type == OBJ_DUMMY) // we need to get the original type
|
||||
dummy_type = MultiGetByte(data, &count);
|
||||
@ -5359,7 +5359,7 @@ void MultiSendObject(object *obj, ubyte announce, ubyte demo_record) {
|
||||
|
||||
size_offset = START_DATA(MP_OBJECT, data, &count, 1);
|
||||
|
||||
uint index = MultiGetMatchChecksum(obj->type, obj->id);
|
||||
uint32_t index = MultiGetMatchChecksum(obj->type, obj->id);
|
||||
|
||||
// Send server object number
|
||||
MultiAddByte(announce, data, &count);
|
||||
@ -6079,7 +6079,7 @@ void MultiDoRequestCountermeasure(ubyte *data) {
|
||||
MULTI_ASSERT_NOMESSAGE(parent_objnum != 65535);
|
||||
}
|
||||
|
||||
uint checksum = MultiGetUint(data, &count);
|
||||
uint32_t checksum = MultiGetUint(data, &count);
|
||||
|
||||
int id = MultiMatchWeapon(checksum);
|
||||
|
||||
@ -6109,7 +6109,7 @@ void MultiSendRequestCountermeasure(short objnum, int weapon_index) {
|
||||
|
||||
MultiAddShort(objnum, data, &count);
|
||||
|
||||
uint index = MultiGetMatchChecksum(OBJ_WEAPON, weapon_index);
|
||||
uint32_t index = MultiGetMatchChecksum(OBJ_WEAPON, weapon_index);
|
||||
MultiAddUint(index, data, &count);
|
||||
|
||||
END_DATA(count, data, size_offset);
|
||||
@ -6551,11 +6551,11 @@ void MultiSendFullReliablePacket(int slot, int flags) {
|
||||
}
|
||||
|
||||
// Given a string, returns a unique integer for that string
|
||||
uint MultiGetUniqueIDFromString(char *plainstring) {
|
||||
uint32_t MultiGetUniqueIDFromString(char *plainstring) {
|
||||
int i, t, len;
|
||||
uint ret;
|
||||
uint32_t ret;
|
||||
ubyte cryptstring[PAGENAME_LEN];
|
||||
uint vals[4];
|
||||
uint32_t vals[4];
|
||||
|
||||
len = strlen(plainstring);
|
||||
|
||||
@ -6599,7 +6599,7 @@ uint MultiGetUniqueIDFromString(char *plainstring) {
|
||||
}
|
||||
|
||||
// Returns the unique id of a given object type/id
|
||||
uint MultiGetMatchChecksum(int type, int id) {
|
||||
uint32_t MultiGetMatchChecksum(int type, int id) {
|
||||
switch (type) {
|
||||
case OBJ_POWERUP:
|
||||
case OBJ_ROBOT:
|
||||
@ -6622,7 +6622,7 @@ uint MultiGetMatchChecksum(int type, int id) {
|
||||
}
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
int MultiMatchGeneric(uint unique_id) {
|
||||
int MultiMatchGeneric(uint32_t unique_id) {
|
||||
for (int i = 0; i < MAX_OBJECT_IDS; i++)
|
||||
if (Multi_generic_match_table[i] == unique_id)
|
||||
return i;
|
||||
@ -6631,7 +6631,7 @@ int MultiMatchGeneric(uint unique_id) {
|
||||
}
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
int MultiMatchWeapon(uint unique_id) {
|
||||
int MultiMatchWeapon(uint32_t unique_id) {
|
||||
for (int i = 0; i < MAX_WEAPONS; i++)
|
||||
if (Multi_weapon_match_table[i] == unique_id)
|
||||
return i;
|
||||
@ -6651,7 +6651,7 @@ void MultiBuildMatchTables() {
|
||||
// Build generic tables
|
||||
for (i = 0; i < MAX_OBJECT_IDS; i++) {
|
||||
if (Object_info[i].type != OBJ_NONE) {
|
||||
uint val = MultiGetUniqueIDFromString(Object_info[i].name);
|
||||
uint32_t val = MultiGetUniqueIDFromString(Object_info[i].name);
|
||||
val += Object_info[i].type;
|
||||
|
||||
// See if there is a hash collision. If so, increment the value and retry
|
||||
@ -6670,7 +6670,7 @@ void MultiBuildMatchTables() {
|
||||
// Build weapon tables
|
||||
for (i = 0; i < MAX_WEAPONS; i++) {
|
||||
if (Weapons[i].used) {
|
||||
uint val = MultiGetUniqueIDFromString(Weapons[i].name);
|
||||
uint32_t val = MultiGetUniqueIDFromString(Weapons[i].name);
|
||||
|
||||
// See if there is a hash collision. If so, increment the value and retry
|
||||
while ((MultiMatchWeapon(val)) != -1) {
|
||||
@ -7839,7 +7839,7 @@ void MultiDoFileData(ubyte *data) {
|
||||
void MultiDoFileAck(ubyte *data) {
|
||||
// If we are transferring a file, and someone ACK's us, simply send them the next bit of data they are waiting for
|
||||
ubyte playernum; // Who is acking us
|
||||
uint len_recvd; // Total number of bytes received so far
|
||||
uint32_t len_recvd; // Total number of bytes received so far
|
||||
int count = 0;
|
||||
|
||||
SKIP_HEADER(data, &count);
|
||||
@ -8346,7 +8346,7 @@ void MultiDoTypeIcon(ubyte *data) {
|
||||
|
||||
ASSERT(pnum >= 0 && pnum < MAX_PLAYERS);
|
||||
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
bit = bit << pnum;
|
||||
|
||||
if (typing) {
|
||||
@ -8384,7 +8384,7 @@ void MultiDoRequestTypeIcon(ubyte *data) {
|
||||
|
||||
// Client is telling the server that he is [not] typing a hud message
|
||||
void MultiSendRequestTypeIcon(bool typing_message) {
|
||||
uint bit = (0x01 << Player_num);
|
||||
uint32_t bit = (0x01 << Player_num);
|
||||
|
||||
if (typing_message && (bit & Players_typing))
|
||||
return; // already typing no need to request
|
||||
|
@ -767,7 +767,7 @@ extern ubyte Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
|
||||
extern int Multi_reliable_send_size[MAX_NET_PLAYERS];
|
||||
extern float Multi_reliable_last_send_time[MAX_NET_PLAYERS];
|
||||
extern ubyte Multi_reliable_sent_position[MAX_NET_PLAYERS];
|
||||
extern uint Multi_visible_players[];
|
||||
extern uint32_t Multi_visible_players[];
|
||||
|
||||
extern int Got_level_info;
|
||||
extern int Got_new_game_time;
|
||||
@ -921,7 +921,7 @@ int MultiMatchRobot(int unique_id);
|
||||
void MultiBuildMatchTables();
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
int MultiMatchWeapon(uint unique_id);
|
||||
int MultiMatchWeapon(uint32_t unique_id);
|
||||
|
||||
// Tell my clients about damage done to a player
|
||||
void MultiSendDamagePlayer(int, int, int type, float amount);
|
||||
@ -933,10 +933,10 @@ void MultiSendMessageFromServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL);
|
||||
void MultiSendEndPlayerDeath();
|
||||
|
||||
// Returns the unique id of a given object type/id
|
||||
uint MultiGetMatchChecksum(int type, int id);
|
||||
uint32_t MultiGetMatchChecksum(int type, int id);
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
int MultiMatchGeneric(uint unique_id);
|
||||
int MultiMatchGeneric(uint32_t unique_id);
|
||||
|
||||
// Sends a message from client to server
|
||||
void MultiSendMessageToServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL);
|
||||
@ -1209,7 +1209,7 @@ inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) {
|
||||
*id = -1;
|
||||
*type = MultiGetByte(data, count);
|
||||
|
||||
uint hash_value = MultiGetUint(data, count);
|
||||
uint32_t hash_value = MultiGetUint(data, count);
|
||||
|
||||
if ((*type) == OBJ_WEAPON)
|
||||
*id = MultiMatchWeapon(hash_value);
|
||||
@ -1218,7 +1218,7 @@ inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) {
|
||||
}
|
||||
|
||||
inline void MultiAddTypeID(int type, int id, ubyte *data, int *count) {
|
||||
uint hash_value;
|
||||
uint32_t hash_value;
|
||||
hash_value = MultiGetMatchChecksum(type, id);
|
||||
|
||||
MultiAddByte(type, data, count);
|
||||
|
@ -297,9 +297,9 @@ inline void MultiAddInt(int element, ubyte *data, int *count) {
|
||||
*count += sizeof(int);
|
||||
}
|
||||
|
||||
inline void MultiAddUint(uint element, ubyte *data, int *count) {
|
||||
*(uint *)(data + *count) = INTEL_INT(element);
|
||||
*count += sizeof(uint);
|
||||
inline void MultiAddUint(uint32_t element, ubyte *data, int *count) {
|
||||
*(uint32_t *)(data + *count) = INTEL_INT(element);
|
||||
*count += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
inline void MultiAddFloat(float element, ubyte *data, int *count) {
|
||||
@ -352,8 +352,8 @@ inline int MultiGetInt(ubyte *data, int *count) {
|
||||
return INTEL_INT(element);
|
||||
}
|
||||
|
||||
inline uint MultiGetUint(ubyte *data, int *count) {
|
||||
uint element = (*(uint *)(data + *count));
|
||||
inline uint32_t MultiGetUint(ubyte *data, int *count) {
|
||||
uint32_t element = (*(uint32_t *)(data + *count));
|
||||
*count += sizeof(int);
|
||||
return INTEL_INT(element);
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ ushort Num_changed_turret[MAX_NET_PLAYERS];
|
||||
|
||||
float last_sent_bytes[MAX_NET_PLAYERS];
|
||||
float Multi_last_send_visible[MAX_NET_PLAYERS];
|
||||
uint Multi_visible_players[MAX_NET_PLAYERS];
|
||||
uint32_t Multi_visible_players[MAX_NET_PLAYERS];
|
||||
extern int Buddy_handle[MAX_PLAYERS];
|
||||
extern char Multi_message_of_the_day[];
|
||||
|
||||
@ -1284,7 +1284,7 @@ void MultiSendJoinDemoObjects(int slot) {
|
||||
}
|
||||
|
||||
int StuffObjectIntoPacket(object *obj, ubyte *data) {
|
||||
uint index;
|
||||
uint32_t index;
|
||||
int count = 0;
|
||||
bool obj_is_dummy = false;
|
||||
|
||||
|
@ -510,7 +510,7 @@ void MultiDoMSafeFunction(ubyte *data) {
|
||||
void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct) {
|
||||
int sequence = -1;
|
||||
int to_slot = -1;
|
||||
uint to_bitmask = 0xFFFFFFFF;
|
||||
uint32_t to_bitmask = 0xFFFFFFFF;
|
||||
|
||||
ASSERT((Demo_flags == DF_RECORDING) || (Netgame.local_role == LR_SERVER));
|
||||
|
||||
|
@ -2554,7 +2554,7 @@ void ObjDoEffects(object *obj) {
|
||||
object *killer;
|
||||
|
||||
if (obj->effect_info->damage_handle != OBJECT_HANDLE_NONE) {
|
||||
uint sig = obj->effect_info->damage_handle & HANDLE_COUNT_MASK;
|
||||
uint32_t sig = obj->effect_info->damage_handle & HANDLE_COUNT_MASK;
|
||||
int objnum = obj->effect_info->damage_handle & HANDLE_OBJNUM_MASK;
|
||||
|
||||
if ((Objects[objnum].handle & HANDLE_COUNT_MASK) != sig)
|
||||
|
@ -389,7 +389,7 @@ typedef struct {
|
||||
|
||||
// Death info for an object type
|
||||
typedef struct {
|
||||
uint flags; // death flags
|
||||
uint32_t flags; // death flags
|
||||
float delay_min; // if delay, min amount
|
||||
float delay_max; // if delay, max amount
|
||||
} death_info;
|
||||
|
@ -118,7 +118,7 @@
|
||||
#include "module.h"
|
||||
#include "cfile.h"
|
||||
|
||||
extern uint Osiris_game_checksum;
|
||||
extern uint32_t Osiris_game_checksum;
|
||||
extern tOSIRISModuleInit Osiris_module_init;
|
||||
|
||||
// Osiris_InitModuleLoader
|
||||
|
@ -2799,7 +2799,7 @@ void osipf_MissionFlagSet(int flag, ubyte value) {
|
||||
}
|
||||
|
||||
flag--;
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
bit = bit << flag;
|
||||
|
||||
if (!value) {
|
||||
@ -2818,7 +2818,7 @@ int osipf_MissionFlagGet(int flag) {
|
||||
}
|
||||
|
||||
flag--;
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
bit = bit << flag;
|
||||
|
||||
if (Current_mission.game_state_flags & bit)
|
||||
|
@ -430,7 +430,7 @@ extern int Current_waypoint;
|
||||
|
||||
extern bool Player_has_camera;
|
||||
extern int Player_camera_objnum;
|
||||
extern uint Players_typing; // information about which players are typing messages (to display an icon)
|
||||
extern uint32_t Players_typing; // information about which players are typing messages (to display an icon)
|
||||
|
||||
extern float Player_shields_saved_from_last_level;
|
||||
extern float Player_energy_saved_from_last_level;
|
||||
|
@ -2071,7 +2071,7 @@ void DrawPlayerTypingIndicator(object *obj) {
|
||||
return;
|
||||
if (NetPlayers[slot].sequence != NETSEQ_PLAYING)
|
||||
return;
|
||||
uint bit = (0x01 << slot);
|
||||
uint32_t bit = (0x01 << slot);
|
||||
if (!(Players_typing & bit))
|
||||
return;
|
||||
if (obj->effect_info && obj->effect_info->type_flags & EF_CLOAKED)
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "player_external_struct.h"
|
||||
|
||||
// This is copy of actual Osiris_CreateGameChecksum(void) from OsirisLoadandBind.cpp
|
||||
uint Osiris_CreateGameChecksumTest() {
|
||||
uint value = 0xe1e1b0b0;
|
||||
uint32_t Osiris_CreateGameChecksumTest() {
|
||||
uint32_t value = 0xe1e1b0b0;
|
||||
|
||||
value += sizeof(object);
|
||||
value += sizeof(player) * 2;
|
||||
|
@ -2047,7 +2047,7 @@ void VisEffectMoveOne(vis_effect *vis) {
|
||||
// Do attached viseffect stuff here
|
||||
if (vis->flags & VF_ATTACHED) {
|
||||
int objnum = vis->attach_info.obj_handle & HANDLE_OBJNUM_MASK;
|
||||
uint sig = vis->attach_info.obj_handle & HANDLE_COUNT_MASK;
|
||||
uint32_t sig = vis->attach_info.obj_handle & HANDLE_COUNT_MASK;
|
||||
object *obj = &Objects[objnum];
|
||||
|
||||
if ((obj->flags & OF_DEAD) || (obj->handle & HANDLE_COUNT_MASK) != sig) {
|
||||
@ -2062,7 +2062,7 @@ void VisEffectMoveOne(vis_effect *vis) {
|
||||
if (vis->flags & VF_PLANAR) {
|
||||
// Do object to object attachment
|
||||
int dest_objnum = vis->attach_info.dest_objhandle & HANDLE_OBJNUM_MASK;
|
||||
uint dest_sig = vis->attach_info.dest_objhandle & HANDLE_COUNT_MASK;
|
||||
uint32_t dest_sig = vis->attach_info.dest_objhandle & HANDLE_COUNT_MASK;
|
||||
object *dest_obj = &Objects[dest_objnum];
|
||||
|
||||
if ((dest_obj->flags & OF_DEAD) || (dest_obj->handle & HANDLE_COUNT_MASK) != dest_sig) {
|
||||
|
@ -131,13 +131,13 @@ short iff_has_transparency; // 0=no transparency, 1=iff_transparent_color is val
|
||||
#define IFF_SIG_ANHD 10
|
||||
|
||||
static int bm_iff_get_sig(CFILE *f);
|
||||
static int bm_iff_parse_bmhd(CFILE *ifile, uint len, iff_bitmap_header *bmheader);
|
||||
static int bm_iff_parse_bmhd(CFILE *ifile, uint32_t len, iff_bitmap_header *bmheader);
|
||||
|
||||
/// the buffer pointed to by raw_data is stuffed with a pointer to decompressed pixel data
|
||||
static int bm_iff_parse_body(CFILE *ifile, int len, iff_bitmap_header *bmheader);
|
||||
|
||||
/// the buffer pointed to by raw_data is stuffed with a pointer to bitplane pixel data
|
||||
static void bm_iff_skip_chunk(CFILE *ifile, uint len);
|
||||
static void bm_iff_skip_chunk(CFILE *ifile, uint32_t len);
|
||||
|
||||
/// modify passed bitmap
|
||||
static int bm_iff_parse_delta(CFILE *ifile, int len, iff_bitmap_header *bmheader);
|
||||
@ -173,7 +173,7 @@ int bm_iff_get_sig(CFILE *f) {
|
||||
|
||||
return (IFF_SIG_UNKNOWN);
|
||||
}
|
||||
int bm_iff_parse_bmhd(CFILE *ifile, uint len, iff_bitmap_header *bmheader) {
|
||||
int bm_iff_parse_bmhd(CFILE *ifile, uint32_t len, iff_bitmap_header *bmheader) {
|
||||
len = len;
|
||||
|
||||
bmheader->w = cf_ReadShort(ifile);
|
||||
@ -296,8 +296,8 @@ int bm_iff_parse_body(CFILE *ifile, int len, iff_bitmap_header *bmheader) {
|
||||
}
|
||||
|
||||
// the buffer pointed to by raw_data is stuffed with a pointer to bitplane pixel data
|
||||
void bm_iff_skip_chunk(CFILE *ifile, uint len) {
|
||||
uint i;
|
||||
void bm_iff_skip_chunk(CFILE *ifile, uint32_t len) {
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
cf_ReadByte(ifile);
|
||||
@ -372,7 +372,7 @@ int bm_iff_parse_delta(CFILE *ifile, int len, iff_bitmap_header *bmheader) {
|
||||
// read an PBM
|
||||
// Pass pointer to opened file, and to empty bitmap_header structure, and form length
|
||||
int bm_iff_parse_file(CFILE *ifile, iff_bitmap_header *bmheader, iff_bitmap_header *prev_bm) {
|
||||
uint sig, len;
|
||||
uint32_t sig, len;
|
||||
int done = 0;
|
||||
|
||||
while (!done) {
|
||||
|
@ -196,8 +196,8 @@ uint32_t CZip::InputBits(BITFILE *bfile, int bitcount) {
|
||||
return return_value;
|
||||
}
|
||||
|
||||
void CZip::FilePrintBinary(FILE *file, uint code, int bits) {
|
||||
uint mask;
|
||||
void CZip::FilePrintBinary(FILE *file, uint32_t code, int bits) {
|
||||
uint32_t mask;
|
||||
mask = 1 << (bits - 1);
|
||||
while (mask != 0) {
|
||||
if (code & mask)
|
||||
|
@ -680,12 +680,12 @@ ushort CZip::ReadRawShort(void) {
|
||||
data = (data << 8) | (ReadRawByte());
|
||||
return data;
|
||||
}
|
||||
uint CZip::ReadRawInt(void) {
|
||||
uint32_t CZip::ReadRawInt(void) {
|
||||
if (!m_bRawType)
|
||||
return -1;
|
||||
|
||||
// need to read 4 bytes
|
||||
uint data = 0;
|
||||
uint32_t data = 0;
|
||||
data = ReadRawByte();
|
||||
data = (data << 8) | (ReadRawByte());
|
||||
data = (data << 8) | (ReadRawByte());
|
||||
@ -724,7 +724,7 @@ void CZip::WriteRawShort(ushort value) {
|
||||
data = (value & 0xFF);
|
||||
WriteRawByte(data);
|
||||
}
|
||||
void CZip::WriteRawInt(uint value) {
|
||||
void CZip::WriteRawInt(uint32_t value) {
|
||||
if (!m_bRawType)
|
||||
return;
|
||||
// write 4 bytes
|
||||
@ -743,7 +743,7 @@ void CZip::WriteRawFloat(float value) {
|
||||
return;
|
||||
// write 4 bytes
|
||||
ubyte data;
|
||||
uint v = 0;
|
||||
uint32_t v = 0;
|
||||
v = *((int *)&value);
|
||||
|
||||
data = ((v & 0xFF000000) >> 24);
|
||||
|
@ -141,7 +141,7 @@ void CZip::ha_InitializeTree(tHATree *tree) {
|
||||
tree->leaf[i] = -1;
|
||||
}
|
||||
|
||||
void CZip::ha_EncodeSymbol(tHATree *tree, uint c, BITFILE *output) {
|
||||
void CZip::ha_EncodeSymbol(tHATree *tree, uint32_t c, BITFILE *output) {
|
||||
uint32_t code;
|
||||
uint32_t current_bit;
|
||||
int code_size;
|
||||
@ -207,7 +207,7 @@ void CZip::ha_UpdateModel(tHATree *tree, int c) {
|
||||
|
||||
void CZip::ha_RebuildTree(tHATree *tree) {
|
||||
int i, j, k;
|
||||
uint weight;
|
||||
uint32_t weight;
|
||||
j = tree->next_free_node - 1;
|
||||
for (i = j; i >= ROOT_NODE; i--) {
|
||||
if (tree->nodes[i].child_is_leaf) {
|
||||
|
@ -194,7 +194,7 @@ void CZip::hb_scale_counts(uint32_t *counts, tH0Node *nodes) {
|
||||
max_count = max_count / 255;
|
||||
max_count = max_count + 1;
|
||||
for (i = 0; i < 256; i++) {
|
||||
nodes[i].count = (uint)(counts[i] / max_count);
|
||||
nodes[i].count = (uint32_t)(counts[i] / max_count);
|
||||
if (nodes[i].count == 0 && counts[i] != 0)
|
||||
nodes[i].count = 1;
|
||||
}
|
||||
@ -235,7 +235,7 @@ int CZip::hb_build_tree(tH0Node *nodes) {
|
||||
return (next_free);
|
||||
}
|
||||
|
||||
void CZip::hb_convert_tree_to_code(tH0Node *nodes, tH0Code *codes, uint code_so_far, int bits, int node) {
|
||||
void CZip::hb_convert_tree_to_code(tH0Node *nodes, tH0Code *codes, uint32_t code_so_far, int bits, int node) {
|
||||
if (node <= END_OF_STREAM) {
|
||||
codes[node].code = code_so_far;
|
||||
codes[node].code_bits = bits;
|
||||
|
@ -273,12 +273,12 @@ bool ddgr_surf_Blt(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx,
|
||||
|
||||
// returns internal information about an ddgr_surface (only to low level libraries, on par with the ddgr
|
||||
// library).
|
||||
void ddgr_surf_GetPrivateData(ddgr_surface *sf, bool *ddraw_surf, uint *object_ptr) {
|
||||
void ddgr_surf_GetPrivateData(ddgr_surface *sf, bool *ddraw_surf, uint32_t *object_ptr) {
|
||||
switch (LIB_DATA(subsystem)) {
|
||||
case DDGR_DX_SUBSYSTEM: {
|
||||
tDXSurface *bm = (tDXSurface *)sf->obj;
|
||||
*ddraw_surf = true;
|
||||
*object_ptr = (bm->backbuffer == true) ? (uint)(bm->lpddsback) : (uint)(bm->lpdds);
|
||||
*object_ptr = (bm->backbuffer == true) ? (uint32_t)(bm->lpddsback) : (uint32_t)(bm->lpdds);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -124,9 +124,9 @@ bool ddgr_gdi_Init(oeApplication *app, bool fullscreen, bool ddraw) {
|
||||
}
|
||||
HDC hdc = GetDC(GDI_DATA(hPrimaryWnd));
|
||||
|
||||
if (GDI_DATA(devmodes[i].dmBitsPerPel) == (uint)GetDeviceCaps(hdc, BITSPIXEL) &&
|
||||
GDI_DATA(devmodes[i].dmPelsWidth) == (uint)GetDeviceCaps(hdc, HORZRES) &&
|
||||
GDI_DATA(devmodes[i].dmPelsHeight) == (uint)GetDeviceCaps(hdc, VERTRES))
|
||||
if (GDI_DATA(devmodes[i].dmBitsPerPel) == (uint32_t)GetDeviceCaps(hdc, BITSPIXEL) &&
|
||||
GDI_DATA(devmodes[i].dmPelsWidth) == (uint32_t)GetDeviceCaps(hdc, HORZRES) &&
|
||||
GDI_DATA(devmodes[i].dmPelsHeight) == (uint32_t)GetDeviceCaps(hdc, VERTRES))
|
||||
GDI_DATA(olddispmode) = i;
|
||||
|
||||
ReleaseDC(GDI_DATA(hPrimaryWnd), hdc);
|
||||
|
@ -104,7 +104,7 @@ void ddvidfs_CloseVideo();
|
||||
void ddvidfs_VideoFlip();
|
||||
|
||||
// returns the directdraw object
|
||||
uint ddvidfs_GetDirectDrawObject();
|
||||
uint32_t ddvidfs_GetDirectDrawObject();
|
||||
|
||||
// inits windowed system
|
||||
bool ddvidwin_Init();
|
||||
|
@ -199,7 +199,7 @@ void ddvidfs_VideoFlip() {
|
||||
}
|
||||
|
||||
// returns the directdraw object
|
||||
uint ddvidfs_GetDirectDrawObject() { return (uint)DDVideo_info.lpDD; }
|
||||
uint32_t ddvidfs_GetDirectDrawObject() { return (uint32_t)DDVideo_info.lpDD; }
|
||||
|
||||
// DirectDraw Display mode enumeration callback
|
||||
HRESULT WINAPI DDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext) {
|
||||
|
@ -72,10 +72,10 @@ bool ddvidwin_Init() {
|
||||
while (EnumDisplaySettings(NULL, i, &devmode)) {
|
||||
HDC hdc = CreateCompatibleDC(NULL);
|
||||
|
||||
if (devmode.dmBitsPerPel == (uint)GetDeviceCaps(hdc, BITSPIXEL) &&
|
||||
devmode.dmPelsWidth == (uint)GetSystemMetrics(SM_CXSCREEN) &&
|
||||
devmode.dmPelsHeight == (uint)GetSystemMetrics(SM_CYSCREEN)) {
|
||||
if (DDVideo_info.app->NT() && devmode.dmDisplayFrequency == (uint)GetDeviceCaps(hdc, VREFRESH))
|
||||
if (devmode.dmBitsPerPel == (uint32_t)GetDeviceCaps(hdc, BITSPIXEL) &&
|
||||
devmode.dmPelsWidth == (uint32_t)GetSystemMetrics(SM_CXSCREEN) &&
|
||||
devmode.dmPelsHeight == (uint32_t)GetSystemMetrics(SM_CYSCREEN)) {
|
||||
if (DDVideo_info.app->NT() && devmode.dmDisplayFrequency == (uint32_t)GetDeviceCaps(hdc, VREFRESH))
|
||||
DDVideo_info.gdi.olddevmode = i;
|
||||
else if (!DDVideo_info.app->NT())
|
||||
DDVideo_info.gdi.olddevmode = i;
|
||||
|
@ -350,11 +350,11 @@ void Debug_LogClose() {
|
||||
}
|
||||
}
|
||||
|
||||
// void Debug_SetSpewFilter(uint spew_filter)
|
||||
void Debug_SetSpewFilter(uint) {}
|
||||
// void Debug_SetSpewFilter(uint32_t spew_filter)
|
||||
void Debug_SetSpewFilter(uint32_t) {}
|
||||
|
||||
// uint Debug_GetSpewFilter(uint spew_filter)
|
||||
uint Debug_GetSpewFilter(uint) { return 0; }
|
||||
// uint32_t Debug_GetSpewFilter(uint32_t spew_filter)
|
||||
uint32_t Debug_GetSpewFilter(uint32_t) { return 0; }
|
||||
|
||||
void Debug_ConsoleExit() {
|
||||
if (Console_fd >= 0)
|
||||
|
@ -160,7 +160,7 @@ bool joy_chpro_hack = false; // flightstick pro hack for Win32 only
|
||||
bool joy_Init(bool emulation) {
|
||||
// Can we initialize DirectInput version?
|
||||
// Try to init forcefeedback (which initializes joysticks)
|
||||
uint i, n; // = joyGetNumDevs();
|
||||
uint32_t i, n; // = joyGetNumDevs();
|
||||
|
||||
ddio_ff_AttachForce();
|
||||
|
||||
|
@ -707,8 +707,8 @@ bool ProcessGlu32DLL(void)
|
||||
bool ProcessUpdatedVersionFile(void)
|
||||
{
|
||||
FILE *f;
|
||||
uint cur_major, cur_minor, cur_build;
|
||||
uint new_major, new_minor, new_build;
|
||||
uint32_t cur_major, cur_minor, cur_build;
|
||||
uint32_t new_major, new_minor, new_build;
|
||||
char buffer[PSPATHNAME_LEN+1];
|
||||
char verbuffer[PSPATHNAME_LEN+1];
|
||||
|
||||
|
@ -909,8 +909,8 @@ void CD3LaunchDlg::OnBtnPlay()
|
||||
|
||||
if (ffhwnd) {
|
||||
CFindFastDlg findfastdlg;
|
||||
uint disable_ffast = os_config_read_uint(szSectionName, "FindFastDisable",1);
|
||||
uint show_ffast_dlg = os_config_read_uint(szSectionName, "ShowFindFastDlg",1);
|
||||
uint32_t disable_ffast = os_config_read_uint(szSectionName, "FindFastDisable",1);
|
||||
uint32_t show_ffast_dlg = os_config_read_uint(szSectionName, "ShowFindFastDlg",1);
|
||||
|
||||
if (show_ffast_dlg || !disable_ffast) {
|
||||
int iDisableFF;
|
||||
|
@ -234,7 +234,7 @@ Cleanup:
|
||||
}
|
||||
|
||||
// Writes an uint32_t to the INI file.
|
||||
void os_config_write_uint( char *section, char *name, uint value )
|
||||
void os_config_write_uint( char *section, char *name, uint32_t value )
|
||||
{
|
||||
HKEY hKey = NULL;
|
||||
DWORD dwDisposition;
|
||||
@ -451,13 +451,13 @@ Cleanup:
|
||||
|
||||
// Reads a string from the INI file. Default_value must
|
||||
// be passed, and if 'name' isn't found, then returns default_value
|
||||
uint os_config_read_uint( char *section, char *name, uint default_value )
|
||||
uint32_t os_config_read_uint( char *section, char *name, uint32_t default_value )
|
||||
{
|
||||
HKEY hKey = NULL;
|
||||
DWORD dwType, dwLen;
|
||||
char keyname[1024];
|
||||
LONG lResult;
|
||||
uint tmp_val;
|
||||
uint32_t tmp_val;
|
||||
|
||||
|
||||
if ( section ) {
|
||||
|
@ -50,8 +50,8 @@
|
||||
|
||||
void os_config_write_string( char *section, char *name, char *value );
|
||||
char *os_config_read_string( char *section, char *name, char *default_value );
|
||||
uint os_config_read_uint( char *section, char *name, uint default_value );
|
||||
void os_config_write_uint( char *section, char *name, uint value );
|
||||
uint32_t os_config_read_uint( char *section, char *name, uint32_t default_value );
|
||||
void os_config_write_uint( char *section, char *name, uint32_t value );
|
||||
char *os_config_read_string_ex( char *keyname, char *name, char *default_value );
|
||||
|
||||
extern char *szSectionName;
|
||||
|
@ -208,7 +208,7 @@ bool UpdateComplete; // indicates that the update has successfully completed
|
||||
int update_launcher_status; // indicates if the launcher itself needs updating
|
||||
|
||||
CUpdateDlg *dlg;
|
||||
uint filesize;
|
||||
uint32_t filesize;
|
||||
WSADATA wsa_data;
|
||||
|
||||
// Declare the function pointer to get the Patch apply function from the DLL
|
||||
@ -486,7 +486,7 @@ void CUpdateDlg::OnYes()
|
||||
// TODO: Add your control notification handler code here
|
||||
char buffer[PSPATHNAME_LEN+1];
|
||||
char verbuffer[PSPATHNAME_LEN+1], filebuffer[PSPATHNAME_LEN+1];
|
||||
uint major, minor, build;
|
||||
uint32_t major, minor, build;
|
||||
int get_file_ret;
|
||||
CString str_msg;
|
||||
int line_num;
|
||||
|
@ -144,10 +144,10 @@ protected:
|
||||
BOOL GetMOTD();
|
||||
|
||||
// User's current version
|
||||
uint UsrMajor, UsrMinor, UsrBuild;
|
||||
uint32_t UsrMajor, UsrMinor, UsrBuild;
|
||||
|
||||
// Newest version available
|
||||
uint NewMajor, NewMinor, NewBuild;
|
||||
uint32_t NewMajor, NewMinor, NewBuild;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CUpdateDlg)
|
||||
|
@ -238,11 +238,11 @@ void BriefEditFreeEffect(tBriefEffect *efx)
|
||||
efx->type = BE_NONE;
|
||||
}
|
||||
|
||||
void BuildMissionFlagMask(uint mask,char *string,ubyte isset)
|
||||
void BuildMissionFlagMask(uint32_t mask,char *string,ubyte isset)
|
||||
{
|
||||
int counter = 0;
|
||||
int index = 0;
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
char temp[10];
|
||||
|
||||
for(index=0;index<32;index++){
|
||||
@ -1023,7 +1023,7 @@ void BEAddButtonEffect(LPTCBUTTONDESC desc,char *description,int id)
|
||||
dest->jump_page = desc->jump_page;
|
||||
}
|
||||
|
||||
void BEStartScreen(int screen_num,char *description,char *layout,uint mask_set,uint mask_unset)
|
||||
void BEStartScreen(int screen_num,char *description,char *layout,uint32_t mask_set,uint32_t mask_unset)
|
||||
{
|
||||
int scr_to_add = -1;
|
||||
for(int i=0;i<MAX_TELCOM_SCREENS;i++){
|
||||
|
@ -79,7 +79,7 @@ typedef struct{
|
||||
int root_effect; //root effect to start the list
|
||||
char layout[_MAX_PATH]; //layout screen to use
|
||||
tBriefEffect effects[MAX_EFFECTS_PER_SCREEN]; //the effects for the screen
|
||||
uint mission_mask_set,mission_mask_unset;
|
||||
uint32_t mission_mask_set,mission_mask_unset;
|
||||
int next,prev; //next/prev screen in list
|
||||
}tBriefScreen;
|
||||
|
||||
|
@ -33,7 +33,7 @@ static char THIS_FILE[] = __FILE__;
|
||||
// CBriefMissionFlagsDlg dialog
|
||||
|
||||
|
||||
CBriefMissionFlagsDlg::CBriefMissionFlagsDlg(uint setflags,uint unsetflags,CWnd* pParent /*=NULL*/)
|
||||
CBriefMissionFlagsDlg::CBriefMissionFlagsDlg(uint32_t setflags,uint32_t unsetflags,CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CBriefMissionFlagsDlg::IDD, pParent)
|
||||
{
|
||||
m_Set = setflags;
|
||||
@ -130,7 +130,7 @@ void CBriefMissionFlagsDlg::OnOK()
|
||||
|
||||
m_Set = m_UnSet = 0;
|
||||
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
int i,value;
|
||||
|
||||
for(i=0;i<32;i++){
|
||||
@ -186,7 +186,7 @@ BOOL CBriefMissionFlagsDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
uint bit = 0x01;
|
||||
uint32_t bit = 0x01;
|
||||
int i;
|
||||
|
||||
//First go through the set bits
|
||||
|
@ -32,7 +32,7 @@ class CBriefMissionFlagsDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CBriefMissionFlagsDlg(uint setflags,uint unsetflags,CWnd* pParent = NULL); // standard constructor
|
||||
CBriefMissionFlagsDlg(uint32_t setflags,uint32_t unsetflags,CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CBriefMissionFlagsDlg)
|
||||
@ -80,7 +80,7 @@ public:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
public:
|
||||
uint m_Set,m_UnSet;
|
||||
uint32_t m_Set,m_UnSet;
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
void UpdateView(void);
|
||||
int m_Screen;
|
||||
int bm_handle;
|
||||
uint m_Set,m_UnSet;
|
||||
uint32_t m_Set,m_UnSet;
|
||||
grHardwareSurface m_ObjectSurf;
|
||||
|
||||
// Dialog Data
|
||||
|
@ -623,7 +623,7 @@ BOOL CGrFontDialog::save_font_file(gr_font_file_record *ft)
|
||||
short *tmp_widths;
|
||||
ubyte **tmp_cdata;
|
||||
FONTFILE ffile;
|
||||
uint id = 0xfeedbaba;
|
||||
uint32_t id = 0xfeedbaba;
|
||||
int num_char;
|
||||
bool grayed_font;
|
||||
CButton *gray_check = (CButton *)GetDlgItem(IDC_PROP_GRADIANT);
|
||||
|
@ -2753,7 +2753,7 @@ void CMainFrame::OnTestTest2()
|
||||
extern char error_buf[];
|
||||
extern int error_buf_offset;
|
||||
void CheckError(const char *str,...);
|
||||
uint check_point_to_face(vector *colp, vector* face_normal,int nv,vector **vertex_ptr_list);
|
||||
uint32_t check_point_to_face(vector *colp, vector* face_normal,int nv,vector **vertex_ptr_list);
|
||||
|
||||
void LookForFVICracks()
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ bool GenericPageList::LoadTable (char *table_filename)
|
||||
CFILE *infile;
|
||||
ubyte pagetype;
|
||||
int done;
|
||||
uint page_id;
|
||||
uint32_t page_id;
|
||||
|
||||
GenericPageNode *generic_page_node;
|
||||
|
||||
@ -229,7 +229,7 @@ bool GenericPageList::SaveTable (char *table_filename)
|
||||
CFILE *infile,*outfile;
|
||||
ubyte pagetype,replaced=0;
|
||||
int done=0;
|
||||
uint page_id;
|
||||
uint32_t page_id;
|
||||
GenericPageNode *new_generic_page;
|
||||
mngs_generic_page genericpage;
|
||||
|
||||
@ -375,9 +375,9 @@ void GenericPageList::SelectPrev(void)
|
||||
}
|
||||
}
|
||||
|
||||
void GenericPageList::SelectNode(uint list_index)
|
||||
void GenericPageList::SelectNode(uint32_t list_index)
|
||||
{
|
||||
uint j;
|
||||
uint32_t j;
|
||||
GenericPageNode *node;
|
||||
|
||||
if(list_index<0 || list_index>(m_size-1))
|
||||
@ -453,7 +453,7 @@ void GenericPageList::SaveSelected(CEdit *description)
|
||||
return;
|
||||
}
|
||||
|
||||
GenericPageNode *GenericPageList::FindNode(uint page_id)
|
||||
GenericPageNode *GenericPageList::FindNode(uint32_t page_id)
|
||||
{
|
||||
GenericPageNode *node, *found_node;
|
||||
|
||||
|
@ -33,7 +33,7 @@ private:
|
||||
GenericPageNode *next;
|
||||
|
||||
mngs_generic_page genericpage; // Generic Page Data
|
||||
uint page_id; // Page's file index (i.e. the page_id'th page in file)
|
||||
uint32_t page_id; // Page's file index (i.e. the page_id'th page in file)
|
||||
|
||||
public:
|
||||
GenericPageNode::GenericPageNode();
|
||||
@ -47,7 +47,7 @@ class GenericPageList {
|
||||
private:
|
||||
GenericPageNode *m_head;
|
||||
GenericPageNode *m_tail;
|
||||
uint m_size;
|
||||
uint32_t m_size;
|
||||
|
||||
CString m_TableFilename;
|
||||
bool m_TableLoaded;
|
||||
@ -55,7 +55,7 @@ private:
|
||||
bool m_TableModified;
|
||||
|
||||
GenericPageNode *m_SelectedNode;
|
||||
uint m_SelectedIndex;
|
||||
uint32_t m_SelectedIndex;
|
||||
|
||||
public:
|
||||
GenericPageList::GenericPageList();
|
||||
@ -71,11 +71,11 @@ public:
|
||||
bool SaveTable(char *table_filename);
|
||||
bool FillFromList(CComboBox *list);
|
||||
|
||||
GenericPageNode *FindNode(uint page_id);
|
||||
GenericPageNode *FindNode(uint32_t page_id);
|
||||
|
||||
void SelectNext(void);
|
||||
void SelectPrev(void);
|
||||
void SelectNode(uint list_index);
|
||||
void SelectNode(uint32_t list_index);
|
||||
void DisplaySelected(CComboBox *list, CEdit *description);
|
||||
void SaveSelected(CEdit *description);
|
||||
|
||||
|
@ -680,7 +680,7 @@ void CMusicutilsDlg::OnToolsMakeStream()
|
||||
if (savedlg.DoModal() == IDOK) {
|
||||
OSFArchive osf;
|
||||
ubyte strmtype=0, strmcomp=0, strmfmt=0, xforms;
|
||||
uint rate;
|
||||
uint32_t rate;
|
||||
|
||||
// determine stream type.
|
||||
strmtype = OSF_DIGITAL_STRM;
|
||||
@ -740,11 +740,11 @@ void CMusicutilsDlg::OnToolsPlaySong()
|
||||
#define FILEBUFFER_LENGTH (64 * 1024)
|
||||
static ubyte StaticFileBuffer[FILEBUFFER_LENGTH];
|
||||
|
||||
bool CMusicutilsDlg::SaveDigitalStream(OSFArchive *osf, const CString& rawfilename, ubyte compression, ubyte format, uint samples, const CString& realname, ubyte xforms, int measure)
|
||||
bool CMusicutilsDlg::SaveDigitalStream(OSFArchive *osf, const CString& rawfilename, ubyte compression, ubyte format, uint32_t samples, const CString& realname, ubyte xforms, int measure)
|
||||
{
|
||||
FILE *fpin = NULL;
|
||||
int i;
|
||||
uint filelen;
|
||||
uint32_t filelen;
|
||||
int nblocks;
|
||||
|
||||
if (compression == OSF_DIGIACM_STRM ) {
|
||||
@ -801,7 +801,7 @@ bool CMusicutilsDlg::SaveDigitalStream(OSFArchive *osf, const CString& rawfilena
|
||||
|
||||
ASSERT(fpin);
|
||||
|
||||
filelen = (uint)_filelength(fileno(fpin));
|
||||
filelen = (uint32_t)_filelength(fileno(fpin));
|
||||
nblocks = filelen / FILEBUFFER_LENGTH;
|
||||
|
||||
// write out data.
|
||||
|
@ -85,7 +85,7 @@ private:
|
||||
void NewTheme();
|
||||
void OpenThemeFile(const CString& filename);
|
||||
void SaveThemeFile();
|
||||
bool SaveDigitalStream(OSFArchive *osf, const CString& rawfilename, ubyte compression, ubyte format, uint samples,
|
||||
bool SaveDigitalStream(OSFArchive *osf, const CString& rawfilename, ubyte compression, ubyte format, uint32_t samples,
|
||||
const CString& realname, ubyte xforms, int measure);
|
||||
void GetStreamInfo(const CString &filename, CString& realname);
|
||||
|
||||
|
@ -3279,10 +3279,10 @@ void d3d_Screenshot(int bm_handle) {
|
||||
int shorts_per_row = surf_desc.lPitch / 2;
|
||||
int ints_per_row = surf_desc.lPitch / 4;
|
||||
|
||||
uint pix;
|
||||
uint32_t pix;
|
||||
|
||||
uint *rptr;
|
||||
rptr = (uint *)surf_desc.lpSurface;
|
||||
uint32_t *rptr;
|
||||
rptr = (uint32_t *)surf_desc.lpSurface;
|
||||
|
||||
// Go through and read our pixels
|
||||
for (i = 0; i < h; i++) {
|
||||
|
@ -152,9 +152,9 @@ ushort *OpenGL_lightmap_remap;
|
||||
ubyte *OpenGL_bitmap_states;
|
||||
ubyte *OpenGL_lightmap_states;
|
||||
|
||||
uint *opengl_Upload_data = NULL;
|
||||
uint *opengl_Translate_table = NULL;
|
||||
uint *opengl_4444_translate_table = NULL;
|
||||
uint32_t *opengl_Upload_data = NULL;
|
||||
uint32_t *opengl_Translate_table = NULL;
|
||||
uint32_t *opengl_4444_translate_table = NULL;
|
||||
|
||||
ushort *opengl_packed_Upload_data = NULL;
|
||||
ushort *opengl_packed_Translate_table = NULL;
|
||||
@ -881,9 +881,9 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) {
|
||||
opengl_packed_4444_translate_table[i] = pix;
|
||||
}
|
||||
} else {
|
||||
opengl_Upload_data = (uint *)mem_malloc(256 * 256 * 4);
|
||||
opengl_Translate_table = (uint *)mem_malloc(65536 * 4);
|
||||
opengl_4444_translate_table = (uint *)mem_malloc(65536 * 4);
|
||||
opengl_Upload_data = (uint32_t *)mem_malloc(256 * 256 * 4);
|
||||
opengl_Translate_table = (uint32_t *)mem_malloc(65536 * 4);
|
||||
opengl_4444_translate_table = (uint32_t *)mem_malloc(65536 * 4);
|
||||
|
||||
ASSERT(opengl_Upload_data);
|
||||
ASSERT(opengl_Translate_table);
|
||||
@ -892,7 +892,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) {
|
||||
mprintf((0, "Building OpenGL translate table...\n"));
|
||||
|
||||
for (i = 0; i < 65536; i++) {
|
||||
uint pix;
|
||||
uint32_t pix;
|
||||
int r = (i >> 10) & 0x1f;
|
||||
int g = (i >> 5) & 0x1f;
|
||||
int b = i & 0x1f;
|
||||
@ -969,13 +969,13 @@ D3DError:
|
||||
void opengl_Close() {
|
||||
CHECK_ERROR(5)
|
||||
|
||||
uint *delete_list = (uint *)mem_malloc(Cur_texture_object_num * sizeof(int));
|
||||
uint32_t *delete_list = (uint32_t *)mem_malloc(Cur_texture_object_num * sizeof(int));
|
||||
ASSERT(delete_list);
|
||||
for (int i = 1; i < Cur_texture_object_num; i++)
|
||||
delete_list[i] = i;
|
||||
|
||||
if (Cur_texture_object_num > 1)
|
||||
dglDeleteTextures(Cur_texture_object_num, (const uint *)delete_list);
|
||||
dglDeleteTextures(Cur_texture_object_num, (const uint32_t *)delete_list);
|
||||
|
||||
mem_free(delete_list);
|
||||
|
||||
@ -1168,11 +1168,11 @@ void opengl_TranslateBitmapToOpenGL(int texnum, int bm_handle, int map_type, int
|
||||
|
||||
} else {
|
||||
if (map_type == MAP_TYPE_LIGHTMAP) {
|
||||
uint *left_data = (uint *)opengl_Upload_data;
|
||||
uint32_t *left_data = (uint32_t *)opengl_Upload_data;
|
||||
int bm_left = 0;
|
||||
|
||||
for (int i = 0; i < h; i++, left_data += size, bm_left += w) {
|
||||
uint *dest_data = left_data;
|
||||
uint32_t *dest_data = left_data;
|
||||
for (int t = 0; t < w; t++) {
|
||||
*dest_data++ = opengl_Translate_table[bm_ptr[bm_left + t]];
|
||||
}
|
||||
@ -1824,7 +1824,7 @@ void opengl_EndFrame() {}
|
||||
// Takes a screenshot of the frontbuffer and puts it into the passed bitmap handle
|
||||
void opengl_Screenshot(int bm_handle) {
|
||||
ushort *dest_data;
|
||||
uint *temp_data;
|
||||
uint32_t *temp_data;
|
||||
int i, t;
|
||||
int total = OpenGL_state.screen_width * OpenGL_state.screen_height;
|
||||
|
||||
@ -1834,7 +1834,7 @@ void opengl_Screenshot(int bm_handle) {
|
||||
int w = bm_w(bm_handle, 0);
|
||||
int h = bm_h(bm_handle, 0);
|
||||
|
||||
temp_data = (uint *)mem_malloc(total * 4);
|
||||
temp_data = (uint32_t *)mem_malloc(total * 4);
|
||||
ASSERT(temp_data); // Ran out of memory?
|
||||
|
||||
dest_data = bm_data(bm_handle, 0);
|
||||
@ -1844,7 +1844,7 @@ void opengl_Screenshot(int bm_handle) {
|
||||
|
||||
for (i = 0; i < h; i++) {
|
||||
for (t = 0; t < w; t++) {
|
||||
uint spix = temp_data[i * w + t];
|
||||
uint32_t spix = temp_data[i * w + t];
|
||||
|
||||
int r = spix & 0xff;
|
||||
int g = (spix >> 8) & 0xff;
|
||||
|
20
lib/CZip.h
20
lib/CZip.h
@ -68,7 +68,7 @@
|
||||
*/
|
||||
|
||||
#define ubyte unsigned char
|
||||
#define uint uint32_t
|
||||
#define uint32_t uint32_t
|
||||
#define ushort unsigned short
|
||||
|
||||
typedef struct {
|
||||
@ -95,13 +95,13 @@ typedef struct tBitFile {
|
||||
// HuffmanBasic ///////
|
||||
/////////////////////////
|
||||
typedef struct tHuffman0TreeNode {
|
||||
uint count;
|
||||
uint saved_count;
|
||||
uint32_t count;
|
||||
uint32_t saved_count;
|
||||
int child0, child1;
|
||||
} tH0Node;
|
||||
|
||||
typedef struct {
|
||||
uint code;
|
||||
uint32_t code;
|
||||
int code_bits;
|
||||
} tH0Code;
|
||||
|
||||
@ -111,7 +111,7 @@ typedef struct {
|
||||
#define SYMBOL_COUNT 258
|
||||
#define NODE_TABLE_COUNT ((SYMBOL_COUNT * 2) - 1)
|
||||
typedef struct tHANode {
|
||||
uint weight;
|
||||
uint32_t weight;
|
||||
int parent;
|
||||
bool child_is_leaf;
|
||||
int child;
|
||||
@ -180,11 +180,11 @@ public:
|
||||
void WriteBytes(char *data, int count);
|
||||
ubyte ReadRawByte(void);
|
||||
ushort ReadRawShort(void);
|
||||
uint ReadRawInt(void);
|
||||
uint32_t ReadRawInt(void);
|
||||
float ReadRawFloat(void);
|
||||
void WriteRawByte(ubyte value);
|
||||
void WriteRawShort(ushort value);
|
||||
void WriteRawInt(uint value);
|
||||
void WriteRawInt(uint32_t value);
|
||||
void WriteRawFloat(float value);
|
||||
bool RawEOF(void);
|
||||
|
||||
@ -233,7 +233,7 @@ private:
|
||||
uint32_t InputBits(BITFILE *bfile, int bitcount);
|
||||
void CloseInputBitFile(BITFILE *bfile);
|
||||
void CloseOutputBitFile(BITFILE *bfile);
|
||||
void FilePrintBinary(FILE *file, uint code, int bits);
|
||||
void FilePrintBinary(FILE *file, uint32_t code, int bits);
|
||||
tVirtualFile *VFopen(const char *filename, const char *flags, int size = 0);
|
||||
int VFclose(tVirtualFile *f);
|
||||
int VFputc(int value, tVirtualFile *file);
|
||||
@ -253,7 +253,7 @@ private:
|
||||
void hb_count_bytes(tVirtualFile *input, uint32_t *long_counts);
|
||||
void hb_scale_counts(uint32_t *long_counts, tH0Node *nodes);
|
||||
int hb_build_tree(tH0Node *nodes);
|
||||
void hb_convert_tree_to_code(tH0Node *nodes, tH0Code *codes, uint code_so_far, int bits, int node);
|
||||
void hb_convert_tree_to_code(tH0Node *nodes, tH0Code *codes, uint32_t code_so_far, int bits, int node);
|
||||
void hb_output_counts(BITFILE *output, tH0Node *nodes);
|
||||
void hb_input_counts(BITFILE *input, tH0Node *nodes);
|
||||
|
||||
@ -264,7 +264,7 @@ private:
|
||||
int ha_CompressFile(tVirtualFile *input, BITFILE *output);
|
||||
void ha_ExpandFile(BITFILE *input, tVirtualFile *output);
|
||||
void ha_InitializeTree(tHATree *tree);
|
||||
void ha_EncodeSymbol(tHATree *tree, uint c, BITFILE *output);
|
||||
void ha_EncodeSymbol(tHATree *tree, uint32_t c, BITFILE *output);
|
||||
int ha_DecodeSymbol(tHATree *tree, BITFILE *input);
|
||||
void ha_UpdateModel(tHATree *tree, int c);
|
||||
void ha_RebuildTree(tHATree *tree);
|
||||
|
@ -177,7 +177,7 @@ typedef struct ddgr_surface {
|
||||
ddraw_surf = true if this is a true DirectDraw surface, false if a GDI surface
|
||||
object_ptr = DirectDraw object if ddraw_surf = true, a HDC if a GDI surface.
|
||||
*/
|
||||
void ddgr_surf_GetPrivateData(ddgr_surface *sf, bool *ddraw_surf, uint *object_ptr);
|
||||
void ddgr_surf_GetPrivateData(ddgr_surface *sf, bool *ddraw_surf, uint32_t *object_ptr);
|
||||
|
||||
// you must typecase this return value to LPDIRECTDRAW
|
||||
unsigned ddgr_GetDDrawObject();
|
||||
|
@ -418,7 +418,7 @@ bool PolyCollideObject(object *obj);
|
||||
bool BBoxPlaneIntersection(bool fast_exit, vector *collision_point, vector *collision_normal, object *obj,
|
||||
vector *new_pos, int nv, vector **vertex_ptr_list, vector *face_normal, matrix *orient);
|
||||
|
||||
extern uint check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list);
|
||||
extern uint32_t check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list);
|
||||
|
||||
extern int check_vector_to_sphere_1(vector *intp, float *col_dist, const vector *p0, const vector *p1,
|
||||
vector *sphere_pos, float sphere_rad, bool f_correcting, bool f_init_collisions);
|
||||
|
@ -72,7 +72,7 @@
|
||||
#define OPAQUE_FLAG OPAQUE_FLAG16
|
||||
|
||||
// a new color definition
|
||||
typedef uint ddgr_color;
|
||||
typedef uint32_t ddgr_color;
|
||||
|
||||
// Color constants
|
||||
static const ddgr_color GR_NULL = 0xffffffff, // don't do a thing with this.
|
||||
|
@ -354,17 +354,17 @@ int FindPolyModelName(const char *name);
|
||||
|
||||
// This one is for static lighting - ie 1 light value for the entire model
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, float r, float g,
|
||||
float b, uint f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0, ubyte overlay = 0);
|
||||
float b, uint32_t f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0, ubyte overlay = 0);
|
||||
|
||||
// This one is for gouraud shading - the lightdir is the normalized light direction, and lightscalar is a 0-1 scalar to
|
||||
// apply
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, vector *lightdir,
|
||||
float r, float g, float b, uint f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0,
|
||||
float r, float g, float b, uint32_t f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0,
|
||||
ubyte overlay = 0);
|
||||
|
||||
// This one is for lightmap rendering
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags,
|
||||
lightmap_object *lm_object, uint f_render_sub, ubyte use_effect = 0, ubyte overlay = 0);
|
||||
lightmap_object *lm_object, uint32_t f_render_sub, ubyte use_effect = 0, ubyte overlay = 0);
|
||||
|
||||
// gives the interpreter an array of points to use
|
||||
void g3_SetInterpPoints(g3Point *pointlist);
|
||||
@ -410,8 +410,8 @@ float ComputeDefaultSize(int type, int handle, float *size_ptr);
|
||||
int CountFacesInPolymodel(poly_model *pm);
|
||||
|
||||
// Rendering functions
|
||||
int RenderPolygonModel(poly_model *, uint f_render_sub = 0xFFFFFFFF);
|
||||
void RenderSubmodel(poly_model *pm, bsp_info *sm, uint f_render_sub);
|
||||
int RenderPolygonModel(poly_model *, uint32_t f_render_sub = 0xFFFFFFFF);
|
||||
void RenderSubmodel(poly_model *pm, bsp_info *sm, uint32_t f_render_sub);
|
||||
|
||||
// returns point within polymodel/submodel in world coordinates.
|
||||
void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix *orient, int subnum, vector *pos,
|
||||
@ -435,7 +435,7 @@ poly_model *GetPolymodelPointer(int polynum);
|
||||
void FreePolymodelData(int i);
|
||||
|
||||
// Sets the position and rotation of a polymodel. Used for rendering and collision detection
|
||||
void SetModelAnglesAndPos(poly_model *po, float *normalized_time, uint subobj_flags = 0xFFFFFFFF);
|
||||
void SetModelAnglesAndPos(poly_model *po, float *normalized_time, uint32_t subobj_flags = 0xFFFFFFFF);
|
||||
|
||||
extern void DoneLightInstance();
|
||||
extern void StartLightInstance(vector *, matrix *);
|
||||
|
@ -25,7 +25,7 @@
|
||||
typedef unsigned char ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef unsigned long ulong;
|
||||
|
||||
#ifdef _MSC_VER // only Visual C++ has __int64
|
||||
|
18
lib/unzip.h
18
lib/unzip.h
@ -43,7 +43,7 @@
|
||||
#include "pstypes.h"
|
||||
|
||||
typedef struct {
|
||||
uint cent_file_header_sig;
|
||||
uint32_t cent_file_header_sig;
|
||||
ubyte version_made_by;
|
||||
ubyte host_os;
|
||||
ubyte version_needed_to_extract;
|
||||
@ -52,16 +52,16 @@ typedef struct {
|
||||
ushort compression_method;
|
||||
ushort last_mod_file_time;
|
||||
ushort last_mod_file_date;
|
||||
uint crc32;
|
||||
uint compressed_size;
|
||||
uint uncompressed_size;
|
||||
uint32_t crc32;
|
||||
uint32_t compressed_size;
|
||||
uint32_t uncompressed_size;
|
||||
ushort filename_length;
|
||||
ushort extra_field_length;
|
||||
ushort file_comment_length;
|
||||
ushort disk_number_start;
|
||||
ushort internal_file_attrib;
|
||||
uint external_file_attrib;
|
||||
uint offset_lcl_hdr_frm_frst_disk;
|
||||
uint32_t external_file_attrib;
|
||||
uint32_t offset_lcl_hdr_frm_frst_disk;
|
||||
char *name;
|
||||
} zipentry;
|
||||
|
||||
@ -133,13 +133,13 @@ private:
|
||||
zipentry m_ent; // buffer for readzip
|
||||
|
||||
// end_of_cent_dir
|
||||
uint m_end_of_cent_dir_sig;
|
||||
uint32_t m_end_of_cent_dir_sig;
|
||||
ushort m_number_of_this_disk;
|
||||
ushort m_number_of_disk_start_cent_dir;
|
||||
ushort m_total_entries_cent_dir_this_disk;
|
||||
ushort m_total_entries_cent_dir;
|
||||
uint m_size_of_cent_dir;
|
||||
uint m_offset_to_start_of_cent_dir;
|
||||
uint32_t m_size_of_cent_dir;
|
||||
uint32_t m_offset_to_start_of_cent_dir;
|
||||
ushort m_zipfile_comment_length;
|
||||
char *m_zipfile_comment; // pointer in ecd
|
||||
};
|
||||
|
@ -1024,7 +1024,7 @@ void RotateModelPoints(poly_model *pm, bsp_info *sm) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderSubmodel(poly_model *pm, bsp_info *sm, uint f_render_sub) {
|
||||
void RenderSubmodel(poly_model *pm, bsp_info *sm, uint32_t f_render_sub) {
|
||||
int i;
|
||||
matrix lightmatrix;
|
||||
|
||||
@ -1133,7 +1133,7 @@ pop_lighting:
|
||||
DoneLightInstance();
|
||||
}
|
||||
|
||||
int RenderPolygonModel(poly_model *pm, uint f_render_sub) {
|
||||
int RenderPolygonModel(poly_model *pm, uint32_t f_render_sub) {
|
||||
ASSERT(pm->new_style == 1);
|
||||
int i = 0;
|
||||
|
||||
|
@ -678,7 +678,7 @@ static void SetNormalizedTimeAnimTimed(float frame, float *normalized_time, poly
|
||||
static void FreeAllModels();
|
||||
/// Given a model pointer and an array of floats that go from 0..1, calculate the interpolated
|
||||
/// position/angle of each corresponding subobject.
|
||||
static void SetModelAnglesAndPosTimed(poly_model *po, float *normalized_time, uint subobj_flags);
|
||||
static void SetModelAnglesAndPosTimed(poly_model *po, float *normalized_time, uint32_t subobj_flags);
|
||||
static void BuildModelAngleMatrix(matrix *mat, angle ang, vector *axis);
|
||||
|
||||
int findtextbmpname = 0;
|
||||
@ -2611,7 +2611,7 @@ void SetPolymodelEffect(polymodel_effect *poly_effect) { Polymodel_effect = *pol
|
||||
|
||||
// Given a model pointer and an array of floats that go from 0..1, calculate the interpolated
|
||||
// position/angle of each corresponding subobject
|
||||
void SetModelAnglesAndPosTimed(poly_model *po, float *normalized_time, uint subobj_flags) {
|
||||
void SetModelAnglesAndPosTimed(poly_model *po, float *normalized_time, uint32_t subobj_flags) {
|
||||
int i;
|
||||
|
||||
ASSERT(!(po->flags & PMF_NOT_RESIDENT));
|
||||
@ -2745,7 +2745,7 @@ void SetModelAnglesAndPosTimed(poly_model *po, float *normalized_time, uint subo
|
||||
}
|
||||
|
||||
// Sets the position and rotation of a polymodel. Used for rendering and collision detection
|
||||
void SetModelAnglesAndPos(poly_model *po, float *normalized_time, uint subobj_flags) {
|
||||
void SetModelAnglesAndPos(poly_model *po, float *normalized_time, uint32_t subobj_flags) {
|
||||
ASSERT(!(po->flags & PMF_NOT_RESIDENT));
|
||||
|
||||
if (po->flags & PMF_TIMED) {
|
||||
@ -2843,7 +2843,7 @@ void DoneLightInstance() {
|
||||
|
||||
// This is the static light version
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, float r, float g,
|
||||
float b, uint f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
float b, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
poly_model *po;
|
||||
|
||||
ASSERT(Poly_models[model_num].used);
|
||||
@ -2921,7 +2921,7 @@ void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normali
|
||||
|
||||
// This draws a gouraud shaded version
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, vector *lightdir,
|
||||
float r, float g, float b, uint f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
float r, float g, float b, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
poly_model *po;
|
||||
vector light_vec = *lightdir;
|
||||
|
||||
@ -3001,7 +3001,7 @@ void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normali
|
||||
|
||||
// This draws a lightmap shaded version
|
||||
void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags,
|
||||
lightmap_object *lm_object, uint f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
lightmap_object *lm_object, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) {
|
||||
poly_model *po;
|
||||
|
||||
ASSERT(Poly_models[model_num].used);
|
||||
|
@ -56,7 +56,7 @@ char MovieDir[512];
|
||||
char SoundCardName[512];
|
||||
ushort CurrentPalette[256];
|
||||
int Movie_bm_handle = -1;
|
||||
uint Movie_current_framenum = 0;
|
||||
uint32_t Movie_current_framenum = 0;
|
||||
bool Movie_looping = false;
|
||||
|
||||
#ifndef NO_MOVIES
|
||||
|
@ -306,7 +306,7 @@ $$TABLE_SOUND "PlayerDeath"
|
||||
// killer_obj = object pointer to the object that killed the player
|
||||
// victim_pnum = player number of the player that got killed
|
||||
void DMFCBase::OnClientPlayerKilled(object *killer_obj, int victim_pnum) {
|
||||
uint hash = 0xFFFFFFFF;
|
||||
uint32_t hash = 0xFFFFFFFF;
|
||||
int kpnum;
|
||||
player_record *kpr, *vpr;
|
||||
|
||||
@ -318,7 +318,7 @@ void DMFCBase::OnClientPlayerKilled(object *killer_obj, int victim_pnum) {
|
||||
|
||||
// now we need to extract out the weapon of the kill
|
||||
if (Data->iParam != -1)
|
||||
hash = (uint)Data->iParam;
|
||||
hash = (uint32_t)Data->iParam;
|
||||
} else if (killer_obj->type == OBJ_ROBOT || (killer_obj->type == OBJ_BUILDING && killer_obj->ai_info)) {
|
||||
// countermeasure kill
|
||||
kpnum = GetCounterMeasureOwner(killer_obj);
|
||||
|
@ -226,8 +226,8 @@ DMFCFUNCTION void (*DLLGetUltimateParentForObject)(object **parent, object *chil
|
||||
DMFCFUNCTION void (*DLLSetObjectDeadFlagRaw)(object *obj, bool tell_clients_to_remove, bool tell_clients_to_play_sound);
|
||||
DMFCFUNCTION void (*DLLSetObjectDeadFlag)(object *obj, bool tell_clients_to_remove, bool tell_clients_to_play_sound);
|
||||
DMFCFUNCTION void (*FatalError)(const char *reason);
|
||||
DMFCFUNCTION int (*DLLMultiMatchWeapon)(uint unique_id);
|
||||
DMFCFUNCTION uint (*DLLMultiGetMatchChecksum)(int type, int id);
|
||||
DMFCFUNCTION int (*DLLMultiMatchWeapon)(uint32_t unique_id);
|
||||
DMFCFUNCTION uint32_t (*DLLMultiGetMatchChecksum)(int type, int id);
|
||||
DMFCFUNCTION int (*DLLFindWeaponName)(const char *name);
|
||||
DMFCFUNCTION int (*DLLcf_OpenLibrary)(const char *libname);
|
||||
DMFCFUNCTION void (*DLLcf_CloseLibrary)(int handle);
|
||||
@ -235,7 +235,7 @@ DMFCFUNCTION void (*DLLMultiSendRequestToObserve)(int mode, int on, int objnum);
|
||||
DMFCFUNCTION int (*DLLFindTextureName)(const char *name);
|
||||
DMFCFUNCTION bool (*DLLApplyDamageToPlayer)(object *playerobj, object *killer, int damage_type, float damage_amount,
|
||||
int server_says, int weapon_id, bool playsound);
|
||||
DMFCFUNCTION int (*DLLMultiMatchGeneric)(uint unique_id);
|
||||
DMFCFUNCTION int (*DLLMultiMatchGeneric)(uint32_t unique_id);
|
||||
DMFCFUNCTION void (*DLLSetUITextItemText)(void *uit, char *newtext, uint32_t color);
|
||||
DMFCFUNCTION void *(*DLLNewUIWindowCreate)(int x, int y, int w, int h, int flags);
|
||||
DMFCFUNCTION void (*DLLNewUIWindowDestroy)(void *deswin);
|
||||
|
@ -110,7 +110,7 @@ const char *DMFCGetString(int d);
|
||||
// killernum = object number of the killer
|
||||
// victimnum = object number of the victim
|
||||
// hash = hash index of the weapon killer, -1 if none
|
||||
void DMFCBase::DoRandomDeathMessage(int killernum,int victimnum,uint hash)
|
||||
void DMFCBase::DoRandomDeathMessage(int killernum,int victimnum,uint32_t hash)
|
||||
{
|
||||
object *it,*me;
|
||||
|
||||
@ -255,7 +255,7 @@ seedbuf[200]; memcpy(seedbuf,seeds1,31); DecryptData((unsigned char *)seedbuf,30
|
||||
// killernum = object number of the killer
|
||||
// victimnum = object number of the victim
|
||||
// hash = hash index of the weapon killer, -1 if none
|
||||
void DMFCBase::DoRandomDeathMessage(int killernum, int victimnum, uint hash) {
|
||||
void DMFCBase::DoRandomDeathMessage(int killernum, int victimnum, uint32_t hash) {
|
||||
object *it, *me;
|
||||
|
||||
if (killernum != -1)
|
||||
|
@ -513,7 +513,7 @@ void DLLFUNCCALL IDMFC_AddSuicideMessage(IDMFC *instance, const char *string) {
|
||||
instance->AddSuicideMessage(string);
|
||||
}
|
||||
|
||||
void DLLFUNCCALL IDMFC_DoRandomDeathMessage(IDMFC *instance, int killernum, int victimnum, uint hash) {
|
||||
void DLLFUNCCALL IDMFC_DoRandomDeathMessage(IDMFC *instance, int killernum, int victimnum, uint32_t hash) {
|
||||
assert(instance != NULL);
|
||||
instance->DoRandomDeathMessage(killernum, victimnum, hash);
|
||||
}
|
||||
|
@ -1102,7 +1102,7 @@ public:
|
||||
// killernum = object number of the killer
|
||||
// victimnum = object number of the victim
|
||||
// hash = hash index of the weapon killer, -1 if none
|
||||
void DoRandomDeathMessage(int killernum, int victimnum, uint hash = -1);
|
||||
void DoRandomDeathMessage(int killernum, int victimnum, uint32_t hash = -1);
|
||||
|
||||
// DMFCBase::GetItObjNum
|
||||
//
|
||||
|
@ -69,8 +69,8 @@ static const int ice_keyrot[16] = {0, 1, 2, 3, 2, 1, 3, 0, 1, 3, 2, 0, 3, 1, 0,
|
||||
// Just like arithmetic multiplication, except that additions and
|
||||
// subtractions are replaced by XOR.
|
||||
//
|
||||
static uint gf_mult(uint a, uint b, uint m) {
|
||||
uint res = 0;
|
||||
static uint32_t gf_mult(uint32_t a, uint32_t b, uint32_t m) {
|
||||
uint32_t res = 0;
|
||||
|
||||
while (b) {
|
||||
if (b & 1)
|
||||
@ -90,8 +90,8 @@ static uint gf_mult(uint a, uint b, uint m) {
|
||||
// Galois Field exponentiation.
|
||||
// Raise the base to the power of 7, modulo m.
|
||||
//
|
||||
static uint32_t gf_exp7(uint b, uint m) {
|
||||
uint x;
|
||||
static uint32_t gf_exp7(uint32_t b, uint32_t m) {
|
||||
uint32_t x;
|
||||
|
||||
if (b == 0)
|
||||
return 0;
|
||||
|
@ -570,11 +570,11 @@ typedef void (*assertdll_fp)(int x, const char *expression, const char *file, in
|
||||
DMFCDLLOUT(assertdll_fp DLLassert;)
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
typedef int (*MultiMatchWeapon_fp)(uint unique_id);
|
||||
typedef int (*MultiMatchWeapon_fp)(uint32_t unique_id);
|
||||
DMFCDLLOUT(MultiMatchWeapon_fp DLLMultiMatchWeapon;)
|
||||
|
||||
// Returns the unique id of a given object type/id
|
||||
typedef uint (*MultiGetMatchChecksum_fp)(int type, int id);
|
||||
typedef uint32_t (*MultiGetMatchChecksum_fp)(int type, int id);
|
||||
DMFCDLLOUT(MultiGetMatchChecksum_fp DLLMultiGetMatchChecksum;)
|
||||
|
||||
// Searches thru all weapons for a specific name, returns -1 if not found
|
||||
@ -611,7 +611,7 @@ typedef bool (*ApplyDamageToPlayer_fp)(object *playerobj, object *killer, int da
|
||||
DMFCDLLOUT(ApplyDamageToPlayer_fp DLLApplyDamageToPlayer;)
|
||||
|
||||
// Return index of generic that has matching table entry
|
||||
typedef int (*MultiMatchGeneric_fp)(uint unique_id);
|
||||
typedef int (*MultiMatchGeneric_fp)(uint32_t unique_id);
|
||||
DMFCDLLOUT(MultiMatchGeneric_fp DLLMultiMatchGeneric;)
|
||||
|
||||
typedef void (*SetUITextItemText_fp)(void *uit, char *newtext, uint32_t color);
|
||||
|
@ -704,7 +704,7 @@ public:
|
||||
// killernum = object number of the killer
|
||||
// victimnum = object number of the victim
|
||||
// hash = hash index of the weapon killer, -1 if none
|
||||
virtual void DoRandomDeathMessage(int killernum, int victimnum, uint hash = -1) = 0;
|
||||
virtual void DoRandomDeathMessage(int killernum, int victimnum, uint32_t hash = -1) = 0;
|
||||
|
||||
// DMFCBase::GetItObjNum
|
||||
//
|
||||
@ -1833,7 +1833,7 @@ DLLEXPORT void DLLFUNCCALL IDMFC_AutoDeathMessage(IDMFC *instance, bool turnon);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_AddDeathMessage(IDMFC *instance, const char *string, bool victim_first = true);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_AddSuicideMessage(IDMFC *instance, const char *string);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_DoRandomDeathMessage(IDMFC *instance, int killernum, int victimnum,
|
||||
uint hash = -1);
|
||||
uint32_t hash = -1);
|
||||
DLLEXPORT int DLLFUNCCALL IDMFC_GetItObjNum(IDMFC *instance);
|
||||
DLLEXPORT int DLLFUNCCALL IDMFC_GetMeObjNum(IDMFC *instance);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_RegisterPacketReceiver(IDMFC *instance, ubyte id, void (*func)(ubyte *));
|
||||
|
@ -758,7 +758,7 @@ void nw_InitSockets(ushort port) {
|
||||
|
||||
my_ip = nw_GetThisIP();
|
||||
|
||||
memcpy(&sock_addr.sin_addr.s_addr, &my_ip, sizeof(uint));
|
||||
memcpy(&sock_addr.sin_addr.s_addr, &my_ip, sizeof(uint32_t));
|
||||
|
||||
sock_addr.sin_port = htons(port);
|
||||
if (bind(TCP_socket, (SOCKADDR *)&sock_addr, sizeof(sock_addr)) == SOCKET_ERROR) {
|
||||
|
@ -1101,13 +1101,13 @@ static const int ij_table[3][2] = {
|
||||
#define IT_POINT 3 // touches vertex
|
||||
|
||||
// see if a point in inside a face by projecting into 2d
|
||||
uint check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list) {
|
||||
uint32_t check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list) {
|
||||
vector_array *colp_array; // Axis-independant version of the collision point
|
||||
vector_array *norm; // Axis-independant version of the plane's normal
|
||||
vector t; // Temporary vector that holds the magnatude of the normal's x,y,z components (ABS)
|
||||
int biggest; // Index of the largest of the three components (0-x, 1-y, 2-z) Axis to ignore :)
|
||||
int i, j, edge; // Index for i-axis, Index for j-axis, and the current edge
|
||||
uint edgemask; // Bit-field for which side we are outside of
|
||||
uint32_t edgemask; // Bit-field for which side we are outside of
|
||||
float check_i, check_j; // (i,j) checkpoint for 2d in/out test
|
||||
vector_array *v0, *v1; // Vertices of the current line segment in the 2d in/out check loop
|
||||
|
||||
@ -1602,7 +1602,7 @@ float rad, vector *ep0, vector *ep1)
|
||||
// check if a sphere intersects a face
|
||||
int check_sphere_to_face(vector *colp, vector *intp, float *col_dist, vector *wall_norm, const vector *p0,
|
||||
const vector *p1, vector *face_normal, int nv, float rad, vector **vertex_ptr_list) {
|
||||
uint edgemask;
|
||||
uint32_t edgemask;
|
||||
|
||||
ASSERT(nv > 0 && nv <= 32); // otherwise, we overflow the edgemask -- if we hit this we need to make edgemask a long
|
||||
// long and adjust the other functions accordingly
|
||||
|
@ -68,8 +68,8 @@ static void newstyle_StartInstanceAngles(vector *pos, angvec *angles);
|
||||
|
||||
/// pops the old context
|
||||
static void newstyle_DoneInstance();
|
||||
static void CollideSubmodel(poly_model *pm, bsp_info *sm, uint f_render_sub);
|
||||
static void CollidePolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, uint f_render_sub);
|
||||
static void CollideSubmodel(poly_model *pm, bsp_info *sm, uint32_t f_render_sub);
|
||||
static void CollidePolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, uint32_t f_render_sub);
|
||||
|
||||
static void BuildModelAngleMatrix(matrix *mat, angle ang, vector *axis) {
|
||||
float x, y, z;
|
||||
@ -316,7 +316,7 @@ static void newstyle_DoneInstance() {
|
||||
}
|
||||
}
|
||||
|
||||
void CollideSubmodel(poly_model *pm, bsp_info *sm, uint f_render_sub) {
|
||||
void CollideSubmodel(poly_model *pm, bsp_info *sm, uint32_t f_render_sub) {
|
||||
// Don't collide with door housings (That is the 'room' portion of the door)
|
||||
if ((sm->flags & SOF_SHELL) || (sm->flags & SOF_FRONTFACE))
|
||||
return;
|
||||
@ -337,7 +337,7 @@ void CollideSubmodel(poly_model *pm, bsp_info *sm, uint f_render_sub) {
|
||||
DonePolyModelPosInstance();
|
||||
}
|
||||
|
||||
void CollidePolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, uint f_render_sub) {
|
||||
void CollidePolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, uint32_t f_render_sub) {
|
||||
poly_model *po;
|
||||
|
||||
ASSERT(Poly_models[model_num].used);
|
||||
|
@ -138,9 +138,9 @@ ushort *OpenGL_lightmap_remap = NULL;
|
||||
ubyte *OpenGL_bitmap_states = NULL;
|
||||
ubyte *OpenGL_lightmap_states = NULL;
|
||||
|
||||
uint *opengl_Upload_data = NULL;
|
||||
uint *opengl_Translate_table = NULL;
|
||||
uint *opengl_4444_translate_table = NULL;
|
||||
uint32_t *opengl_Upload_data = NULL;
|
||||
uint32_t *opengl_Translate_table = NULL;
|
||||
uint32_t *opengl_4444_translate_table = NULL;
|
||||
|
||||
ushort *opengl_packed_Upload_data = NULL;
|
||||
ushort *opengl_packed_Translate_table = NULL;
|
||||
@ -840,9 +840,9 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) {
|
||||
opengl_packed_4444_translate_table[i] = INTEL_INT(pix);
|
||||
}
|
||||
} else {
|
||||
opengl_Upload_data = (uint *)mem_malloc(2048 * 2048 * 4);
|
||||
opengl_Translate_table = (uint *)mem_malloc(65536 * 4);
|
||||
opengl_4444_translate_table = (uint *)mem_malloc(65536 * 4);
|
||||
opengl_Upload_data = (uint32_t *)mem_malloc(2048 * 2048 * 4);
|
||||
opengl_Translate_table = (uint32_t *)mem_malloc(65536 * 4);
|
||||
opengl_4444_translate_table = (uint32_t *)mem_malloc(65536 * 4);
|
||||
|
||||
ASSERT(opengl_Upload_data);
|
||||
ASSERT(opengl_Translate_table);
|
||||
@ -851,7 +851,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) {
|
||||
mprintf((0, "Building OpenGL translate table...\n"));
|
||||
|
||||
for (i = 0; i < 65536; i++) {
|
||||
uint pix;
|
||||
uint32_t pix;
|
||||
int r = (i >> 10) & 0x1f;
|
||||
int g = (i >> 5) & 0x1f;
|
||||
int b = i & 0x1f;
|
||||
@ -923,13 +923,13 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) {
|
||||
void opengl_Close() {
|
||||
CHECK_ERROR(5)
|
||||
|
||||
uint *delete_list = (uint *)mem_malloc(Cur_texture_object_num * sizeof(int));
|
||||
uint32_t *delete_list = (uint32_t *)mem_malloc(Cur_texture_object_num * sizeof(int));
|
||||
ASSERT(delete_list);
|
||||
for (int i = 1; i < Cur_texture_object_num; i++)
|
||||
delete_list[i] = i;
|
||||
|
||||
if (Cur_texture_object_num > 1)
|
||||
dglDeleteTextures(Cur_texture_object_num, (const uint *)delete_list);
|
||||
dglDeleteTextures(Cur_texture_object_num, (const uint32_t *)delete_list);
|
||||
|
||||
mem_free(delete_list);
|
||||
|
||||
@ -1131,11 +1131,11 @@ void opengl_TranslateBitmapToOpenGL(int texnum, int bm_handle, int map_type, int
|
||||
}
|
||||
} else {
|
||||
if (map_type == MAP_TYPE_LIGHTMAP) {
|
||||
uint *left_data = (uint *)opengl_Upload_data;
|
||||
uint32_t *left_data = (uint32_t *)opengl_Upload_data;
|
||||
int bm_left = 0;
|
||||
|
||||
for (int i = 0; i < h; i++, left_data += size, bm_left += w) {
|
||||
uint *dest_data = left_data;
|
||||
uint32_t *dest_data = left_data;
|
||||
for (int t = 0; t < w; t++) {
|
||||
*dest_data++ = opengl_Translate_table[bm_ptr[bm_left + t]];
|
||||
}
|
||||
@ -2146,7 +2146,7 @@ void rend_DrawSpecialLine(g3Point *p0, g3Point *p1) {
|
||||
// Takes a screenshot of the current frame and puts it into the handle passed
|
||||
std::unique_ptr<NewBitmap> rend_Screenshot() {
|
||||
ushort *dest_data;
|
||||
uint *temp_data;
|
||||
uint32_t *temp_data;
|
||||
|
||||
int total = gpu_state.screen_width * gpu_state.screen_height;
|
||||
auto result = std::make_unique<NewBitmap>(gpu_state.screen_width, gpu_state.screen_height, PixelDataFormat::RGBA32, true);
|
||||
@ -2164,7 +2164,7 @@ std::unique_ptr<NewBitmap> rend_Screenshot() {
|
||||
// Takes a screenshot of the current frame and puts it into the handle passed
|
||||
void rend_Screenshot(int bm_handle) {
|
||||
auto screenshot = rend_Screenshot();
|
||||
auto *temp_data = reinterpret_cast<uint*>(screenshot->getData());
|
||||
auto *temp_data = reinterpret_cast<uint32_t*>(screenshot->getData());
|
||||
|
||||
uint32_t w, h;
|
||||
screenshot->getSize(w, h);
|
||||
@ -2176,7 +2176,7 @@ void rend_Screenshot(int bm_handle) {
|
||||
|
||||
for (int i = 0; i < h; i++) {
|
||||
for (int t = 0; t < w; t++) {
|
||||
uint spix = temp_data[i * w + t];
|
||||
uint32_t spix = temp_data[i * w + t];
|
||||
|
||||
int r = spix & 0xff;
|
||||
int g = (spix >> 8) & 0xff;
|
||||
|
@ -930,7 +930,7 @@ typedef int OMMSHANDLE;
|
||||
typedef unsigned char ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef uint32_t ddgr_color;
|
||||
|
||||
#ifndef NULL
|
||||
@ -990,7 +990,7 @@ typedef struct {
|
||||
// will always be valid during the lifetime of the module
|
||||
// DO NOT ALTER THE STRING IT POINTS TO.
|
||||
|
||||
uint game_checksum; // Checksum of game structures, if this doesn't match
|
||||
uint32_t game_checksum; // Checksum of game structures, if this doesn't match
|
||||
// the checksum at compile time, it is very likely that
|
||||
// bad things can happen, and this module shouldn't initialize.
|
||||
|
||||
@ -1229,18 +1229,18 @@ typedef struct {
|
||||
ubyte pulse_offset;
|
||||
|
||||
// Objects/Players
|
||||
uint objhandle;
|
||||
uint ithandle;
|
||||
uint32_t objhandle;
|
||||
uint32_t ithandle;
|
||||
float shields, energy;
|
||||
short start_tick;
|
||||
short end_tick;
|
||||
float cycle_time;
|
||||
int type, id, aux_type, aux_id;
|
||||
uint checksum;
|
||||
uint32_t checksum;
|
||||
int path_id;
|
||||
float amount;
|
||||
ubyte damage_type;
|
||||
uint killer_handle;
|
||||
uint32_t killer_handle;
|
||||
float ammo;
|
||||
ubyte playsound;
|
||||
ubyte remove;
|
||||
|
@ -470,7 +470,7 @@ OSIRISEXTERN AI_GetCurGoalIndex_fp AI_GetCurGoalIndex;
|
||||
// the script) Returns -1 if there isn't enough available memory Returns -2 if the unique identifier passed in is
|
||||
// already used, but the requested amount_of_memory is different If the memory has already been allocated, it will
|
||||
// return the handle.
|
||||
typedef OMMSHANDLE (*OMMS_Malloc_fp)(size_t amount_of_memory, uint unique_identifier, char *script_identifier);
|
||||
typedef OMMSHANDLE (*OMMS_Malloc_fp)(size_t amount_of_memory, uint32_t unique_identifier, char *script_identifier);
|
||||
OSIRISEXTERN OMMS_Malloc_fp OMMS_Malloc;
|
||||
|
||||
// Attaches to a block of global OMMS memory. As long as at least one module (or script) is
|
||||
@ -500,13 +500,13 @@ OSIRISEXTERN OMMS_Free_fp OMMS_Free;
|
||||
// in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
|
||||
// Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
|
||||
// Returns -1 if the module was never OMMS_Malloc()'d.
|
||||
typedef OMMSHANDLE (*OMMS_Find_fp)(uint unique_identifier, char *script_identifier);
|
||||
typedef OMMSHANDLE (*OMMS_Find_fp)(uint32_t unique_identifier, char *script_identifier);
|
||||
OSIRISEXTERN OMMS_Find_fp OMMS_Find;
|
||||
|
||||
// Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
|
||||
// OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
|
||||
// Pass NULL in for those parameters you don't need information about.
|
||||
typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint *mem_size, uint *uid, ushort *reference_count,
|
||||
typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called);
|
||||
OSIRISEXTERN OMMS_GetInfo_fp OMMS_GetInfo;
|
||||
|
||||
|
@ -931,7 +931,7 @@ typedef int OMMSHANDLE;
|
||||
typedef unsigned char ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef uint32_t ddgr_color;
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -530,7 +530,7 @@ OSIRISEXTERN AI_GetCurGoalIndex_fp AI_GetCurGoalIndex;
|
||||
// the script) Returns -1 if there isn't enough available memory Returns -2 if the unique identifier passed in is
|
||||
// already used, but the requested amount_of_memory is different If the memory has already been allocated, it will
|
||||
// return the handle.
|
||||
typedef OMMSHANDLE (*OMMS_Malloc_fp)(size_t amount_of_memory, uint unique_identifier, char *script_identifier);
|
||||
typedef OMMSHANDLE (*OMMS_Malloc_fp)(size_t amount_of_memory, uint32_t unique_identifier, char *script_identifier);
|
||||
OSIRISEXTERN OMMS_Malloc_fp OMMS_Malloc;
|
||||
|
||||
// Attaches to a block of global OMMS memory. As long as at least one module (or script) is
|
||||
@ -560,13 +560,13 @@ OSIRISEXTERN OMMS_Free_fp OMMS_Free;
|
||||
// in the unique_identifier and the script_identifier that was passed in the OMMS_Malloc().
|
||||
// Note: script_identifier is really the filename of the module that called the OMMS_Malloc().
|
||||
// Returns -1 if the module was never OMMS_Malloc()'d.
|
||||
typedef OMMSHANDLE (*OMMS_Find_fp)(uint unique_identifier, char *script_identifier);
|
||||
typedef OMMSHANDLE (*OMMS_Find_fp)(uint32_t unique_identifier, char *script_identifier);
|
||||
OSIRISEXTERN OMMS_Find_fp OMMS_Find;
|
||||
|
||||
// Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or
|
||||
// OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in;
|
||||
// Pass NULL in for those parameters you don't need information about.
|
||||
typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint *mem_size, uint *uid, ushort *reference_count,
|
||||
typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called);
|
||||
OSIRISEXTERN OMMS_GetInfo_fp OMMS_GetInfo;
|
||||
|
||||
|
@ -527,22 +527,22 @@ inline void sb_adjust_properties_2d(sound_buffer_info *sb, float f_volume, float
|
||||
}
|
||||
|
||||
// functions for different APIs
|
||||
int sb_get_current_position(sound_buffer_info *sb, uint *writep) {
|
||||
int sb_get_current_position(sound_buffer_info *sb, uint32_t *writep) {
|
||||
DWORD playp, wp;
|
||||
|
||||
if (sb->m_mixer_type != SOUND_MIXER_SOFTWARE_16) {
|
||||
if (sb->m_sound_buffer && sb->m_sound_buffer->GetCurrentPosition(&playp, &wp) == DS_OK) {
|
||||
*writep = (uint)wp;
|
||||
*writep = (uint32_t)wp;
|
||||
} else {
|
||||
playp = (DWORD)(-1);
|
||||
*writep = (uint)(-1);
|
||||
*writep = (uint32_t)(-1);
|
||||
}
|
||||
}
|
||||
|
||||
return (uint)playp;
|
||||
return (uint32_t)playp;
|
||||
}
|
||||
|
||||
inline void sb_set_current_position(sound_buffer_info *sb, uint pos) {
|
||||
inline void sb_set_current_position(sound_buffer_info *sb, uint32_t pos) {
|
||||
if (!ll_sound_ptr->m_in_sound_frame)
|
||||
ll_sound_ptr->m_pending_actions = true;
|
||||
|
||||
@ -582,8 +582,8 @@ void sb_stop_buffer(sound_buffer_info *sb) {
|
||||
}
|
||||
}
|
||||
|
||||
bool sb_lock_buffer(sound_buffer_info *sb, uint dwWriteCursor, uint dwWriteBytes, void **lplpvAudioPtr1,
|
||||
uint *lpdwAudioBytes1, void **lplpvAudioPtr2, uint *lpdwAudioBytes2) {
|
||||
bool sb_lock_buffer(sound_buffer_info *sb, uint32_t dwWriteCursor, uint32_t dwWriteBytes, void **lplpvAudioPtr1,
|
||||
uint32_t *lpdwAudioBytes1, void **lplpvAudioPtr2, uint32_t *lpdwAudioBytes2) {
|
||||
DWORD len1, len2;
|
||||
|
||||
if (sb->m_mixer_type != SOUND_MIXER_SOFTWARE_16) {
|
||||
@ -605,7 +605,7 @@ bool sb_lock_buffer(sound_buffer_info *sb, uint dwWriteCursor, uint dwWriteBytes
|
||||
return false;
|
||||
}
|
||||
|
||||
bool sb_unlock_buffer(sound_buffer_info *sb, void *ptr1, uint len1, void *ptr2, uint len2) {
|
||||
bool sb_unlock_buffer(sound_buffer_info *sb, void *ptr1, uint32_t len1, void *ptr2, uint32_t len2) {
|
||||
if (sb->m_mixer_type != SOUND_MIXER_SOFTWARE_16) {
|
||||
sb->m_sound_buffer->Unlock(ptr1, len1, ptr2, len2);
|
||||
return true;
|
||||
@ -2949,7 +2949,7 @@ int win_llsSystem::SetSoundPos(int sound_uid, int pos) {
|
||||
// These work in samples to make things easier in the long run
|
||||
int win_llsSystem::GetSoundPos(int sound_uid) {
|
||||
int current_slot;
|
||||
uint temp, pos;
|
||||
uint32_t temp, pos;
|
||||
|
||||
if (!m_f_sound_lib_init)
|
||||
return -1;
|
||||
|
@ -180,14 +180,14 @@ void sb_free_buffer(sound_buffer_info *sb);
|
||||
bool sb_load_buffer(sound_buffer_info *sb, void *sample_data, int length);
|
||||
|
||||
// update current position of sound buffer
|
||||
int sb_get_current_position(sound_buffer_info *sb, uint *writep);
|
||||
int sb_get_current_position(sound_buffer_info *sb, uint32_t *writep);
|
||||
|
||||
// locks a sound buffer
|
||||
bool sb_lock_buffer(sound_buffer_info *sb, uint dwWriteCursor, uint dwWriteBytes, void **lplpvAudioPtr1,
|
||||
uint *lpdwAudioBytes1, void **lplpvAudioPtr2, uint *lpdwAudioBytes2);
|
||||
bool sb_lock_buffer(sound_buffer_info *sb, uint32_t dwWriteCursor, uint32_t dwWriteBytes, void **lplpvAudioPtr1,
|
||||
uint32_t *lpdwAudioBytes1, void **lplpvAudioPtr2, uint32_t *lpdwAudioBytes2);
|
||||
|
||||
// unlocks an allocated sound buffer
|
||||
bool sb_unlock_buffer(sound_buffer_info *sb, void *ptr1, uint len1, void *ptr2, uint len2);
|
||||
bool sb_unlock_buffer(sound_buffer_info *sb, void *ptr1, uint32_t len1, void *ptr2, uint32_t len2);
|
||||
|
||||
// this will initialize the looping thread
|
||||
bool sb_loop_thread_init(win_llsSystem *lls);
|
||||
|
@ -153,7 +153,7 @@ void sb_loop_stream_copy(sound_buffer_info *sb, char *ptr, DWORD len) {
|
||||
void sb_loop_stream_fillhalf(sound_buffer_info *sb, DWORD half) {
|
||||
char *ptr1 = NULL;
|
||||
char *ptr2 = NULL;
|
||||
uint len1, len2;
|
||||
uint32_t len1, len2;
|
||||
|
||||
if (sb_lock_buffer(sb, half, sb->s->half_buffer_point, (void **)&ptr1, &len1, (void **)&ptr2, &len2)) {
|
||||
// memset(ptr1, sb->s->silence_byte, len1);
|
||||
@ -211,7 +211,7 @@ new_data:
|
||||
void sb_stream_fillhalf(sound_buffer_info *sb, DWORD half) {
|
||||
char *ptr1 = NULL;
|
||||
char *ptr2 = NULL;
|
||||
uint len1, len2;
|
||||
uint32_t len1, len2;
|
||||
|
||||
if (sb_lock_buffer(sb, half, sb->s->half_buffer_point, (void **)&ptr1, &len1, (void **)&ptr2, &len2)) {
|
||||
sb_stream_copy(sb, ptr1, len1);
|
||||
@ -261,7 +261,7 @@ void __cdecl sb_loop_thread(void *user_ptr) {
|
||||
continue; // just continue
|
||||
} else if ((iteration % 4) == (sb->s->time_slice % 4)) {
|
||||
// update streamed buffer only when allowed
|
||||
playp = sb_get_current_position(sb, (uint *)&writep);
|
||||
playp = sb_get_current_position(sb, (uint32_t *)&writep);
|
||||
whichhalf = (playp < sb->s->half_buffer_point) ? 0 : sb->s->half_buffer_point;
|
||||
|
||||
if (whichhalf != sb->s->last_half) {
|
||||
@ -284,7 +284,7 @@ void __cdecl sb_loop_thread(void *user_ptr) {
|
||||
continue; // just continue
|
||||
} else if ((iteration % 4) == (sb->s->time_slice % 4)) {
|
||||
// update looped buffer only when allowed
|
||||
playp = sb_get_current_position(sb, (uint *)&writep);
|
||||
playp = sb_get_current_position(sb, (uint32_t *)&writep);
|
||||
whichhalf = (playp < sb->s->half_buffer_point) ? 0 : sb->s->half_buffer_point;
|
||||
|
||||
if (whichhalf != sb->s->last_half) {
|
||||
@ -434,7 +434,7 @@ void sb_stream_buffered_update(sound_buffer_info *sb) {
|
||||
DWORD playp, writep, whichhalf;
|
||||
ASSERT((sb->m_status & SSF_BUFFERED_STRM));
|
||||
|
||||
playp = sb_get_current_position(sb, (uint *)&writep);
|
||||
playp = sb_get_current_position(sb, (uint32_t *)&writep);
|
||||
whichhalf = (playp < sb->s->half_buffer_point) ? 0 : sb->s->half_buffer_point;
|
||||
|
||||
if (whichhalf != sb->s->last_half) {
|
||||
|
@ -107,7 +107,7 @@ bool OSFArchive::Open(const char *filename, bool write) {
|
||||
m_type = (ubyte)cf_ReadByte(m_fp);
|
||||
m_comp = (ubyte)cf_ReadByte(m_fp);
|
||||
m_flags = (ubyte)cf_ReadByte(m_fp);
|
||||
m_rate = (uint)cf_ReadByte(m_fp);
|
||||
m_rate = (uint32_t)cf_ReadByte(m_fp);
|
||||
|
||||
if (m_type == OSF_DIGITAL_STRM) {
|
||||
if (m_rate == 11)
|
||||
@ -118,7 +118,7 @@ bool OSFArchive::Open(const char *filename, bool write) {
|
||||
m_rate = 44100;
|
||||
|
||||
// read in aux header based off of type.
|
||||
m_hdr.digi.measure = (uint)cf_ReadInt(m_fp);
|
||||
m_hdr.digi.measure = (uint32_t)cf_ReadInt(m_fp);
|
||||
} else {
|
||||
mprintf((0, "Unsupported OSF file type in %s!\n", filename));
|
||||
cfclose(m_fp);
|
||||
@ -127,7 +127,7 @@ bool OSFArchive::Open(const char *filename, bool write) {
|
||||
}
|
||||
|
||||
// read length.
|
||||
m_length = (uint)cf_ReadInt(m_fp);
|
||||
m_length = (uint32_t)cf_ReadInt(m_fp);
|
||||
|
||||
cfseek(m_fp, -OSF_HDR_TITLE_OFS, SEEK_END);
|
||||
if (!cf_ReadBytes((ubyte *)m_name, OSF_HDR_TITLE_LEN, m_fp)) {
|
||||
@ -174,7 +174,7 @@ void OSFArchive::Rewind() {
|
||||
}
|
||||
|
||||
// write out operations.
|
||||
bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint rate, uint length, void *hdr, const char *name) {
|
||||
bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, uint32_t length, void *hdr, const char *name) {
|
||||
char chbuf[OSF_HDR_SIZE];
|
||||
int hdrstart, hdrcur;
|
||||
|
||||
|
@ -175,15 +175,15 @@ struct CFILE;
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
typedef struct tOSFDigiHdr // this struct belongs to OSF_DIGITAL_STRM
|
||||
{
|
||||
uint measure;
|
||||
uint32_t measure;
|
||||
} tOSFDigiHdr;
|
||||
class OSFArchive {
|
||||
CFILE *m_fp;
|
||||
uint m_length; // file information stored such as length
|
||||
uint32_t m_length; // file information stored such as length
|
||||
ubyte m_type; // stream type
|
||||
ubyte m_comp; // compression type
|
||||
ubyte m_flags; // format
|
||||
uint m_rate; // frequency
|
||||
uint32_t m_rate; // frequency
|
||||
bool m_writemode; // are we in write mode?
|
||||
union {
|
||||
tOSFDigiHdr digi;
|
||||
@ -198,7 +198,7 @@ public:
|
||||
bool Opened() const { return m_fp ? true : false; };
|
||||
void Rewind();
|
||||
// write out operations.
|
||||
bool SaveHeader(ubyte type, ubyte comp, ubyte flags, uint rate, uint length, void *hdr, const char *name);
|
||||
bool SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, uint32_t length, void *hdr, const char *name);
|
||||
bool WriteBlock(ubyte *blk, int size);
|
||||
// read in operations.
|
||||
int Read(ubyte *blk, int size);
|
||||
@ -206,8 +206,8 @@ public:
|
||||
ubyte StreamType() const { return m_type; };
|
||||
ubyte StreamComp() const { return m_comp; };
|
||||
ubyte StreamFormat() const { return m_flags; };
|
||||
uint StreamRate() const { return m_rate; };
|
||||
uint StreamLength() const { return m_length; };
|
||||
uint32_t StreamRate() const { return m_rate; };
|
||||
uint32_t StreamLength() const { return m_length; };
|
||||
const char *StreamName() const { return (const char *)m_name; };
|
||||
// get header info.
|
||||
const void *StreamHeader() const { return (void *)&m_hdr.digi; };
|
||||
|
@ -99,9 +99,9 @@ ushort get_buffer_short(char *buf) {
|
||||
ubyte *ubuf = (ubyte *)buf;
|
||||
return ((ushort)ubuf[1] << 8) | (ushort)ubuf[0];
|
||||
}
|
||||
uint get_buffer_int(char *buf) {
|
||||
uint32_t get_buffer_int(char *buf) {
|
||||
ubyte *ubuf = (ubyte *)buf;
|
||||
return ((uint)ubuf[3] << 24) | ((uint)ubuf[2] << 16) | ((uint)ubuf[1] << 8) | (uint)ubuf[0];
|
||||
return ((uint32_t)ubuf[3] << 24) | ((uint32_t)ubuf[2] << 16) | ((uint32_t)ubuf[1] << 8) | (uint32_t)ubuf[0];
|
||||
}
|
||||
|
||||
ZIP::ZIP() { m_open = false; }
|
||||
|
@ -177,9 +177,9 @@ static struct tAppNodes {
|
||||
// system mouse info.
|
||||
short w32_msewhl_delta = 0; // -val = up, pos val = down, 0 = no change.
|
||||
bool w32_mouseman_hack = false;
|
||||
const uint kWindowStyle_Windowed = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX;
|
||||
const uint kWindowStyle_FullScreen = WS_POPUP | WS_SYSMENU;
|
||||
const uint kWindowStyle_Console = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX;
|
||||
const uint32_t kWindowStyle_Windowed = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX;
|
||||
const uint32_t kWindowStyle_FullScreen = WS_POPUP | WS_SYSMENU;
|
||||
const uint32_t kWindowStyle_Console = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX;
|
||||
|
||||
/* Win32 Application Object
|
||||
This object entails initialization and cleanup of all operating system
|
||||
@ -256,7 +256,7 @@ oeWin32Application::oeWin32Application(const char *name, unsigned flags, HInstan
|
||||
|
||||
if (flags & OEAPP_WINDOWED) {
|
||||
// adjust the window size to take the menu into account
|
||||
uint extendedStyle = (flags & OEAPP_TOPMOST) ? WS_EX_TOPMOST : 0;
|
||||
uint32_t extendedStyle = (flags & OEAPP_TOPMOST) ? WS_EX_TOPMOST : 0;
|
||||
AdjustWindowRectEx(&rect, kWindowStyle_Windowed & ~WS_OVERLAPPED, FALSE, extendedStyle);
|
||||
#ifdef RELEASE
|
||||
cx = CW_USEDEFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user