mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Replace "ubyte" with "uint8_t"
This commit is contained in:
parent
9d3e361a35
commit
26b7776f43
@ -143,7 +143,7 @@ typedef CFILE *FONTFILE;
|
||||
|
||||
static inline int READ_FONT_INT(FONTFILE ffile);
|
||||
static inline short READ_FONT_SHORT(FONTFILE ffile);
|
||||
static inline ubyte READ_FONT_BYTE(FONTFILE ffile);
|
||||
static inline uint8_t READ_FONT_BYTE(FONTFILE ffile);
|
||||
static inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem);
|
||||
static inline FONTFILE OPEN_FONT(char *filename, bool &success);
|
||||
static inline void CLOSE_FONT(FONTFILE ffile);
|
||||
@ -155,12 +155,12 @@ inline int READ_FONT_INT(FONTFILE ffile) { return cf_ReadInt(ffile); }
|
||||
|
||||
inline short READ_FONT_SHORT(FONTFILE ffile) { return cf_ReadShort(ffile); }
|
||||
|
||||
inline ubyte READ_FONT_BYTE(FONTFILE ffile) { return (ubyte)cf_ReadByte(ffile); }
|
||||
inline uint8_t READ_FONT_BYTE(FONTFILE ffile) { return (uint8_t)cf_ReadByte(ffile); }
|
||||
|
||||
inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem) {
|
||||
int i;
|
||||
|
||||
i = cf_ReadBytes((ubyte *)buf, size * nelem, ffile);
|
||||
i = cf_ReadBytes((uint8_t *)buf, size * nelem, ffile);
|
||||
|
||||
ASSERT(i == (size * nelem));
|
||||
|
||||
@ -420,8 +420,8 @@ void grFont::load(char *filename, int slot) {
|
||||
// generate character data pointer table
|
||||
int bytesize = READ_FONT_INT(ff);
|
||||
|
||||
ft->raw_data = (ubyte *)mem_malloc(bytesize);
|
||||
ft->char_data = (ubyte **)mem_malloc(num_char * sizeof(ubyte *));
|
||||
ft->raw_data = (uint8_t *)mem_malloc(bytesize);
|
||||
ft->char_data = (uint8_t **)mem_malloc(num_char * sizeof(uint8_t *));
|
||||
|
||||
READ_FONT_DATA(ff, ft->raw_data, bytesize, 1);
|
||||
|
||||
@ -436,7 +436,7 @@ void grFont::load(char *filename, int slot) {
|
||||
off += (ft->width * ft->height * BITS_TO_BYTES(BPP_16));
|
||||
}
|
||||
} else { // Monochrome
|
||||
ubyte *ptr = ft->raw_data;
|
||||
uint8_t *ptr = ft->raw_data;
|
||||
mprintf((0, "::mono"));
|
||||
for (i = 0; i < num_char; i++) {
|
||||
ft->char_data[i] = ptr;
|
||||
@ -474,18 +474,18 @@ void grFont::translate_to_surfaces(int slot) {
|
||||
// create a 128x128 surface first.
|
||||
// draw each character into surface until we need to create another
|
||||
// surface.
|
||||
ubyte u = 0, v = 0, w;
|
||||
uint8_t u = 0, v = 0, w;
|
||||
int ch, num_ch;
|
||||
ubyte surf_index = 0;
|
||||
uint8_t surf_index = 0;
|
||||
|
||||
num_ch = fntfile->max_ascii - fntfile->min_ascii + 1;
|
||||
|
||||
// initialize memory
|
||||
fnt->ch_w = new ubyte[num_ch];
|
||||
fnt->ch_h = new ubyte[num_ch];
|
||||
fnt->ch_u = new ubyte[num_ch];
|
||||
fnt->ch_v = new ubyte[num_ch];
|
||||
fnt->ch_surf = new ubyte[num_ch];
|
||||
fnt->ch_w = new uint8_t[num_ch];
|
||||
fnt->ch_h = new uint8_t[num_ch];
|
||||
fnt->ch_u = new uint8_t[num_ch];
|
||||
fnt->ch_v = new uint8_t[num_ch];
|
||||
fnt->ch_surf = new uint8_t[num_ch];
|
||||
fnt->ch_uf = new float[num_ch];
|
||||
fnt->ch_vf = new float[num_ch];
|
||||
fnt->ch_wf = new float[num_ch];
|
||||
@ -554,8 +554,8 @@ void grFont::translate_to_surfaces(int slot) {
|
||||
void grFont::translate_mono_char(grSurface *sf, int x, int y, int index, gr_font_file_record *ft, int width) {
|
||||
int row, col; // byte width of char
|
||||
int rowsize;
|
||||
ubyte bit_mask = 0, byte;
|
||||
ubyte *fp;
|
||||
uint8_t bit_mask = 0, byte;
|
||||
uint8_t *fp;
|
||||
|
||||
fp = ft->char_data[index];
|
||||
|
||||
@ -704,9 +704,9 @@ int grFont::get_char_info(int ch, int *width) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ubyte *grFont::get_kern_info(ubyte c1, ubyte c2) {
|
||||
uint8_t *grFont::get_kern_info(uint8_t c1, uint8_t c2) {
|
||||
// gr_font_file_record *ft;
|
||||
// ubyte *p;
|
||||
// uint8_t *p;
|
||||
|
||||
// p = ft->kern_data;
|
||||
// ft = &grFont::m_FontList[m_FontHandle].font;
|
||||
|
@ -288,9 +288,9 @@ void grViewport::draw_text_line_clip(int x, int y, char *str) {
|
||||
|
||||
cur_x = x;
|
||||
for (i = 0; i < (int)strlen(str); i++) {
|
||||
ubyte ch;
|
||||
uint8_t ch;
|
||||
int w;
|
||||
ch = (ubyte)str[i];
|
||||
ch = (uint8_t)str[i];
|
||||
text_Font.get_char_info((int)ch, &w);
|
||||
|
||||
if (ch == GR_COLOR_CHAR) {
|
||||
@ -300,7 +300,7 @@ void grViewport::draw_text_line_clip(int x, int y, char *str) {
|
||||
i += 4;
|
||||
if (i >= (int)strlen(str))
|
||||
Int3(); // This shouldn't happen too.
|
||||
ch = (ubyte)str[i];
|
||||
ch = (uint8_t)str[i];
|
||||
} else if (ch == '\t') { // tab char
|
||||
int space_width;
|
||||
text_Font.get_char_info(' ', &space_width);
|
||||
@ -342,9 +342,9 @@ void grViewport::draw_text_line(int x, int y, char *str) {
|
||||
*/
|
||||
cur_x = x;
|
||||
for (i = 0; i < (int)strlen(str); i++) {
|
||||
ubyte ch;
|
||||
uint8_t ch;
|
||||
|
||||
ch = (ubyte)str[i];
|
||||
ch = (uint8_t)str[i];
|
||||
|
||||
if (ch == GR_COLOR_CHAR) {
|
||||
if ((i + 3) >= (int)strlen(str))
|
||||
@ -353,7 +353,7 @@ void grViewport::draw_text_line(int x, int y, char *str) {
|
||||
i += 4;
|
||||
if (i >= (int)strlen(str))
|
||||
Int3(); // This shouldn't happen too.
|
||||
ch = (ubyte)str[i];
|
||||
ch = (uint8_t)str[i];
|
||||
} else if (ch == '\t') { // tab char
|
||||
int space_width;
|
||||
text_Font.get_char_info(' ', &space_width);
|
||||
|
@ -460,7 +460,7 @@ char *grSurface::lock(int *rowsize) {
|
||||
|
||||
surf_Locked++; // increment lock counter for this surface
|
||||
|
||||
rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (ubyte *)m_OrigDataPtr);
|
||||
rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (uint8_t *)m_OrigDataPtr);
|
||||
|
||||
return m_DataPtr;
|
||||
}
|
||||
@ -507,7 +507,7 @@ char *grSurface::lock(int x, int y, int *rowsize) {
|
||||
|
||||
surf_Locked++; // increment lock counter for this surface
|
||||
|
||||
rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (ubyte *)m_OrigDataPtr);
|
||||
rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (uint8_t *)m_OrigDataPtr);
|
||||
|
||||
return m_DataPtr;
|
||||
}
|
||||
@ -555,7 +555,7 @@ void grSurface::xlat8_16(char *data, int w, int h, char *pal) {
|
||||
int row, col;
|
||||
int rowsize_w;
|
||||
int height, width;
|
||||
ubyte *upal = (ubyte *)pal;
|
||||
uint8_t *upal = (uint8_t *)pal;
|
||||
|
||||
dptr = (ushort *)m_DataPtr;
|
||||
sptr = (char *)data;
|
||||
@ -566,7 +566,7 @@ void grSurface::xlat8_16(char *data, int w, int h, char *pal) {
|
||||
|
||||
for (row = 0; row < height; row++) {
|
||||
for (col = 0; col < width; col++) {
|
||||
ubyte spix = sptr[col];
|
||||
uint8_t spix = sptr[col];
|
||||
if (spix != 0) {
|
||||
int r = upal[spix * 3] >> 3;
|
||||
int g = upal[spix * 3 + 1] >> 2;
|
||||
|
@ -1100,7 +1100,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl
|
||||
gi_fire *attack_info = (gi_fire *)arg_struct;
|
||||
if ((ai_info->animation_type == AS_ALERT) || (ai_info->animation_type == AS_MELEE1 + 1) ||
|
||||
(ai_info->animation_type == AS_MELEE2 + 1)) {
|
||||
ubyte m_num = attack_info->melee_number;
|
||||
uint8_t m_num = attack_info->melee_number;
|
||||
char new_anim;
|
||||
|
||||
if (m_num)
|
||||
@ -1231,7 +1231,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl
|
||||
return goal_index;
|
||||
}
|
||||
|
||||
int GoalAddEnabler(object *obj, int goal_index, ubyte enabler_type, void *arg_struct, float percent, float interval) {
|
||||
int GoalAddEnabler(object *obj, int goal_index, uint8_t enabler_type, void *arg_struct, float percent, float interval) {
|
||||
ai_frame *ai_info = obj->ai_info;
|
||||
goal_enabler *e_info;
|
||||
|
||||
|
@ -114,11 +114,11 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *args, int level = 0, floa
|
||||
int guid = -1, char subtype = 0);
|
||||
|
||||
// Adds a ending condition to a goal
|
||||
int GoalAddDisabler(object *obj, int goal_index, ubyte ender_type, void *args, float percent = 1.0f,
|
||||
int GoalAddDisabler(object *obj, int goal_index, uint8_t ender_type, void *args, float percent = 1.0f,
|
||||
float interval = 0.0f);
|
||||
|
||||
// Adds a enabler condition to a goal
|
||||
int GoalAddEnabler(object *obj, int goal_index, ubyte enabler_type, void *arg_struct, float percent, float interval);
|
||||
int GoalAddEnabler(object *obj, int goal_index, uint8_t enabler_type, void *arg_struct, float percent, float interval);
|
||||
|
||||
// Clears one goal
|
||||
void GoalClearGoal(object *obj, goal *goal_ptr, int notify_reason = AI_INVALID_INDEX);
|
||||
|
@ -169,10 +169,10 @@ extern int AI_debug_robot_index;
|
||||
// Is my buddy in the level? (no if the handle is invalid)
|
||||
extern int Buddy_handle[MAX_PLAYERS];
|
||||
|
||||
bool AINotify(object *obj, ubyte notify_type, void *info = NULL);
|
||||
bool AINotify(object *obj, uint8_t notify_type, void *info = NULL);
|
||||
void AIDoFrame(object *obj);
|
||||
void AIFrameAll(void);
|
||||
bool AIInit(object *obj, ubyte ai_class, ubyte ai_type, ubyte ai_movement);
|
||||
bool AIInit(object *obj, uint8_t ai_class, uint8_t ai_type, uint8_t ai_movement);
|
||||
void AIInitAll(void);
|
||||
void AIPowerSwitch(object *obj, bool f_on);
|
||||
void AITurnTowardsDir(object *obj, /*velocity *new_vel,*/ vector *goal_dir /*, bool remain_level*/, float turn_rate);
|
||||
|
@ -2888,7 +2888,7 @@ void AISeeTarget(object *obj, bool f_see) {
|
||||
}
|
||||
}
|
||||
|
||||
bool AINotify(object *obj, ubyte notify_type, void *info) {
|
||||
bool AINotify(object *obj, uint8_t notify_type, void *info) {
|
||||
int next_anim;
|
||||
ai_frame *ai_info = obj->ai_info;
|
||||
//@$-tD3XEventArgs evtargs;
|
||||
@ -3669,7 +3669,7 @@ void ObjSetAIInfo(object *objp) {
|
||||
dest->biased_flight_max = src->biased_flight_max;
|
||||
}
|
||||
|
||||
bool AIInit(object *obj, ubyte ai_class, ubyte ai_type, ubyte ai_movement) {
|
||||
bool AIInit(object *obj, uint8_t ai_class, uint8_t ai_type, uint8_t ai_movement) {
|
||||
ai_frame *ai_info = obj->ai_info;
|
||||
ASSERT(ai_info);
|
||||
ASSERT(obj->control_type == CT_AI && obj->type != OBJ_NONE);
|
||||
@ -5368,7 +5368,7 @@ void ai_fire(object *obj) {
|
||||
|
||||
obj->dynamic_wb[i].norm_turret_angle[j] = ta[best_dot];
|
||||
|
||||
ubyte last_t_d = obj->dynamic_wb[i].turret_direction[j];
|
||||
uint8_t last_t_d = obj->dynamic_wb[i].turret_direction[j];
|
||||
|
||||
if (dot[WB_MOVE_RIGHT] > dot[WB_MOVE_LEFT])
|
||||
obj->dynamic_wb[i].turret_direction[j] = WB_MOVE_RIGHT;
|
||||
|
@ -141,7 +141,7 @@
|
||||
|
||||
#define BOA_VERSION 25
|
||||
|
||||
static const ubyte bbf_lookup[27] = {(0),
|
||||
static const uint8_t bbf_lookup[27] = {(0),
|
||||
(0x01),
|
||||
(0x02),
|
||||
(0x04),
|
||||
@ -1560,8 +1560,8 @@ void MakeBOAVisTable(bool from_lighting) {
|
||||
int cur_check = BOAGetMineChecksum();
|
||||
int vis_stack[MAX_ROOMS * 10];
|
||||
int stack_count = 0;
|
||||
ubyte already_checked[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS];
|
||||
ubyte precomputed[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS][MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS];
|
||||
uint8_t already_checked[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS];
|
||||
uint8_t precomputed[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS][MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS];
|
||||
|
||||
// Removed this as we have to make a better checksum
|
||||
|
||||
@ -2514,7 +2514,7 @@ void ComputeAABB(bool f_full) {
|
||||
f_part = true;
|
||||
}
|
||||
|
||||
ubyte sector = 0;
|
||||
uint8_t sector = 0;
|
||||
|
||||
if (f_part == false) {
|
||||
if (r_struct_list[i][count] == 0)
|
||||
@ -2934,7 +2934,7 @@ void ComputeAABB(bool f_full) {
|
||||
list[5] = true;
|
||||
}
|
||||
|
||||
ubyte sector = 0;
|
||||
uint8_t sector = 0;
|
||||
|
||||
for (x = 0; x < 6; x++) {
|
||||
if (list[x]) {
|
||||
|
@ -1357,7 +1357,7 @@ void LoadControlConfig(pilot *plt) {
|
||||
int id = Current_pilot.controls[i].id;
|
||||
ct_type type[2];
|
||||
ct_config_data ccfgdata;
|
||||
ubyte flags[2];
|
||||
uint8_t flags[2];
|
||||
|
||||
type[0] = plt->controls[i].type[0];
|
||||
type[1] = plt->controls[i].type[1];
|
||||
@ -1387,7 +1387,7 @@ void SaveControlConfig(pilot *plt) {
|
||||
for (int i = 0; i < NUM_CONTROLLER_FUNCTIONS; i++) {
|
||||
ct_type ctype[2];
|
||||
ct_config_data ccfgdata;
|
||||
ubyte flags[2];
|
||||
uint8_t flags[2];
|
||||
Controller->get_controller_function(Controller_needs[i].id, ctype, &ccfgdata, flags);
|
||||
|
||||
plt->controls[i].id = Controller_needs[i].id;
|
||||
|
@ -473,7 +473,7 @@ void Localize_ctl_bindings() {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding) {
|
||||
const char *cfg_binding_text(ct_type ctype, uint8_t ctrl, uint8_t binding) {
|
||||
const char *str;
|
||||
|
||||
if (ctrl == NULL_CONTROLLER) {
|
||||
@ -511,15 +511,15 @@ const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding) {
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class cfg_element_ui : public newuiMessageBox {
|
||||
ubyte m_element; // element passed and returned.
|
||||
ubyte m_controller; // controller.
|
||||
uint8_t m_element; // element passed and returned.
|
||||
uint8_t m_controller; // controller.
|
||||
int8_t m_alpha; // used for fx.
|
||||
ct_type m_type;
|
||||
|
||||
public:
|
||||
void Create(const char *title, ct_type type, ubyte controller, ubyte element);
|
||||
ubyte GetElement() const { return m_element; };
|
||||
ubyte GetController() const { return m_controller; };
|
||||
void Create(const char *title, ct_type type, uint8_t controller, uint8_t element);
|
||||
uint8_t GetElement() const { return m_element; };
|
||||
uint8_t GetController() const { return m_controller; };
|
||||
ct_type GetType() const { return m_type; };
|
||||
int DoUI();
|
||||
|
||||
@ -537,7 +537,7 @@ UIBitmapItem *cfg_element::m_xbtn_bmp = NULL;
|
||||
short cfg_element::m_count = 0;
|
||||
|
||||
// MTS: unused?
|
||||
bool key_cfg_element(ubyte *element, ubyte *flags);
|
||||
bool key_cfg_element(uint8_t *element, uint8_t *flags);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -597,7 +597,7 @@ void cfg_element::OnDraw() {
|
||||
|
||||
if (m_fnid != -1) {
|
||||
ct_type ctype[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags[CTLBINDS_PER_FUNC];
|
||||
ct_config_data cfgdata;
|
||||
tCfgDataParts cfgparts;
|
||||
|
||||
@ -608,8 +608,8 @@ void cfg_element::OnDraw() {
|
||||
|
||||
for (i = 0; i < N_CFGELEM_SLOTS; i++) {
|
||||
const char *txt;
|
||||
ubyte one_binding = (i == 0) ? cfgparts.bind_0 : cfgparts.bind_1;
|
||||
ubyte one_ctrlbind = (i == 0) ? cfgparts.ctrl_0 : cfgparts.ctrl_1;
|
||||
uint8_t one_binding = (i == 0) ? cfgparts.bind_0 : cfgparts.bind_1;
|
||||
uint8_t one_ctrlbind = (i == 0) ? cfgparts.ctrl_0 : cfgparts.ctrl_1;
|
||||
|
||||
txt = cfg_binding_text(ctype[i], one_ctrlbind, one_binding);
|
||||
|
||||
@ -654,7 +654,7 @@ void cfg_element::OnKeyDown(int key) {
|
||||
// clear binding.
|
||||
tCfgDataParts cfgparts;
|
||||
ct_type ctype_fn[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
ct_config_data ccfgdata_fn;
|
||||
|
||||
Controller->get_controller_function(m_fnid, ctype_fn, &ccfgdata_fn, cfgflags_fn);
|
||||
@ -759,13 +759,13 @@ void cfg_element::OnDestroy() {
|
||||
}
|
||||
|
||||
// calls configuration routines
|
||||
bool cfg_element::Configure(ct_type *new_elem_type, ubyte *controller, ubyte *new_cfg_element, int8_t *cfg_slot) {
|
||||
bool cfg_element::Configure(ct_type *new_elem_type, uint8_t *controller, uint8_t *new_cfg_element, int8_t *cfg_slot) {
|
||||
cfg_element_ui cfg_box;
|
||||
ct_type ctype_fn[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
ct_config_data ccfgdata_fn;
|
||||
tCfgDataParts cfgparts;
|
||||
ubyte element, ctrl;
|
||||
uint8_t element, ctrl;
|
||||
bool configure = false;
|
||||
|
||||
int8_t fnid = m_fnid;
|
||||
@ -844,13 +844,13 @@ bool cfg_element::Configure(ct_type *new_elem_type, ubyte *controller, ubyte *ne
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
bool key_cfg_element(ubyte *element, ubyte *flags) {
|
||||
bool key_cfg_element(uint8_t *element, uint8_t *flags) {
|
||||
// put up configuration dialog
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void cfg_element_ui::Create(const char *title, ct_type type, ubyte controller, ubyte element) {
|
||||
void cfg_element_ui::Create(const char *title, ct_type type, uint8_t controller, uint8_t element) {
|
||||
m_controller = controller;
|
||||
m_element = element;
|
||||
m_type = type;
|
||||
@ -1039,7 +1039,7 @@ int cfg_element_ui::DoUI() {
|
||||
}
|
||||
|
||||
void cfg_element_ui::OnDraw() {
|
||||
UITextItem prompt(MONITOR9_NEWUI_FONT, "?", NEWUI_MONITORFONT_COLOR, (ubyte)(m_alpha * 8) + 127);
|
||||
UITextItem prompt(MONITOR9_NEWUI_FONT, "?", NEWUI_MONITORFONT_COLOR, (uint8_t)(m_alpha * 8) + 127);
|
||||
|
||||
newuiMessageBox::OnDraw();
|
||||
|
||||
|
@ -95,13 +95,13 @@ class cfg_element : public UIGadget {
|
||||
const char *m_title;
|
||||
int8_t m_fnid, m_flags; // fnflags : 1 if invert btn visible
|
||||
int8_t m_slot, m_curslot; // what slow is in focus and number of slots.
|
||||
ubyte m_slot_alpha;
|
||||
uint8_t m_slot_alpha;
|
||||
int8_t m_blink_state;
|
||||
|
||||
public:
|
||||
void Create(UIWindow *wnd, int str_i, int x, int y, int fnid, int id);
|
||||
int8_t GetActiveSlot() const { return m_slot; };
|
||||
bool Configure(ct_type *elem_type, ubyte *controller, ubyte *new_elem,
|
||||
bool Configure(ct_type *elem_type, uint8_t *controller, uint8_t *new_elem,
|
||||
int8_t *slot); // calls configuration routines (returns true if approved)
|
||||
|
||||
protected:
|
||||
@ -116,7 +116,7 @@ protected:
|
||||
};
|
||||
|
||||
typedef struct tCfgDataParts {
|
||||
ubyte bind_0, bind_1, ctrl_0, ctrl_1;
|
||||
uint8_t bind_0, bind_1, ctrl_0, ctrl_1;
|
||||
} tCfgDataParts;
|
||||
|
||||
static inline void parse_config_data(tCfgDataParts *parts, ct_type type0, ct_type type1, ct_config_data cfgdata) {
|
||||
@ -165,6 +165,6 @@ static inline ct_config_data unify_config_data(tCfgDataParts *parts) {
|
||||
CONTROLLER_CTL_VALUE(parts->bind_0, parts->bind_1));
|
||||
}
|
||||
|
||||
extern const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding);
|
||||
extern const char *cfg_binding_text(ct_type ctype, uint8_t ctrl, uint8_t binding);
|
||||
|
||||
#endif
|
||||
|
@ -94,14 +94,14 @@ typedef struct {
|
||||
// The exported DLL function call prototypes
|
||||
#if defined(__LINUX__)
|
||||
typedef void DLLFUNCCALL (*DLLGameCall_fp)(int eventnum, dllinfo *data);
|
||||
typedef void DLLFUNCCALL (*DLLGameInit_fp)(int *api_func, ubyte *all_ok, int num_teams_to_use);
|
||||
typedef void DLLFUNCCALL (*DLLGameInit_fp)(int *api_func, uint8_t *all_ok, int num_teams_to_use);
|
||||
typedef void DLLFUNCCALL (*DLLGameClose_fp)();
|
||||
typedef void DLLFUNCCALL (*DLLGameGetName_fp)(char *buffer, int maxsize);
|
||||
typedef void DLLFUNCCALL (*DLLGameGetDesc_fp)(char **buffer, int maxsize, int lines);
|
||||
typedef void DLLFUNCCALL (*DLLGetGameInfo_fp)(tDLLOptions *options);
|
||||
#else
|
||||
typedef void(DLLFUNCCALL *DLLGameCall_fp)(int eventnum, dllinfo *data);
|
||||
typedef void(DLLFUNCCALL *DLLGameInit_fp)(int *api_func, ubyte *all_ok, int num_teams_to_use);
|
||||
typedef void(DLLFUNCCALL *DLLGameInit_fp)(int *api_func, uint8_t *all_ok, int num_teams_to_use);
|
||||
typedef void(DLLFUNCCALL *DLLGameClose_fp)();
|
||||
typedef void(DLLFUNCCALL *DLLGameGetName_fp)(char *buffer, int maxsize);
|
||||
typedef void(DLLFUNCCALL *DLLGameGetDesc_fp)(char **buffer, int maxsize, int lines);
|
||||
@ -703,7 +703,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) {
|
||||
first = 0;
|
||||
}
|
||||
void *api_fp;
|
||||
ubyte ok = 1;
|
||||
uint8_t ok = 1;
|
||||
api_fp = (void *)GetGameAPI;
|
||||
|
||||
DLLGameInit((int *)api_fp, &ok, num_teams_to_use);
|
||||
@ -738,7 +738,7 @@ void CallGameDLL(int eventnum, dllinfo *data) {
|
||||
// Call this function right after a player connects to the game to see if a player is banned
|
||||
bool GameDLLIsAddressBanned(network_address *addr, const char *tracker_id) {
|
||||
ASSERT(addr);
|
||||
DLLInfo.special_data = (ubyte *)addr;
|
||||
DLLInfo.special_data = (uint8_t *)addr;
|
||||
// This used to be tracker_id, but storing a pointer as an int is a problem in 64 bit
|
||||
// and no code ever was populating the tracker id that I know of. -Kevin
|
||||
DLLInfo.iParam = 0;
|
||||
|
@ -153,12 +153,12 @@
|
||||
#define CHEATSPOT 14
|
||||
bool IsCheater = false;
|
||||
bool Display_renderer_stats = false;
|
||||
ubyte Outline_release_mode = 0;
|
||||
uint8_t Outline_release_mode = 0;
|
||||
|
||||
char CheatBuffer[] = "AAAAAAAAAAAAAAA";
|
||||
char OldCheatBuffer[] = "AAAAAAAAAAAAAAA";
|
||||
extern bool Force_one_texture;
|
||||
extern ubyte AutomapVisMap[MAX_ROOMS];
|
||||
extern uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
|
||||
const char *LamerCheats[] = {
|
||||
"?E9FI=()", // gabbagabbahey
|
||||
@ -406,7 +406,7 @@ void DemoCheats(int key) {
|
||||
|
||||
static int state = 0;
|
||||
if (!(memcmp(cryptstring, OutlineModeCheat, 8))) {
|
||||
ubyte new_mode;
|
||||
uint8_t new_mode;
|
||||
char buffer[128];
|
||||
switch (state) {
|
||||
case 0:
|
||||
@ -638,7 +638,7 @@ void DemoCheats(int key) {
|
||||
|
||||
if (!(memcmp(cryptstring, SuicideCheat, 8))) {
|
||||
//"ZOD Strikes Revenge"
|
||||
static ubyte buffer[20] = {0x80, 0x95, 0x9E, 0xFA, 0x89, 0xAE, 0xA8, 0xB3, 0xB1, 0xBF,
|
||||
static uint8_t buffer[20] = {0x80, 0x95, 0x9E, 0xFA, 0x89, 0xAE, 0xA8, 0xB3, 0xB1, 0xBF,
|
||||
0xA9, 0xFA, 0x88, 0xBF, 0xAC, 0xBF, 0xB4, 0xBD, 0xBF, 0xDA};
|
||||
char tb[20];
|
||||
|
||||
|
@ -1331,7 +1331,7 @@ void ProcessNormalKey(int key) {
|
||||
// decode the text macro by sending it off to the DLL
|
||||
// for processesing
|
||||
DLLInfo.input_string = Current_pilot.taunts[index];
|
||||
DLLInfo.special_data = (ubyte *)HudInputMessage;
|
||||
DLLInfo.special_data = (uint8_t *)HudInputMessage;
|
||||
DLLInfo.iParam = MAX_HUD_INPUT_LEN;
|
||||
CallGameDLL(EVT_CLIENT_DECODETEXTMACRO, &DLLInfo);
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ void WriteAllDoorways(CFILE *ofile);
|
||||
typedef struct {
|
||||
int type, id;
|
||||
const char *name;
|
||||
ubyte flag;
|
||||
uint8_t flag;
|
||||
} tConvertObject;
|
||||
|
||||
tConvertObject object_convert[] = {
|
||||
@ -1581,7 +1581,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) {
|
||||
if (fileversion >= 34)
|
||||
id = cf_ReadShort(ifile);
|
||||
else
|
||||
id = (ubyte)cf_ReadByte(ifile);
|
||||
id = (uint8_t)cf_ReadByte(ifile);
|
||||
|
||||
// Translate id
|
||||
old_id = id;
|
||||
@ -1730,7 +1730,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) {
|
||||
i = cf_ReadByte(ifile);
|
||||
if (i > 0) {
|
||||
objp->custom_default_script_name = (char *)mem_malloc(i + 1);
|
||||
cf_ReadBytes((ubyte *)objp->custom_default_script_name, i, ifile);
|
||||
cf_ReadBytes((uint8_t *)objp->custom_default_script_name, i, ifile);
|
||||
objp->custom_default_script_name[i] = '\0';
|
||||
} else {
|
||||
objp->custom_default_script_name = NULL;
|
||||
@ -1739,7 +1739,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) {
|
||||
i = cf_ReadByte(ifile);
|
||||
if (i > 0) {
|
||||
objp->custom_default_module_name = (char *)mem_malloc(i + 1);
|
||||
cf_ReadBytes((ubyte *)objp->custom_default_module_name, i, ifile);
|
||||
cf_ReadBytes((uint8_t *)objp->custom_default_module_name, i, ifile);
|
||||
objp->custom_default_module_name[i] = '\0';
|
||||
} else {
|
||||
objp->custom_default_module_name = NULL;
|
||||
@ -2032,7 +2032,7 @@ int ReadFace(CFILE *ifile, face *fp, int version) {
|
||||
// Check to see if there is a lightmap
|
||||
if ((fp->flags & FF_LIGHTMAP) && (version >= 19)) {
|
||||
if (version <= 29) {
|
||||
ubyte w, h;
|
||||
uint8_t w, h;
|
||||
|
||||
w = cf_ReadByte(ifile);
|
||||
h = cf_ReadByte(ifile);
|
||||
@ -2102,7 +2102,7 @@ int ReadFace(CFILE *ifile, face *fp, int version) {
|
||||
fp->light_multiple = 4;
|
||||
|
||||
if (version >= 71) {
|
||||
ubyte special = cf_ReadByte(ifile);
|
||||
uint8_t special = cf_ReadByte(ifile);
|
||||
if (special) {
|
||||
if (version < 77) // Ignore old specular data
|
||||
{
|
||||
@ -2113,10 +2113,10 @@ int ReadFace(CFILE *ifile, face *fp, int version) {
|
||||
} else {
|
||||
vector center;
|
||||
|
||||
ubyte smooth = 0;
|
||||
ubyte num_smooth_verts = 0;
|
||||
ubyte type = cf_ReadByte(ifile);
|
||||
ubyte num = cf_ReadByte(ifile);
|
||||
uint8_t smooth = 0;
|
||||
uint8_t num_smooth_verts = 0;
|
||||
uint8_t type = cf_ReadByte(ifile);
|
||||
uint8_t num = cf_ReadByte(ifile);
|
||||
|
||||
if (version >= 117) {
|
||||
// Read if smoothed
|
||||
@ -2224,7 +2224,7 @@ void RemoveDegenerateFaces(room *rp) {
|
||||
#define COMPRESS 1
|
||||
|
||||
// Does a RLE compression run of the values given the byte array 'val'.
|
||||
int WriteCompressionByte(CFILE *fp, ubyte *val, int total, int just_count, int compress) {
|
||||
int WriteCompressionByte(CFILE *fp, uint8_t *val, int total, int just_count, int compress) {
|
||||
int done = 0;
|
||||
int written = 0;
|
||||
int curptr = 0;
|
||||
@ -2254,8 +2254,8 @@ int WriteCompressionByte(CFILE *fp, ubyte *val, int total, int just_count, int c
|
||||
|
||||
ASSERT(curptr < total);
|
||||
|
||||
ubyte curval = val[curptr];
|
||||
ubyte count = 1;
|
||||
uint8_t curval = val[curptr];
|
||||
uint8_t count = 1;
|
||||
|
||||
while ((curptr + count) < total && val[curptr + count] == curval && count < 250)
|
||||
count++;
|
||||
@ -2315,7 +2315,7 @@ int WriteCompressionShort(CFILE *fp, ushort *val, int total, int just_count, int
|
||||
ASSERT(curptr < total);
|
||||
|
||||
ushort curval = val[curptr];
|
||||
ubyte count = 1;
|
||||
uint8_t count = 1;
|
||||
|
||||
while ((curptr + count) < total && val[curptr + count] == curval && count < 250)
|
||||
count++;
|
||||
@ -2343,7 +2343,7 @@ int WriteCompressionShort(CFILE *fp, ushort *val, int total, int just_count, int
|
||||
|
||||
// Given an array of values, checks to see if it would be better to write it out
|
||||
// as a raw array or RLE array
|
||||
void CheckToWriteCompressByte(CFILE *fp, ubyte *vals, int total) {
|
||||
void CheckToWriteCompressByte(CFILE *fp, uint8_t *vals, int total) {
|
||||
int count = WriteCompressionByte(fp, vals, total, 1, COMPRESS);
|
||||
|
||||
if (count >= total)
|
||||
@ -2363,9 +2363,9 @@ void CheckToWriteCompressShort(CFILE *fp, ushort *vals, int total) {
|
||||
WriteCompressionShort(fp, vals, total, 0, COMPRESS);
|
||||
}
|
||||
|
||||
void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) {
|
||||
void ReadCompressionByte(CFILE *fp, uint8_t *vals, int total) {
|
||||
int count = 0;
|
||||
ubyte compressed = cf_ReadByte(fp);
|
||||
uint8_t compressed = cf_ReadByte(fp);
|
||||
|
||||
if (compressed == 0) {
|
||||
for (int i = 0; i < total; i++)
|
||||
@ -2376,17 +2376,17 @@ void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) {
|
||||
|
||||
while (count != total) {
|
||||
ASSERT(count < total);
|
||||
ubyte command = cf_ReadByte(fp);
|
||||
uint8_t command = cf_ReadByte(fp);
|
||||
|
||||
if (command == 0) // next byte is raw
|
||||
{
|
||||
ubyte height = cf_ReadByte(fp);
|
||||
uint8_t height = cf_ReadByte(fp);
|
||||
|
||||
vals[count] = height;
|
||||
count++;
|
||||
} else if (command >= 2 && command <= 250) // next pixel is run of pixels
|
||||
{
|
||||
ubyte height = cf_ReadByte(fp);
|
||||
uint8_t height = cf_ReadByte(fp);
|
||||
for (int k = 0; k < command; k++) {
|
||||
vals[count] = height;
|
||||
count++;
|
||||
@ -2399,7 +2399,7 @@ void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) {
|
||||
void ReadCompressionShort(CFILE *fp, ushort *vals, int total) {
|
||||
int count = 0;
|
||||
|
||||
ubyte compressed = cf_ReadByte(fp);
|
||||
uint8_t compressed = cf_ReadByte(fp);
|
||||
|
||||
if (compressed == 0) {
|
||||
for (int i = 0; i < total; i++)
|
||||
@ -2410,7 +2410,7 @@ void ReadCompressionShort(CFILE *fp, ushort *vals, int total) {
|
||||
|
||||
while (count != total) {
|
||||
ASSERT(count < total);
|
||||
ubyte command = cf_ReadByte(fp);
|
||||
uint8_t command = cf_ReadByte(fp);
|
||||
|
||||
if (command == 0) // next byte is raw
|
||||
{
|
||||
@ -2576,7 +2576,7 @@ int ReadRoom(CFILE *ifile, room *rp, int version) {
|
||||
|
||||
if (size) {
|
||||
|
||||
rp->volume_lights = (ubyte *)mem_malloc(size);
|
||||
rp->volume_lights = (uint8_t *)mem_malloc(size);
|
||||
ASSERT(rp->volume_lights); // ran out of memory!
|
||||
} else
|
||||
rp->volume_lights = NULL;
|
||||
@ -2606,7 +2606,7 @@ int ReadRoom(CFILE *ifile, room *rp, int version) {
|
||||
rp->ambient_sound = -1;
|
||||
|
||||
// read reverb value for room.
|
||||
rp->env_reverb = (version >= 98) ? ((ubyte)cf_ReadByte(ifile)) : 0;
|
||||
rp->env_reverb = (version >= 98) ? ((uint8_t)cf_ReadByte(ifile)) : 0;
|
||||
|
||||
// Read damage
|
||||
if (version >= 108) {
|
||||
@ -2702,7 +2702,7 @@ void ReadNewLightmapChunk(CFILE *fp, int version) {
|
||||
|
||||
for (i = 0; i < nummaps; i++) {
|
||||
int w, h, lmi;
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
if (nummaps >= 50) {
|
||||
if ((i % (nummaps / 50)) == 0) {
|
||||
LoadLevelProgress(LOAD_PROGRESS_LOADING_LEVEL,
|
||||
@ -2784,7 +2784,7 @@ void ReadLightmapChunk(CFILE *fp, int version) {
|
||||
CHUNK_LIGHTMAPS);
|
||||
}
|
||||
int w, h, lmi;
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
|
||||
w = cf_ReadInt(fp);
|
||||
h = cf_ReadInt(fp);
|
||||
@ -2882,7 +2882,7 @@ void ReadTerrainHeightChunk(CFILE *fp, int version) {
|
||||
for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++)
|
||||
Terrain_seg[i].ypos = cf_ReadByte(fp);
|
||||
} else {
|
||||
ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
ReadCompressionByte(fp, byte_vals, TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
|
||||
for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) {
|
||||
@ -3324,7 +3324,7 @@ void ReadTerrainSkyAndLightChunk(CFILE *fp, int version) {
|
||||
Terrain_dynamic_table[i] = cf_ReadByte(fp);
|
||||
}
|
||||
} else {
|
||||
ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
|
||||
ReadCompressionByte(fp, byte_vals, TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++)
|
||||
@ -3388,7 +3388,7 @@ void ReadTerrainTmapFlagChunk(CFILE *fp, int version) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
ushort *short_vals = (ushort *)mem_malloc(2 * TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
|
||||
if (version < 102) {
|
||||
@ -3443,7 +3443,7 @@ void ReadTerrainChunks(CFILE *fp, int version) {
|
||||
ResetTerrain();
|
||||
|
||||
while (!done) {
|
||||
cf_ReadBytes((ubyte *)chunk_name, 4, fp);
|
||||
cf_ReadBytes((uint8_t *)chunk_name, 4, fp);
|
||||
terr_chunk_start = cftell(fp);
|
||||
terr_chunk_size = cf_ReadInt(fp);
|
||||
|
||||
@ -3493,7 +3493,7 @@ void ReadPlayerStarts(CFILE *infile, int fileversion) {
|
||||
void VerifyObjectList() {
|
||||
int i;
|
||||
|
||||
ubyte already_listed[MAX_OBJECTS];
|
||||
uint8_t already_listed[MAX_OBJECTS];
|
||||
memset(already_listed, 0, MAX_OBJECTS);
|
||||
|
||||
for (i = 0; i <= Highest_room_index; i++) {
|
||||
@ -3619,7 +3619,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) {
|
||||
filelen = cfilelength(ifile);
|
||||
|
||||
// Read & check tag
|
||||
cf_ReadBytes((ubyte *)tag, 4, ifile);
|
||||
cf_ReadBytes((uint8_t *)tag, 4, ifile);
|
||||
if (strncmp(tag, LEVEL_FILE_TAG, 4)) {
|
||||
cfclose(ifile);
|
||||
retval = 0;
|
||||
@ -3718,7 +3718,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) {
|
||||
while (!cfeof(ifile)) {
|
||||
char chunk_name[4];
|
||||
|
||||
cf_ReadBytes((ubyte *)chunk_name, 4, ifile);
|
||||
cf_ReadBytes((uint8_t *)chunk_name, 4, ifile);
|
||||
chunk_start = cftell(ifile);
|
||||
chunk_size = cf_ReadInt(ifile);
|
||||
mprintf(
|
||||
@ -3779,7 +3779,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) {
|
||||
} else if (ISCHUNK(CHUNK_OBJECT_HANDLES)) { // Read in any non-zero handles for deleted objects
|
||||
int handle, objnum;
|
||||
|
||||
ubyte already_loaded[MAX_OBJECTS];
|
||||
uint8_t already_loaded[MAX_OBJECTS];
|
||||
memset(already_loaded, 0, MAX_OBJECTS);
|
||||
|
||||
// Get the number of handles in the file
|
||||
@ -3910,7 +3910,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) {
|
||||
strcat(path, name);
|
||||
strcat(path, ".scr");
|
||||
CFILE *ofile = cfopen(path, "wb");
|
||||
ubyte buf[1000];
|
||||
uint8_t buf[1000];
|
||||
int n = chunk_size, r;
|
||||
while (n) {
|
||||
r = cf_ReadBytes(buf, std::min(n, sizeof(buf)), ifile);
|
||||
@ -4077,8 +4077,8 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) {
|
||||
// share 1 lightmap
|
||||
|
||||
if (version >= 34 && !Dedicated_server) {
|
||||
ubyte *lightmap_spoken_for = (ubyte *)mem_malloc(MAX_LIGHTMAPS);
|
||||
ubyte *free_lightmap_info = (ubyte *)mem_malloc(MAX_LIGHTMAP_INFOS);
|
||||
uint8_t *lightmap_spoken_for = (uint8_t *)mem_malloc(MAX_LIGHTMAPS);
|
||||
uint8_t *free_lightmap_info = (uint8_t *)mem_malloc(MAX_LIGHTMAP_INFOS);
|
||||
ASSERT(lightmap_spoken_for);
|
||||
memset(lightmap_spoken_for, 0, MAX_LIGHTMAPS);
|
||||
|
||||
@ -4212,12 +4212,12 @@ int WriteObject(CFILE *ofile, object *objp) {
|
||||
i = (objp->custom_default_script_name) ? strlen(objp->custom_default_script_name) : 0;
|
||||
cf_WriteByte(ofile, i);
|
||||
if (i > 0)
|
||||
cf_WriteBytes((ubyte *)objp->custom_default_script_name, i, ofile);
|
||||
cf_WriteBytes((uint8_t *)objp->custom_default_script_name, i, ofile);
|
||||
|
||||
i = (objp->custom_default_module_name) ? strlen(objp->custom_default_module_name) : 0;
|
||||
cf_WriteByte(ofile, i);
|
||||
if (i > 0)
|
||||
cf_WriteBytes((ubyte *)objp->custom_default_module_name, i, ofile);
|
||||
cf_WriteBytes((uint8_t *)objp->custom_default_module_name, i, ofile);
|
||||
|
||||
// If there is lightmap data for this object, write it out.
|
||||
if (objp->lighting_render_type == LRT_LIGHTMAPS) {
|
||||
@ -4322,7 +4322,7 @@ int WriteFace(CFILE *ofile, face *fp) {
|
||||
|
||||
if (fp->special_handle != BAD_SPECIAL_FACE_INDEX) {
|
||||
// Write out special face stuff
|
||||
ubyte smooth = 0;
|
||||
uint8_t smooth = 0;
|
||||
cf_WriteByte(ofile, 1);
|
||||
cf_WriteByte(ofile, SpecialFaces[fp->special_handle].type);
|
||||
cf_WriteByte(ofile, 4);
|
||||
@ -4458,7 +4458,7 @@ int WriteRoom(CFILE *ofile, room *rp) {
|
||||
int StartChunk(CFILE *ofile, char *chunk_name) {
|
||||
int chunk_start_pos;
|
||||
|
||||
cf_WriteBytes((ubyte *)chunk_name, 4, ofile);
|
||||
cf_WriteBytes((uint8_t *)chunk_name, 4, ofile);
|
||||
chunk_start_pos = cftell(ofile);
|
||||
cf_WriteInt(ofile, 0); // placeholder for chunk len
|
||||
|
||||
@ -4487,7 +4487,7 @@ void EndChunk(CFILE *ofile, int chunk_start_pos) {
|
||||
|
||||
void WriteTerrainHeightChunk(CFILE *fp) {
|
||||
int i;
|
||||
ubyte heightvals[TERRAIN_WIDTH * TERRAIN_DEPTH];
|
||||
uint8_t heightvals[TERRAIN_WIDTH * TERRAIN_DEPTH];
|
||||
|
||||
int start_pos;
|
||||
start_pos = StartChunk(fp, CHUNK_TERRAIN_HEIGHT);
|
||||
@ -4795,7 +4795,7 @@ void WriteTerrainSkyAndLightChunk(CFILE *fp) {
|
||||
}
|
||||
|
||||
// Write lighting
|
||||
ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
|
||||
// l
|
||||
for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++)
|
||||
@ -4840,7 +4840,7 @@ void WriteTerrainSkyAndLightChunk(CFILE *fp) {
|
||||
void WriteTerrainTmapChunk(CFILE *fp) {
|
||||
int i;
|
||||
|
||||
ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
ushort *short_vals = (ushort *)mem_malloc(2 * TERRAIN_DEPTH * TERRAIN_WIDTH);
|
||||
|
||||
int start_pos;
|
||||
@ -4884,7 +4884,7 @@ void WriteLightmapChunk(CFILE *fp) {
|
||||
int lightmap_count = 0;
|
||||
|
||||
ushort *lightmap_remap = (ushort *)mem_malloc(MAX_LIGHTMAPS * sizeof(ushort));
|
||||
ubyte *lightmap_spoken_for = (ubyte *)mem_malloc(MAX_LIGHTMAPS);
|
||||
uint8_t *lightmap_spoken_for = (uint8_t *)mem_malloc(MAX_LIGHTMAPS);
|
||||
|
||||
ASSERT(lightmap_remap);
|
||||
ASSERT(lightmap_spoken_for);
|
||||
@ -5055,7 +5055,7 @@ int SaveLevel(char *filename, bool f_save_room_AABB) {
|
||||
try { // catch cfile errors
|
||||
|
||||
// Write tag & version number
|
||||
cf_WriteBytes((ubyte *)LEVEL_FILE_TAG, 4, ofile);
|
||||
cf_WriteBytes((uint8_t *)LEVEL_FILE_TAG, 4, ofile);
|
||||
cf_WriteInt(ofile, LEVEL_FILE_VERSION);
|
||||
|
||||
WriteGamePathsChunk(ofile);
|
||||
@ -5318,9 +5318,9 @@ int need_to_page_in = 0;
|
||||
int need_to_page_num = 0;
|
||||
void AlmostPageInGeneric(int id);
|
||||
|
||||
ubyte texture_counted[MAX_BITMAPS];
|
||||
ubyte sound_counted[MAX_SOUNDS];
|
||||
ubyte poly_counted[MAX_POLY_MODELS];
|
||||
uint8_t texture_counted[MAX_BITMAPS];
|
||||
uint8_t sound_counted[MAX_SOUNDS];
|
||||
uint8_t poly_counted[MAX_POLY_MODELS];
|
||||
|
||||
void AlmostPageInLevelTexture(int id) {
|
||||
if (id == -1 || id == 0)
|
||||
|
@ -225,9 +225,9 @@ typedef struct tLevelNode {
|
||||
char *progress; // File name containing the progress background screen
|
||||
|
||||
// level branching
|
||||
ubyte lvlbranch0, lvlbranch1; // FORK or BRANCH command
|
||||
ubyte secretlvl; // SECRET command
|
||||
ubyte pad;
|
||||
uint8_t lvlbranch0, lvlbranch1; // FORK or BRANCH command
|
||||
uint8_t secretlvl; // SECRET command
|
||||
uint8_t pad;
|
||||
} tLevelNode;
|
||||
|
||||
// predefine mission state flags
|
||||
|
@ -441,23 +441,23 @@ bool Show_osiris_debug = false;
|
||||
#if defined(__LINUX__)
|
||||
typedef char DLLFUNCCALL (*InitializeDLL_fp)(tOSIRISModuleInit *function_list);
|
||||
typedef void DLLFUNCCALL (*ShutdownDLL_fp)(void);
|
||||
typedef int DLLFUNCCALL (*GetGOScriptID_fp)(const char *name, ubyte isdoor);
|
||||
typedef int DLLFUNCCALL (*GetGOScriptID_fp)(const char *name, uint8_t isdoor);
|
||||
typedef void DLLFUNCCALL *(*CreateInstance_fp)(int id);
|
||||
typedef void DLLFUNCCALL (*DestroyInstance_fp)(int id, void *ptr);
|
||||
typedef short DLLFUNCCALL (*CallInstanceEvent_fp)(int id, void *ptr, int event, tOSIRISEventInfo *data);
|
||||
typedef int DLLFUNCCALL (*GetTriggerScriptID_fp)(int trigger_room, int trigger_face);
|
||||
typedef int DLLFUNCCALL (*GetCOScriptList_fp)(int **list, int **id_list);
|
||||
typedef int DLLFUNCCALL (*SaveRestoreState_fp)(void *file_ptr, ubyte saving_state);
|
||||
typedef int DLLFUNCCALL (*SaveRestoreState_fp)(void *file_ptr, uint8_t saving_state);
|
||||
#else
|
||||
typedef char(DLLFUNCCALL *InitializeDLL_fp)(tOSIRISModuleInit *function_list);
|
||||
typedef void(DLLFUNCCALL *ShutdownDLL_fp)(void);
|
||||
typedef int(DLLFUNCCALL *GetGOScriptID_fp)(const char *name, ubyte isdoor);
|
||||
typedef int(DLLFUNCCALL *GetGOScriptID_fp)(const char *name, uint8_t isdoor);
|
||||
typedef void *(DLLFUNCCALL *CreateInstance_fp)(int id);
|
||||
typedef void(DLLFUNCCALL *DestroyInstance_fp)(int id, void *ptr);
|
||||
typedef short(DLLFUNCCALL *CallInstanceEvent_fp)(int id, void *ptr, int event, tOSIRISEventInfo *data);
|
||||
typedef int(DLLFUNCCALL *GetTriggerScriptID_fp)(int trigger_room, int trigger_face);
|
||||
typedef int(DLLFUNCCALL *GetCOScriptList_fp)(int **list, int **id_list);
|
||||
typedef int(DLLFUNCCALL *SaveRestoreState_fp)(void *file_ptr, ubyte saving_state);
|
||||
typedef int(DLLFUNCCALL *SaveRestoreState_fp)(void *file_ptr, uint8_t saving_state);
|
||||
#endif
|
||||
|
||||
typedef struct tRefObj {
|
||||
@ -468,8 +468,8 @@ typedef struct tRefObj {
|
||||
} tRefObj;
|
||||
|
||||
typedef struct {
|
||||
ubyte flags;
|
||||
ubyte extracted_id;
|
||||
uint8_t flags;
|
||||
uint8_t extracted_id;
|
||||
ushort reference_count;
|
||||
InitializeDLL_fp InitializeDLL;
|
||||
ShutdownDLL_fp ShutdownDLL;
|
||||
@ -508,7 +508,7 @@ struct {
|
||||
#define OESF_USED 0x0001
|
||||
#define OESF_MISSION 0x0002 // mission dlls
|
||||
typedef struct {
|
||||
ubyte flags;
|
||||
uint8_t flags;
|
||||
char *temp_filename;
|
||||
char *real_filename;
|
||||
} tExtractedScriptInfo;
|
||||
@ -545,7 +545,7 @@ static void Osiris_ForceUnloadModules(void);
|
||||
|
||||
uint32_t Osiris_game_checksum;
|
||||
|
||||
static ubyte Osiris_event_mask = OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS;
|
||||
static uint8_t Osiris_event_mask = OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS;
|
||||
static bool Osiris_create_events_disabled = false;
|
||||
static bool Osiris_level_script_loaded = false;
|
||||
|
||||
@ -2075,12 +2075,12 @@ bool Osiris_CallTriggerEvent(int trignum, int event, tOSIRISEventInfo *ei) {
|
||||
// Osiris_EnableEvents
|
||||
// Purpose:
|
||||
// Enables the passed in mask of event types to be called
|
||||
void Osiris_EnableEvents(ubyte mask) { Osiris_event_mask |= mask; }
|
||||
void Osiris_EnableEvents(uint8_t mask) { Osiris_event_mask |= mask; }
|
||||
|
||||
// Osiris_DisableEvents
|
||||
// Purpose:
|
||||
// Disables the passed in mask of event types
|
||||
void Osiris_DisableEvents(ubyte mask) { Osiris_event_mask &= ~mask; }
|
||||
void Osiris_DisableEvents(uint8_t mask) { Osiris_event_mask &= ~mask; }
|
||||
|
||||
// Osiris_DisableCreateEvents
|
||||
// Purpose:
|
||||
@ -2534,7 +2534,7 @@ void Osiris_CancelTimerID(int id) {
|
||||
// Osiris_TimerExists
|
||||
// Purpose:
|
||||
// Returns true if the timer is valid
|
||||
ubyte Osiris_TimerExists(int handle) {
|
||||
uint8_t Osiris_TimerExists(int handle) {
|
||||
int id = GET_SLOT(handle);
|
||||
|
||||
if (id < 0 || id >= MAX_OSIRIS_TIMERS)
|
||||
@ -2636,7 +2636,7 @@ void Osiris_SaveSystemState(CFILE *file) {
|
||||
// get the length of the module name
|
||||
int module_name_length = strlen(OSIRIS_loaded_modules[i].module_name) + 1;
|
||||
cf_WriteByte(file, module_name_length);
|
||||
cf_WriteBytes((ubyte *)OSIRIS_loaded_modules[i].module_name, module_name_length, file);
|
||||
cf_WriteBytes((uint8_t *)OSIRIS_loaded_modules[i].module_name, module_name_length, file);
|
||||
|
||||
// now here is the tricky part, save the current fileposition, write a dummy 0 int
|
||||
int saved_file_pos = cftell(file);
|
||||
@ -2696,7 +2696,7 @@ bool Osiris_RestoreSystemState(CFILE *file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ubyte version = (ubyte)cf_ReadByte(file);
|
||||
uint8_t version = (uint8_t)cf_ReadByte(file);
|
||||
|
||||
num_bytes_to_be_restored = cf_ReadInt(file);
|
||||
|
||||
@ -2765,7 +2765,7 @@ bool Osiris_RestoreSystemState(CFILE *file) {
|
||||
int module_handle;
|
||||
|
||||
read_module_namelen = cf_ReadByte(file);
|
||||
cf_ReadBytes((ubyte *)read_module_name, read_module_namelen, file);
|
||||
cf_ReadBytes((uint8_t *)read_module_name, read_module_namelen, file);
|
||||
read_module_name[read_module_namelen] = '\0';
|
||||
|
||||
read_module_globalsize = cf_ReadInt(file);
|
||||
@ -3019,7 +3019,7 @@ void Osiris_SaveMemoryChunks(CFILE *file) {
|
||||
break;
|
||||
}
|
||||
cf_WriteInt(file, curr->chunk_id.id);
|
||||
cf_WriteBytes((ubyte *)curr->memory, curr->chunk_id.size, file);
|
||||
cf_WriteBytes((uint8_t *)curr->memory, curr->chunk_id.size, file);
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
@ -3072,7 +3072,7 @@ void Osiris_RestoreMemoryChunks(CFILE *file) {
|
||||
if (!memchunk->memory) {
|
||||
Error("Out of memory");
|
||||
}
|
||||
cf_ReadBytes((ubyte *)memchunk->memory, memchunk->chunk_id.size, file);
|
||||
cf_ReadBytes((uint8_t *)memchunk->memory, memchunk->chunk_id.size, file);
|
||||
memchunk->next = NULL;
|
||||
|
||||
// ok, the node is setup, add it to the linked list
|
||||
@ -3328,7 +3328,7 @@ 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,uint32_t *mem_size,uint32_t *uid,ushort *reference_count,ubyte *has_free_been_called);
|
||||
char OMMS_GetInfo(OMMSHANDLE handle,uint32_t *mem_size,uint32_t *uid,ushort *reference_count,uint8_t *has_free_been_called);
|
||||
|
||||
|
||||
******************************************************************************
|
||||
@ -3412,7 +3412,7 @@ static OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_iden
|
||||
// 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, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called);
|
||||
uint8_t *has_free_been_called);
|
||||
|
||||
void Osiris_InitOMMS(void) {
|
||||
OMMS_Current_base_id = 0;
|
||||
@ -3451,7 +3451,7 @@ void Osiris_SaveOMMS(CFILE *file) {
|
||||
length = (currhash->script_name) ? strlen(currhash->script_name) : 0;
|
||||
cf_WriteByte(file, length);
|
||||
if (length)
|
||||
cf_WriteBytes((ubyte *)currhash->script_name, length, file);
|
||||
cf_WriteBytes((uint8_t *)currhash->script_name, length, file);
|
||||
|
||||
// now go through all the nodes and write their data
|
||||
tOMMSNode *node;
|
||||
@ -3467,7 +3467,7 @@ void Osiris_SaveOMMS(CFILE *file) {
|
||||
cf_WriteInt(file, node->unique_id);
|
||||
cf_WriteInt(file, node->size_of_memory);
|
||||
if (node->size_of_memory)
|
||||
cf_WriteBytes((ubyte *)node->memory_ptr, node->size_of_memory, file);
|
||||
cf_WriteBytes((uint8_t *)node->memory_ptr, node->size_of_memory, file);
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
@ -3518,7 +3518,7 @@ void Osiris_RestoreOMMS(CFILE *file) {
|
||||
if (!currhash->script_name)
|
||||
Error("Out of Memory");
|
||||
else
|
||||
cf_ReadBytes((ubyte *)currhash->script_name, length, file);
|
||||
cf_ReadBytes((uint8_t *)currhash->script_name, length, file);
|
||||
}
|
||||
|
||||
node = NULL;
|
||||
@ -3549,7 +3549,7 @@ void Osiris_RestoreOMMS(CFILE *file) {
|
||||
if (!node->memory_ptr)
|
||||
Error("Out of memory");
|
||||
|
||||
cf_ReadBytes((ubyte *)node->memory_ptr, node->size_of_memory, file);
|
||||
cf_ReadBytes((uint8_t *)node->memory_ptr, node->size_of_memory, file);
|
||||
}
|
||||
} // end reading nodes
|
||||
} // end reading hash nodes
|
||||
@ -3870,7 +3870,7 @@ OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_identifier)
|
||||
// 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, uint32_t *mem_size, uint32_t *uid, ushort *reference_count,
|
||||
ubyte *has_free_been_called) {
|
||||
uint8_t *has_free_been_called) {
|
||||
if (mem_size)
|
||||
*mem_size = 0;
|
||||
if (uid)
|
||||
|
@ -226,14 +226,14 @@ ushort PPic_QueryPilot(char *pilot_name) {
|
||||
// now read through the pilots until we don't get a match anymore
|
||||
while (!done) {
|
||||
// first read in the pilot name
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(file);
|
||||
|
||||
if (cfeof(file)) {
|
||||
done = true;
|
||||
continue;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, file);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, file);
|
||||
name_buffer[name_size] = '\0';
|
||||
|
||||
// next read in pilot_id
|
||||
@ -241,7 +241,7 @@ ushort PPic_QueryPilot(char *pilot_name) {
|
||||
pilot_id = (ushort)cf_ReadShort(file);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
bmp_size = cf_ReadByte(file);
|
||||
cfseek(file, bmp_size, SEEK_CUR);
|
||||
|
||||
@ -282,12 +282,12 @@ bool PPic_FindFirst(char *pilot_name, ushort *pilot_id) {
|
||||
CFILE *file = PilotPic_database_index_handle;
|
||||
|
||||
// first read in the pilot name
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(file);
|
||||
if (cfeof(file)) {
|
||||
return false;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, file);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, file);
|
||||
name_buffer[name_size] = '\0';
|
||||
|
||||
// next read in pilot_id
|
||||
@ -295,7 +295,7 @@ bool PPic_FindFirst(char *pilot_name, ushort *pilot_id) {
|
||||
pid = (ushort)cf_ReadShort(file);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
bmp_size = cf_ReadByte(file);
|
||||
cfseek(file, bmp_size, SEEK_CUR);
|
||||
|
||||
@ -332,12 +332,12 @@ bool PPic_FindNext(ushort *pilot_id) {
|
||||
}
|
||||
|
||||
// first read in the pilot name
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(file);
|
||||
if (cfeof(file)) {
|
||||
return false;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, file);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, file);
|
||||
name_buffer[name_size] = '\0';
|
||||
|
||||
// next read in pilot_id
|
||||
@ -345,7 +345,7 @@ bool PPic_FindNext(ushort *pilot_id) {
|
||||
pid = (ushort)cf_ReadShort(file);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
bmp_size = cf_ReadByte(file);
|
||||
cfseek(file, bmp_size, SEEK_CUR);
|
||||
|
||||
@ -395,14 +395,14 @@ bool PPic_GetPilot(ushort pilot_id, char *pilot_name, int buffersize) {
|
||||
|
||||
// read in the pilot name
|
||||
// ----------------------
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(PilotPic_database_index_handle);
|
||||
if (cfeof(PilotPic_database_index_handle)) {
|
||||
cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET);
|
||||
return false;
|
||||
}
|
||||
int toread = std::min<int>(name_size, buffersize - 1);
|
||||
cf_ReadBytes((ubyte *)pilot_name, toread, PilotPic_database_index_handle);
|
||||
cf_ReadBytes((uint8_t *)pilot_name, toread, PilotPic_database_index_handle);
|
||||
pilot_name[toread] = '\0';
|
||||
|
||||
cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET);
|
||||
@ -437,14 +437,14 @@ int PPic_GetBitmapHandle(ushort pilot_id) {
|
||||
|
||||
// read in the pilot name
|
||||
// ----------------------
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
char name_buffer[PILOT_STRING_SIZE];
|
||||
name_size = cf_ReadByte(PilotPic_database_index_handle);
|
||||
if (cfeof(PilotPic_database_index_handle)) {
|
||||
cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET);
|
||||
return -1;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, PilotPic_database_index_handle);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, PilotPic_database_index_handle);
|
||||
name_buffer[name_size] = '\0';
|
||||
|
||||
// next read in pilot_id
|
||||
@ -452,10 +452,10 @@ int PPic_GetBitmapHandle(ushort pilot_id) {
|
||||
pid = (ushort)cf_ReadShort(PilotPic_database_index_handle);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
char bitmap_name[_MAX_PATH];
|
||||
bmp_size = cf_ReadByte(PilotPic_database_index_handle);
|
||||
cf_ReadBytes((ubyte *)bitmap_name, bmp_size, PilotPic_database_index_handle);
|
||||
cf_ReadBytes((uint8_t *)bitmap_name, bmp_size, PilotPic_database_index_handle);
|
||||
bitmap_name[bmp_size] = '\0';
|
||||
|
||||
cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET);
|
||||
@ -542,9 +542,9 @@ bool PPic_BuildDatabases(void) {
|
||||
file_pos = cftell(file);
|
||||
|
||||
// first read in the pilot name
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(file);
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, file);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, file);
|
||||
name_buffer[name_size] = '\0';
|
||||
if (name_size >= PILOT_STRING_SIZE) {
|
||||
mprintf((0, "PPIC: Too big: (%s)%d %d", name_buffer, count, name_size));
|
||||
@ -555,7 +555,7 @@ bool PPic_BuildDatabases(void) {
|
||||
pilot_id = (ushort)cf_ReadShort(file);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
bmp_size = cf_ReadByte(file);
|
||||
cfseek(file, bmp_size, SEEK_CUR);
|
||||
|
||||
@ -658,13 +658,13 @@ int PPic_JumpToPilot(char *pilot_name) {
|
||||
file_pos = cftell(file);
|
||||
|
||||
// first read in the pilot name
|
||||
ubyte name_size;
|
||||
uint8_t name_size;
|
||||
name_size = cf_ReadByte(file);
|
||||
if (cfeof(file)) {
|
||||
done = true;
|
||||
continue;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)name_buffer, name_size, file);
|
||||
cf_ReadBytes((uint8_t *)name_buffer, name_size, file);
|
||||
name_buffer[name_size] = '\0';
|
||||
|
||||
// next read in pilot_id
|
||||
@ -672,7 +672,7 @@ int PPic_JumpToPilot(char *pilot_name) {
|
||||
pilot_id = (ushort)cf_ReadShort(file);
|
||||
|
||||
// next read past the bitmap name
|
||||
ubyte bmp_size;
|
||||
uint8_t bmp_size;
|
||||
bmp_size = cf_ReadByte(file);
|
||||
cfseek(file, bmp_size, SEEK_CUR);
|
||||
|
||||
|
@ -2034,7 +2034,7 @@ typedef struct tDeathSeq {
|
||||
float accel_mod;
|
||||
vector force_dir;
|
||||
|
||||
ubyte saved_ctrl_type;
|
||||
uint8_t saved_ctrl_type;
|
||||
uint32_t saved_phys_flags;
|
||||
float saved_drag;
|
||||
vector saved_rotthrust;
|
||||
@ -3564,7 +3564,7 @@ void PlayerStopObserving(int slot) {
|
||||
}
|
||||
|
||||
if (slot == Player_num) {
|
||||
ubyte hud_mode;
|
||||
uint8_t hud_mode;
|
||||
Current_pilot.get_hud_data(&hud_mode);
|
||||
AddHUDMessage(TXT_LEAVEOBS);
|
||||
SetHUDMode((tHUDMode)hud_mode);
|
||||
@ -3889,7 +3889,7 @@ void PlayerScoreAdd(int playernum, int points) {
|
||||
////////////////////////////////////////////////////
|
||||
// Thief interface functions
|
||||
////////////////////////////////////////////////////
|
||||
extern ubyte AutomapVisMap[MAX_ROOMS];
|
||||
extern uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
void MakeObjectVisible(object *obj);
|
||||
|
||||
// steals an item from the given player
|
||||
|
@ -796,8 +796,8 @@ bool TelComShow(bool ingame, bool ShipSelect) {
|
||||
// must do this to clear out keyboard events
|
||||
ddio_KeyFlush();
|
||||
|
||||
ubyte oldmip = Render_preferred_state.mipping;
|
||||
ubyte oldbil = Render_preferred_state.filtering;
|
||||
uint8_t oldmip = Render_preferred_state.mipping;
|
||||
uint8_t oldbil = Render_preferred_state.filtering;
|
||||
|
||||
if (!TelCom_init) {
|
||||
mprintf((0, "TELCOM SYSTEM WARNING: TelComInit() error!\n"));
|
||||
@ -1482,7 +1482,7 @@ void TelcomRenderClose(void) {
|
||||
}
|
||||
|
||||
// Renders the current screen for 1 frame
|
||||
void TelcomRenderScreen(bool poweron, bool powerup, ubyte power_effect) {
|
||||
void TelcomRenderScreen(bool poweron, bool powerup, uint8_t power_effect) {
|
||||
if (TC_current_screen == -1)
|
||||
return;
|
||||
|
||||
@ -2157,7 +2157,7 @@ void TelcomCreateStaticOverlays(void) {
|
||||
if ((int)myrand(5) == 3)
|
||||
data[i + 4][j] = def_color;
|
||||
else {
|
||||
ubyte grey = (ubyte)myrand(200) + 55;
|
||||
uint8_t grey = (uint8_t)myrand(200) + 55;
|
||||
data[i + 4][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey);
|
||||
}
|
||||
} else
|
||||
@ -2170,7 +2170,7 @@ void TelcomCreateStaticOverlays(void) {
|
||||
if ((int)myrand(5) == 3)
|
||||
data[i][j] = def_color;
|
||||
else {
|
||||
ubyte grey = (ubyte)myrand(200) + 55;
|
||||
uint8_t grey = (uint8_t)myrand(200) + 55;
|
||||
data[i][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey);
|
||||
}
|
||||
} else
|
||||
@ -2188,7 +2188,7 @@ void TelcomCreateStaticOverlays(void) {
|
||||
if ((int)myrand(5) == 3)
|
||||
data[i][j] = def_color;
|
||||
else {
|
||||
ubyte grey = (ubyte)myrand(200) + 55;
|
||||
uint8_t grey = (uint8_t)myrand(200) + 55;
|
||||
data[i][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey);
|
||||
}
|
||||
} else
|
||||
@ -3797,7 +3797,7 @@ void TCSSSCallback(void) {
|
||||
EndFrame();
|
||||
|
||||
// Render the name of the selected ship
|
||||
ubyte old_alpha = grtext_GetAlpha();
|
||||
uint8_t old_alpha = grtext_GetAlpha();
|
||||
int old_font = grtext_GetFont();
|
||||
ddgr_color old_color = grtext_GetColor();
|
||||
grtext_SetAlpha(255);
|
||||
|
@ -178,13 +178,13 @@ typedef struct {
|
||||
|
||||
typedef struct tTelComInfo {
|
||||
box Monitor_coords[MAX_MONITOR];
|
||||
ubyte Screen_state[MAX_TELCOM_SCREENS];
|
||||
uint8_t Screen_state[MAX_TELCOM_SCREENS];
|
||||
tTCEvent Telcom_event_queue[MAX_TELCOM_EVENTS]; // Event queue for TelCom System
|
||||
int TranslateSysKey[TCSYS_MAXKEYS];
|
||||
int current_status;
|
||||
bool Telcom_systemkey_states[TCSYS_MAXKEYS];
|
||||
float Telcom_mouse_downtime;
|
||||
ubyte state;
|
||||
uint8_t state;
|
||||
int TelComSysKeyEnable;
|
||||
} tTelComInfo;
|
||||
extern tTelComInfo Telcom_system;
|
||||
@ -200,7 +200,7 @@ void TelcomRenderInit(void);
|
||||
// Closes down the Telcom rendering engine
|
||||
void TelcomRenderClose(void);
|
||||
// Renders the current screen for 1 frame
|
||||
void TelcomRenderScreen(bool poweron = true, bool powerup = false, ubyte power_effect = 1);
|
||||
void TelcomRenderScreen(bool poweron = true, bool powerup = false, uint8_t power_effect = 1);
|
||||
// Sets what screen should be drawn by the Telcom
|
||||
void TelcomRenderSetScreen(int screen);
|
||||
// Sets the callback of the Render. This will get called after Effects are drawn, before the screen overlays
|
||||
|
@ -184,7 +184,7 @@ static matrix AM_view_orient;
|
||||
static tTelComInfo *AM_tcs;
|
||||
static int AM_ship_model_handle = -1;
|
||||
|
||||
ubyte AutomapVisMap[MAX_ROOMS];
|
||||
uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
|
||||
static float AM_heading;
|
||||
static float AM_pitch;
|
||||
@ -193,12 +193,12 @@ int AM_terrain = 0, AM_realign = 0, AM_center_on_player = 0, AM_current_marker;
|
||||
|
||||
static int Num_AM_rooms;
|
||||
static ushort AM_room_list[MAX_ROOMS];
|
||||
static ubyte AM_rooms_seen[MAX_ROOMS];
|
||||
static uint8_t AM_rooms_seen[MAX_ROOMS];
|
||||
static g3Point *AM_rotated_points = NULL; //[MAX_VERTS_PER_ROOM];
|
||||
|
||||
static void TCAMCallback(void);
|
||||
|
||||
static ubyte *Small_faces[MAX_ROOMS];
|
||||
static uint8_t *Small_faces[MAX_ROOMS];
|
||||
|
||||
// clears out the list of visible rooms that we've seen
|
||||
void AutomapClearVisMap() { memset(AutomapVisMap, 0, MAX_ROOMS); }
|
||||
@ -207,7 +207,7 @@ void ClassifyAMFaces() {
|
||||
int i = 0;
|
||||
for (i = 0; i <= Highest_room_index; i++) {
|
||||
if (Rooms[i].used) {
|
||||
Small_faces[i] = (ubyte *)mem_malloc(Rooms[i].num_faces);
|
||||
Small_faces[i] = (uint8_t *)mem_malloc(Rooms[i].num_faces);
|
||||
ASSERT(Small_faces[i]);
|
||||
|
||||
memset(Small_faces[i], 0, Rooms[i].num_faces);
|
||||
@ -418,14 +418,14 @@ void MakePointsFromMinMax(vector *corners, vector *minp, vector *maxp);
|
||||
// Else returns false
|
||||
bool IsRoomVisible(room *rp, float *nearz) {
|
||||
g3Point pnt;
|
||||
ubyte ccode;
|
||||
uint8_t ccode;
|
||||
|
||||
vector corners[8];
|
||||
|
||||
MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz);
|
||||
|
||||
*nearz = 90000000;
|
||||
ubyte andbyte = 0xff;
|
||||
uint8_t andbyte = 0xff;
|
||||
for (int t = 0; t < 8; t++) {
|
||||
g3_RotatePoint(&pnt, &corners[t]);
|
||||
|
||||
|
@ -55,6 +55,6 @@ bool TelComAutoMap(tTelComInfo *tcs);
|
||||
|
||||
void AutomapClearVisMap();
|
||||
|
||||
extern ubyte AutomapVisMap[];
|
||||
extern uint8_t AutomapVisMap[];
|
||||
|
||||
#endif
|
||||
|
@ -120,7 +120,7 @@
|
||||
#define LID_INVENTORY 5
|
||||
|
||||
typedef struct {
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
const char *name;
|
||||
int id;
|
||||
} tLineInfo;
|
||||
|
@ -227,8 +227,8 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
bool flash_state; // Is the button glowing?
|
||||
ubyte click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to)
|
||||
ubyte button_type;
|
||||
uint8_t click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to)
|
||||
uint8_t button_type;
|
||||
int sibling; // Sibling effect (for down/up arrows), -1 if none
|
||||
int parent; // Parent effect (text for down/up arrows), -1 if it works with TelCom System
|
||||
int bm_handle;
|
||||
@ -246,9 +246,9 @@ typedef struct {
|
||||
} tButtonInfo;
|
||||
|
||||
typedef struct {
|
||||
ubyte type; // Type of effect
|
||||
ubyte monitor; // Which monitor it belongs to
|
||||
ubyte screen; // What screen the effect belongs to
|
||||
uint8_t type; // Type of effect
|
||||
uint8_t monitor; // Which monitor it belongs to
|
||||
uint8_t screen; // What screen the effect belongs to
|
||||
bool tab_stop; // This effect can have focus
|
||||
bool has_focus; // The effect currently has focus
|
||||
|
||||
|
@ -286,8 +286,8 @@ typedef struct {
|
||||
int jump_page;
|
||||
void (*internal)(int);
|
||||
float flash_time;
|
||||
ubyte button_type; // Up arrow, Down Arrow, TelCom System
|
||||
ubyte click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to)
|
||||
uint8_t button_type; // Up arrow, Down Arrow, TelCom System
|
||||
uint8_t click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to)
|
||||
bool flasher;
|
||||
bool tab_stop;
|
||||
uint32_t mission_mask_set, mission_mask_unset; // mission flag mask
|
||||
|
@ -493,8 +493,8 @@ void TCGoalsRenderCallback(void) {
|
||||
rend_SetAlphaValue(255.0);
|
||||
rend_SetFiltering(1);
|
||||
} else {
|
||||
ubyte alpha_to_use;
|
||||
alpha_to_use = (ubyte)active_alpha;
|
||||
uint8_t alpha_to_use;
|
||||
alpha_to_use = (uint8_t)active_alpha;
|
||||
grtext_SetAlpha(alpha_to_use);
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ void RenderTextStatic(tceffect *tce, float frametime, int xoff, int yoff, bool o
|
||||
color_to_use = DISABLED_TEXT_COLOR;
|
||||
}
|
||||
}
|
||||
ubyte old_alpha = grtext_GetAlpha();
|
||||
uint8_t old_alpha = grtext_GetAlpha();
|
||||
grtext_SetFont(Game_fonts[tce->textinfo.font_index]);
|
||||
grtext_SetColor(color_to_use);
|
||||
grtext_SetAlpha(tce->alpha);
|
||||
@ -202,7 +202,7 @@ void RenderTextType(tceffect *tce, float frametime, int xoff, int yoff, bool ok_
|
||||
strcpy(temp, tce->text_buffer);
|
||||
temp[ll] = '\0';
|
||||
|
||||
ubyte old_alpha = grtext_GetAlpha();
|
||||
uint8_t old_alpha = grtext_GetAlpha();
|
||||
grtext_SetFont(Game_fonts[tce->textinfo.font_index]);
|
||||
char buff[1024];
|
||||
const char *nextline;
|
||||
@ -368,7 +368,7 @@ void RenderTextFade(tceffect *tce, float frametime, int xoff, int yoff, bool ok_
|
||||
color_to_use = DISABLED_TEXT_COLOR;
|
||||
}
|
||||
}
|
||||
ubyte old_alpha = grtext_GetAlpha();
|
||||
uint8_t old_alpha = grtext_GetAlpha();
|
||||
grtext_SetFont(Game_fonts[tce->textinfo.font_index]);
|
||||
grtext_SetColor(color_to_use);
|
||||
grtext_SetAlpha(alpha);
|
||||
@ -645,7 +645,7 @@ void RenderBmpInvert(tceffect *tce, float frametime, int xoff, int yoff, bool ok
|
||||
if (tce->flags == TC_BMPF_OUT)
|
||||
k = 1 - k;
|
||||
inv = 255 - (255.0f * k);
|
||||
ubyte r, g, b;
|
||||
uint8_t r, g, b;
|
||||
int bh = bm_h(srcbmph, 0);
|
||||
int bw = bm_w(srcbmph, 0);
|
||||
int how_many = tce->bmpinfo.chunk_bmp.w * tce->bmpinfo.chunk_bmp.h;
|
||||
|
@ -245,7 +245,7 @@ static lodoff LODOffs[MAX_LODOFFS];
|
||||
static int Num_lodoffs = 0;
|
||||
|
||||
// Render the terrain as flat?
|
||||
ubyte Flat_terrain = 0;
|
||||
uint8_t Flat_terrain = 0;
|
||||
|
||||
// Variables for LOD engine
|
||||
static float ViewDistance1 = .68f, ViewDistance2 = 1.0f;
|
||||
@ -257,7 +257,7 @@ static vector *TS_View_position;
|
||||
static vector TS_PreRows[TERRAIN_DEPTH];
|
||||
static vector TS_FVectorAdd, TS_RVectorAdd;
|
||||
|
||||
static ubyte Terrain_y_flags[256];
|
||||
static uint8_t Terrain_y_flags[256];
|
||||
static vector Terrain_y_cache[256];
|
||||
|
||||
static ushort LOD_sort_bucket[MAX_TERRAIN_LOD][MAX_CELLS_TO_RENDER];
|
||||
@ -433,7 +433,7 @@ int GetVisibleTerrain(vector *eye, matrix *view_orient) {
|
||||
return cellcount;
|
||||
}
|
||||
|
||||
__inline void CheckCellOccupancy(int x, int y, int *ccount, ubyte lod) {
|
||||
__inline void CheckCellOccupancy(int x, int y, int *ccount, uint8_t lod) {
|
||||
int n, simplemul, i;
|
||||
|
||||
if (*ccount >= MAX_CELLS_TO_RENDER) {
|
||||
@ -511,10 +511,10 @@ int SearchQuadTree(int x1, int y1, int x2, int y2, int dir, int *ccount) {
|
||||
int stack_y2[200];
|
||||
int stack_level[200];
|
||||
float testdist = VisibleTerrainZ;
|
||||
ubyte ymin_int[4], ymax_int[4];
|
||||
uint8_t ymin_int[4], ymax_int[4];
|
||||
int close;
|
||||
ubyte same_side;
|
||||
ubyte check_portal = 0;
|
||||
uint8_t same_side;
|
||||
uint8_t check_portal = 0;
|
||||
g3Point *pnt;
|
||||
int use_occlusion = 0;
|
||||
int src_occlusion_index;
|
||||
@ -633,7 +633,7 @@ int SearchQuadTree(int x1, int y1, int x2, int y2, int dir, int *ccount) {
|
||||
|
||||
anded = 0xff;
|
||||
same_side = 0xff;
|
||||
ubyte portal_and = 0xff;
|
||||
uint8_t portal_and = 0xff;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (first) {
|
||||
|
@ -1215,7 +1215,7 @@ int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num
|
||||
int objnum;
|
||||
object *obj;
|
||||
int parentnum = parent - Objects;
|
||||
ubyte terrain = 0;
|
||||
uint8_t terrain = 0;
|
||||
|
||||
ASSERT(Weapons[weapon_num].used);
|
||||
|
||||
@ -2277,7 +2277,7 @@ void DoFusionEffect(object *objp, int weapon_type) {
|
||||
}
|
||||
|
||||
// Do the spray effect
|
||||
void DoSprayEffect(object *obj, otype_wb_info *static_wb, ubyte wb_index) {
|
||||
void DoSprayEffect(object *obj, otype_wb_info *static_wb, uint8_t wb_index) {
|
||||
vector laser_pos, laser_dir;
|
||||
int cur_m_bit;
|
||||
|
||||
@ -2664,7 +2664,7 @@ void StopOnOffWeapon(object *obj) {
|
||||
}
|
||||
|
||||
// Starts an on/off weapon firing
|
||||
void StartOnOffWeapon(object *obj, ubyte wb_index) {
|
||||
void StartOnOffWeapon(object *obj, uint8_t wb_index) {
|
||||
// mprintf ((0,"Starting on/off weapon!\n"));
|
||||
obj->weapon_fire_flags |= WFF_ON_OFF;
|
||||
|
||||
@ -2694,7 +2694,7 @@ void DoZoomStay() {
|
||||
}
|
||||
|
||||
// Zooms in for this weapon
|
||||
void DoZoomEffect(player_weapon *pw, ubyte clear) {
|
||||
void DoZoomEffect(player_weapon *pw, uint8_t clear) {
|
||||
if (pw->firing_time < .5) {
|
||||
Players[Player_num].turn_scalar = 1.0;
|
||||
Render_FOV = D3_DEFAULT_FOV;
|
||||
|
@ -494,8 +494,8 @@ typedef struct ai_path_info {
|
||||
int goal_index;
|
||||
|
||||
// Used by all paths
|
||||
ubyte path_id[MAX_JOINED_PATHS];
|
||||
ubyte path_type[MAX_JOINED_PATHS];
|
||||
uint8_t path_id[MAX_JOINED_PATHS];
|
||||
uint8_t path_type[MAX_JOINED_PATHS];
|
||||
|
||||
// Used for static game paths
|
||||
ushort path_start_node[MAX_JOINED_PATHS];
|
||||
@ -551,8 +551,8 @@ typedef struct goal_enabler {
|
||||
|
||||
typedef struct gi_fire {
|
||||
short cur_wb; // for ranged attack
|
||||
ubyte cur_mask; // for ranged attack
|
||||
ubyte melee_number; // this could be union'ed but it makes this struct word aligned
|
||||
uint8_t cur_mask; // for ranged attack
|
||||
uint8_t melee_number; // this could be union'ed but it makes this struct word aligned
|
||||
} gi_fire;
|
||||
|
||||
typedef struct g_steer {
|
||||
@ -624,7 +624,7 @@ typedef struct goal_info {
|
||||
typedef struct goal {
|
||||
uint32_t type;
|
||||
char subtype;
|
||||
ubyte activation_level;
|
||||
uint8_t activation_level;
|
||||
float creation_time;
|
||||
|
||||
float min_influence;
|
||||
|
@ -58,7 +58,7 @@
|
||||
#define AI_MAX_SEGS_CHECKED 200
|
||||
|
||||
static int ai_num_segs_checked = 0;
|
||||
static ubyte ai_terrain_check_list[((TERRAIN_WIDTH * TERRAIN_DEPTH) >> 3) + 1];
|
||||
static uint8_t ai_terrain_check_list[((TERRAIN_WIDTH * TERRAIN_DEPTH) >> 3) + 1];
|
||||
static int ai_segs_checked[AI_MAX_SEGS_CHECKED];
|
||||
#ifdef _DEBUG
|
||||
static int ai_num_checks_since_init = 0;
|
||||
|
@ -305,7 +305,7 @@ void WriteAmbientData() {
|
||||
}
|
||||
|
||||
// Write file ID & version
|
||||
cf_WriteBytes((ubyte *)AMBIENT_FILE_ID, strlen(AMBIENT_FILE_ID), ofile);
|
||||
cf_WriteBytes((uint8_t *)AMBIENT_FILE_ID, strlen(AMBIENT_FILE_ID), ofile);
|
||||
cf_WriteInt(ofile, AMBIENT_FILE_VERSION);
|
||||
|
||||
// Write the number of patterns
|
||||
|
@ -224,7 +224,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
int samples, rate, chan;
|
||||
char temp_filename[_MAX_PATH];
|
||||
char osftemp_filename[_MAX_PATH];
|
||||
ubyte *StaticFileBuffer = NULL;
|
||||
uint8_t *StaticFileBuffer = NULL;
|
||||
*temp_filename = *osftemp_filename = '\0';
|
||||
OSFArchive osf;
|
||||
CFILE *fpin = NULL;
|
||||
@ -319,7 +319,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
wavdata.sample_16bit[count] = INTEL_SHORT(wavdata.sample_16bit[count]);
|
||||
}
|
||||
|
||||
cf_WriteBytes((ubyte *)wavdata.sample_16bit,amount_to_flush,file);
|
||||
cf_WriteBytes((uint8_t *)wavdata.sample_16bit,amount_to_flush,file);
|
||||
}else{
|
||||
mprintf((0,"TAUNT: Confusion to bits per sample (%d)\n",wavdata.bits_per_sample));
|
||||
ret = false;
|
||||
@ -339,7 +339,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
wavdata.sample_16bit[count] = INTEL_SHORT(wavdata.sample_16bit[count]);
|
||||
}
|
||||
|
||||
cf_WriteBytes((ubyte *)wavdata.sample_16bit, amount_to_flush, file);
|
||||
cf_WriteBytes((uint8_t *)wavdata.sample_16bit, amount_to_flush, file);
|
||||
cfclose(file);
|
||||
file = NULL;
|
||||
|
||||
@ -369,7 +369,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) {
|
||||
uint32_t filelen, nblocks, i;
|
||||
int format;
|
||||
|
||||
StaticFileBuffer = (ubyte *)mem_malloc(FILEBUFFER_LENGTH);
|
||||
StaticFileBuffer = (uint8_t *)mem_malloc(FILEBUFFER_LENGTH);
|
||||
if (!StaticFileBuffer) {
|
||||
ret = false;
|
||||
mprintf((0, "Out of memory\n"));
|
||||
@ -711,9 +711,9 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) {
|
||||
|
||||
wave->sample_length = aligned_size;
|
||||
wave->np_sample_length = cksize;
|
||||
wave->sample_8bit = (ubyte *)mem_malloc(aligned_size);
|
||||
wave->sample_8bit = (uint8_t *)mem_malloc(aligned_size);
|
||||
|
||||
cf_ReadBytes((ubyte *)wave->sample_8bit, cksize, cfptr);
|
||||
cf_ReadBytes((uint8_t *)wave->sample_8bit, cksize, cfptr);
|
||||
|
||||
if (aligned_size != cksize)
|
||||
memset(wave->sample_8bit + cksize, 128, num_needed);
|
||||
@ -730,7 +730,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) {
|
||||
|
||||
wave->sample_16bit = (short *)mem_malloc(cksize + num_needed);
|
||||
|
||||
cf_ReadBytes((ubyte *)wave->sample_16bit, cksize, cfptr);
|
||||
cf_ReadBytes((uint8_t *)wave->sample_16bit, cksize, cfptr);
|
||||
for (count = 0; count < (int)cksize / 2; count++) {
|
||||
wave->sample_16bit[count] = INTEL_SHORT(wave->sample_16bit[count]);
|
||||
}
|
||||
|
@ -56,13 +56,13 @@
|
||||
#define BSP_TREE_VERSION 10003
|
||||
|
||||
bsptree MineBSP;
|
||||
ubyte BSP_initted = 0;
|
||||
uint8_t BSP_initted = 0;
|
||||
static int ConvexSubspaces = 0, ConvexPolys = 0;
|
||||
static int Solids = 0, Empty = 0;
|
||||
|
||||
int BSPChecksum = -1;
|
||||
// TODO: MTS: Only used here?
|
||||
ubyte UseBSP = 0;
|
||||
uint8_t UseBSP = 0;
|
||||
|
||||
// Goes through all the valid points in the indoor engine and returns a unique
|
||||
// checksum
|
||||
@ -213,7 +213,7 @@ void SaveBSPNode(CFILE *outfile, bspnode *node) {
|
||||
// Loads a bsp node from an open file and recurses with its children
|
||||
void LoadBSPNode(CFILE *infile, bspnode **node) {
|
||||
// Get the node type
|
||||
ubyte type = cf_ReadByte(infile);
|
||||
uint8_t type = cf_ReadByte(infile);
|
||||
|
||||
// Allocate the node and set its type
|
||||
*node = NewBSPNode();
|
||||
@ -449,8 +449,8 @@ int SplitPolygon(bspplane *plane, bsppolygon *testpoly, bsppolygon **frontpoly,
|
||||
}
|
||||
|
||||
char Twirly[] = {'|', '/', '-', '\\'};
|
||||
ubyte Plane_twirl = 0;
|
||||
ubyte Node_twirl = 0;
|
||||
uint8_t Plane_twirl = 0;
|
||||
uint8_t Node_twirl = 0;
|
||||
|
||||
// Selects the best plane to partition with, returning the pointer to polygon to split with
|
||||
bsppolygon *SelectPlane(list **polylist) {
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
typedef struct {
|
||||
float a, b, c, d;
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
} bspplane;
|
||||
|
||||
typedef struct {
|
||||
@ -76,7 +76,7 @@ typedef struct {
|
||||
} bsppolygon;
|
||||
|
||||
typedef struct bspnode {
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
bspplane plane;
|
||||
ushort node_facenum;
|
||||
ushort node_roomnum;
|
||||
@ -126,7 +126,7 @@ int BSPGetMineChecksum();
|
||||
|
||||
extern bsptree MineBSP;
|
||||
extern int BSPChecksum;
|
||||
extern ubyte BSP_initted;
|
||||
extern ubyte UseBSP;
|
||||
extern uint8_t BSP_initted;
|
||||
extern uint8_t UseBSP;
|
||||
|
||||
#endif
|
||||
|
@ -184,7 +184,7 @@ void BuddyDisplay(void) {
|
||||
static void MultiAskforGuidebotMenu() {
|
||||
int size_offset;
|
||||
int count = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
// Only process this if we are the client
|
||||
if (Netgame.local_role != LR_CLIENT) {
|
||||
Int3(); // We shouldn't be here... get Kevin
|
||||
@ -196,7 +196,7 @@ static void MultiAskforGuidebotMenu() {
|
||||
nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count);
|
||||
}
|
||||
|
||||
static void MultiStuffGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) {
|
||||
static void MultiStuffGuidebotMenuData(uint8_t *data, int *count, gb_menu *menu) {
|
||||
int i;
|
||||
// Get the menu data and stick it here
|
||||
// length of the title
|
||||
@ -227,7 +227,7 @@ static void MultiStuffGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) {
|
||||
void MultiSendGuidebotMenuSelection(gb_com *command) {
|
||||
int size_offset;
|
||||
int count = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
|
||||
// Only process this if we are the client
|
||||
if (Netgame.local_role != LR_CLIENT) {
|
||||
@ -258,7 +258,7 @@ static void MultiSendGuidebotMenuText(gb_menu *menu, int slot) {
|
||||
int size_offset;
|
||||
int count = 0;
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
// Only process this if we are the server
|
||||
if (Netgame.local_role != LR_SERVER) {
|
||||
Int3(); // We shouldn't be here... get Kevin
|
||||
@ -272,7 +272,7 @@ static void MultiSendGuidebotMenuText(gb_menu *menu, int slot) {
|
||||
nw_SendReliable(NetPlayers[slot].reliable_socket, data, count, false);
|
||||
}
|
||||
|
||||
static void MultiReadGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) {
|
||||
static void MultiReadGuidebotMenuData(uint8_t *data, int *count, gb_menu *menu) {
|
||||
|
||||
int i;
|
||||
// Get the menu data and stick it here
|
||||
@ -298,7 +298,7 @@ static void MultiReadGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) {
|
||||
}
|
||||
}
|
||||
|
||||
void MultiDoGuidebotMenuRequest(ubyte *data, int slot) {
|
||||
void MultiDoGuidebotMenuRequest(uint8_t *data, int slot) {
|
||||
|
||||
int count = 0;
|
||||
SKIP_HEADER(data, &count);
|
||||
@ -351,7 +351,7 @@ void MultiDoGuidebotMenuRequest(ubyte *data, int slot) {
|
||||
}
|
||||
}
|
||||
|
||||
void MultiDoGuidebotMenuData(ubyte *data) {
|
||||
void MultiDoGuidebotMenuData(uint8_t *data) {
|
||||
int count = 0;
|
||||
SKIP_HEADER(data, &count);
|
||||
if (Netgame.local_role != LR_CLIENT) {
|
||||
|
@ -70,7 +70,7 @@
|
||||
*
|
||||
* 15 8/27/98 6:23p Jeff
|
||||
* changed autoleveling in config so it is a slider...had to convert
|
||||
* global from bool->ubyte. Added fast headlight and mirrored surfaces to
|
||||
* global from bool->uint8_t. Added fast headlight and mirrored surfaces to
|
||||
* config menu
|
||||
*
|
||||
* 14 8/19/98 2:19p Jeff
|
||||
@ -171,8 +171,8 @@ typedef struct tDetailSettings {
|
||||
bool Scorches_enabled;
|
||||
bool Weapon_coronas_enabled;
|
||||
bool Bumpmapping_enabled;
|
||||
ubyte Specular_mapping_type;
|
||||
ubyte Object_complexity; // 0 = low, 1 = medium, 2=high
|
||||
uint8_t Specular_mapping_type;
|
||||
uint8_t Object_complexity; // 0 = low, 1 = medium, 2=high
|
||||
} tDetailSettings;
|
||||
|
||||
// Call this with one of the above defines to set the detail level to a predefined set (custom level is ignored)
|
||||
|
@ -114,7 +114,7 @@ $$TABLE_GAMEFILE "credits.omf"
|
||||
|
||||
typedef struct creditline {
|
||||
ddgr_color color;
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
char *text;
|
||||
creditline *next;
|
||||
ushort startx, starty, endx, endy;
|
||||
|
@ -403,7 +403,7 @@ t_cfg_element Cfg_joy_elements[] = {{-1, CtlText_WeaponGroup, CCITEM_WPN_X2, CCI
|
||||
{ctfBANK_RIGHTBUTTON, CtlText_BankRight, 0, 0}};
|
||||
#define N_JOY_CFG_FN (sizeof(Cfg_joy_elements) / sizeof(t_cfg_element))
|
||||
#define N_KEY_CFG_FN (sizeof(Cfg_key_elements) / sizeof(t_cfg_element))
|
||||
static void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, ubyte controller, ubyte elem, int8_t slot);
|
||||
static void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, uint8_t controller, uint8_t elem, int8_t slot);
|
||||
static void ctl_cfg_element_options_dialog(short fnid);
|
||||
// used for adjusting settings.
|
||||
static int weapon_select_dialog(int wpn, bool is_secondary);
|
||||
@ -469,7 +469,7 @@ void key_cfg_screen::process(int res) {
|
||||
for (i = 0; i < N_KEY_CFG_FN; i++) {
|
||||
if (m_elem[i].GetID() != -1 && m_elem[i].GetID() == res) {
|
||||
// we chose a slot to configure.
|
||||
ubyte elem, controller;
|
||||
uint8_t elem, controller;
|
||||
int8_t slot;
|
||||
ct_type elem_type;
|
||||
if (m_elem[i].GetActiveSlot() == CFGELEM_SLOT_CLEAR) {
|
||||
@ -577,7 +577,7 @@ void joy_cfg_screen::process(int res) {
|
||||
for (i = 0; i < N_JOY_CFG_FN; i++) {
|
||||
if (m_elem[i].GetID() != -1 && m_elem[i].GetID() == res) {
|
||||
// we chose a slot to configure.
|
||||
ubyte elem, controller;
|
||||
uint8_t elem, controller;
|
||||
int8_t slot;
|
||||
ct_type elem_type;
|
||||
if (m_elem[i].GetActiveSlot() == CFGELEM_SLOT_CLEAR) {
|
||||
@ -898,9 +898,9 @@ void wpnsel_cfg_screen::unrealize() {
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// this will take out any repeats of element and slot in function id.
|
||||
void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, ubyte ctrl, ubyte elem, int8_t slot) {
|
||||
void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, uint8_t ctrl, uint8_t elem, int8_t slot) {
|
||||
ct_type ctype_fn[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
ct_config_data ccfgdata_fn;
|
||||
t_cfg_element *fn_list;
|
||||
tCfgDataParts cfgparts;
|
||||
@ -972,7 +972,7 @@ void ctl_cfg_element_options_dialog(short fnid) {
|
||||
int *inv_binding[CTLBINDS_PER_FUNC];
|
||||
bool *clear_binding[CTLBINDS_PER_FUNC];
|
||||
ct_type ctype_fn[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags_fn[CTLBINDS_PER_FUNC];
|
||||
ct_config_data ccfgdata_fn;
|
||||
|
||||
tCfgDataParts cfgparts;
|
||||
|
@ -78,7 +78,7 @@ tGraphColor GraphColors[MAX_GRAPH_NODES] = {
|
||||
{"Dk.Purple", GR_RGB(100, 4, 104)}};
|
||||
|
||||
typedef struct {
|
||||
ubyte data_input;
|
||||
uint8_t data_input;
|
||||
int flags;
|
||||
|
||||
union {
|
||||
|
@ -518,7 +518,7 @@ void DemoWriteChangedObjects() {
|
||||
}
|
||||
}
|
||||
|
||||
void DemoWriteObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
|
||||
void DemoWriteObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
|
||||
object *obj) {
|
||||
|
||||
if (Demo_flags == DF_RECORDING) {
|
||||
@ -654,7 +654,7 @@ void DemoWritePlayerDeath(object *player, bool melee, int fate) {
|
||||
|
||||
void DemoReadPlayerDeath(void) {
|
||||
short playernum = cf_ReadShort(Demo_cfp);
|
||||
ubyte melee = cf_ReadByte(Demo_cfp);
|
||||
uint8_t melee = cf_ReadByte(Demo_cfp);
|
||||
int fate = cf_ReadInt(Demo_cfp);
|
||||
InitiatePlayerDeath(&Objects[playernum], melee ? true : false, fate);
|
||||
}
|
||||
@ -928,7 +928,7 @@ void DemoReadObj() {
|
||||
void DemoReadHudMessage() {
|
||||
char msg[HUD_MESSAGE_LENGTH];
|
||||
int color = cf_ReadInt(Demo_cfp);
|
||||
ubyte blink = cf_ReadByte(Demo_cfp);
|
||||
uint8_t blink = cf_ReadByte(Demo_cfp);
|
||||
cf_ReadString(msg, HUD_MESSAGE_LENGTH, Demo_cfp);
|
||||
|
||||
if (color) {
|
||||
@ -1099,8 +1099,8 @@ void DemoReadWeaponFire() {
|
||||
|
||||
void DemoReadObjCreate() {
|
||||
// float gametime;
|
||||
ubyte type;
|
||||
ubyte use_orient;
|
||||
uint8_t type;
|
||||
uint8_t use_orient;
|
||||
matrix orient;
|
||||
vector pos;
|
||||
int roomnum;
|
||||
@ -1153,10 +1153,10 @@ void DemoReadObjCreate() {
|
||||
// FrameDemoDelta = FrameCount
|
||||
// DemoFrameCount = 0;
|
||||
|
||||
ubyte DemoLastOpcode = 0;
|
||||
uint8_t DemoLastOpcode = 0;
|
||||
|
||||
void DemoFrame() {
|
||||
ubyte opcode;
|
||||
uint8_t opcode;
|
||||
if (Demo_flags != DF_PLAYBACK)
|
||||
return;
|
||||
if (!Demo_first_frame) {
|
||||
@ -1301,7 +1301,7 @@ void DemoFrame() {
|
||||
} while (!exit_loop);
|
||||
}
|
||||
|
||||
void DemoWriteCinematics(ubyte *data, uint16_t len) {
|
||||
void DemoWriteCinematics(uint8_t *data, uint16_t len) {
|
||||
cf_WriteByte(Demo_cfp, DT_CINEMATICS);
|
||||
// Write a bunch of data
|
||||
mprintf((0, "Writing Cinematic data (%d bytes) to demo file.\n", len));
|
||||
@ -1310,40 +1310,40 @@ void DemoWriteCinematics(ubyte *data, uint16_t len) {
|
||||
}
|
||||
|
||||
void DemoReadCinematics() {
|
||||
ubyte buffer[1500];
|
||||
uint8_t buffer[1500];
|
||||
ushort len = cf_ReadShort(Demo_cfp);
|
||||
cf_ReadBytes(buffer, len, Demo_cfp);
|
||||
mprintf((0, "Reading Cinematic data from demo file.\n"));
|
||||
Cinematic_DoDemoFileData(buffer);
|
||||
}
|
||||
|
||||
void DemoWriteMSafe(ubyte *data, uint16_t len) {
|
||||
void DemoWriteMSafe(uint8_t *data, uint16_t len) {
|
||||
cf_WriteByte(Demo_cfp, DT_MSAFE);
|
||||
cf_WriteShort(Demo_cfp, len);
|
||||
cf_WriteBytes(data, len, Demo_cfp);
|
||||
// mprintf((0,"Writing MSAFE data to demo file.\n"));
|
||||
}
|
||||
|
||||
void DemoWritePowerup(ubyte *data, uint16_t len) {
|
||||
void DemoWritePowerup(uint8_t *data, uint16_t len) {
|
||||
cf_WriteByte(Demo_cfp, DT_POWERUP);
|
||||
cf_WriteShort(Demo_cfp, len);
|
||||
cf_WriteBytes(data, len, Demo_cfp);
|
||||
}
|
||||
|
||||
extern void MultiDoMSafeFunction(ubyte *data);
|
||||
extern void MultiDoMSafeFunction(uint8_t *data);
|
||||
|
||||
void DemoReadMSafe() {
|
||||
ubyte buffer[1500];
|
||||
uint8_t buffer[1500];
|
||||
ushort len = cf_ReadShort(Demo_cfp);
|
||||
cf_ReadBytes(buffer, len, Demo_cfp);
|
||||
// mprintf((0,"Reading MSAFE data from demo file.\n"));
|
||||
MultiDoMSafeFunction(buffer);
|
||||
}
|
||||
|
||||
extern void MultiDoMSafePowerup(ubyte *data);
|
||||
extern void MultiDoMSafePowerup(uint8_t *data);
|
||||
|
||||
void DemoReadPowerups() {
|
||||
ubyte buffer[1500];
|
||||
uint8_t buffer[1500];
|
||||
ushort len = cf_ReadShort(Demo_cfp);
|
||||
cf_ReadBytes(buffer, len, Demo_cfp);
|
||||
MultiDoMSafePowerup(buffer);
|
||||
@ -1372,7 +1372,7 @@ void DemoReadCollidePlayerWeapon(void) {
|
||||
short wep_objnum = cf_ReadShort(Demo_cfp);
|
||||
gs_ReadVector(Demo_cfp, collision_p);
|
||||
gs_ReadVector(Demo_cfp, collision_n);
|
||||
ubyte b = cf_ReadByte(Demo_cfp);
|
||||
uint8_t b = cf_ReadByte(Demo_cfp);
|
||||
f_reverse_normal = b ? true : false;
|
||||
|
||||
real_weapnum = Demo_obj_map[wep_objnum];
|
||||
@ -1403,7 +1403,7 @@ void DemoReadCollideGenericWeapon(void) {
|
||||
short wep_objnum = cf_ReadShort(Demo_cfp);
|
||||
gs_ReadVector(Demo_cfp, collision_p);
|
||||
gs_ReadVector(Demo_cfp, collision_n);
|
||||
ubyte b = cf_ReadByte(Demo_cfp);
|
||||
uint8_t b = cf_ReadByte(Demo_cfp);
|
||||
f_reverse_normal = b ? true : false;
|
||||
|
||||
real_weapnum = Demo_obj_map[wep_objnum];
|
||||
@ -1715,7 +1715,7 @@ void DemoWritePersistantHUDMessage(ddgr_color color, int x, int y, float time, i
|
||||
cf_WriteInt(Demo_cfp, flags);
|
||||
cf_WriteInt(Demo_cfp, sound_index);
|
||||
cf_WriteShort(Demo_cfp, strlen(msg) + 1);
|
||||
cf_WriteBytes((const ubyte *)msg, strlen(msg) + 1, Demo_cfp);
|
||||
cf_WriteBytes((const uint8_t *)msg, strlen(msg) + 1, Demo_cfp);
|
||||
}
|
||||
|
||||
void DemoReadPersistantHUDMessage() {
|
||||
@ -1735,7 +1735,7 @@ void DemoReadPersistantHUDMessage() {
|
||||
sound_index = cf_ReadInt(Demo_cfp);
|
||||
int msglen = cf_ReadShort(Demo_cfp);
|
||||
fmt = (char *)mem_malloc(msglen);
|
||||
cf_ReadBytes((ubyte *)fmt, msglen, Demo_cfp);
|
||||
cf_ReadBytes((uint8_t *)fmt, msglen, Demo_cfp);
|
||||
AddPersistentHUDMessage(color, x, y, time, flags, sound_index, fmt);
|
||||
mem_free(fmt);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "pilot.h"
|
||||
#include "difficulty_external.h"
|
||||
|
||||
extern ubyte ingame_difficulty;
|
||||
extern uint8_t ingame_difficulty;
|
||||
|
||||
// DAJ static global instead of subroutine call for speed
|
||||
#define DIFF_LEVEL (((Game_mode & GM_MULTI)) ? Netgame.difficulty : ingame_difficulty)
|
||||
|
@ -123,9 +123,9 @@
|
||||
|
||||
typedef struct {
|
||||
char name[PAGENAME_LEN]; // name of the door
|
||||
ubyte used; // if this door is in use
|
||||
ubyte flags; // flags for this door
|
||||
ubyte pad; // keep alignment (pagename is 35 chars long)
|
||||
uint8_t used; // if this door is in use
|
||||
uint8_t flags; // flags for this door
|
||||
uint8_t pad; // keep alignment (pagename is 35 chars long)
|
||||
short hit_points; // for blastable doors
|
||||
float total_open_time; // time of animation to open door
|
||||
float total_close_time; // time of animation to close door
|
||||
|
@ -125,9 +125,9 @@ extern int Active_doorways[MAX_ACTIVE_DOORWAYS];
|
||||
// A doorway (room) in the mine
|
||||
typedef struct doorway {
|
||||
int doornum; // door type of this doorway
|
||||
ubyte state; // current state of doorway
|
||||
ubyte flags; // flags associated with a doorway
|
||||
ubyte keys_needed; // used by trigger system. these bits need to be set to activate door
|
||||
uint8_t state; // current state of doorway
|
||||
uint8_t flags; // flags associated with a doorway
|
||||
uint8_t keys_needed; // used by trigger system. these bits need to be set to activate door
|
||||
int8_t activenum; // index into active doorways array, or -1 if not active
|
||||
float position; // current position of door
|
||||
float dest_pos; // destination position
|
||||
|
@ -703,11 +703,11 @@ void InitFireballs() {
|
||||
if (col565 == 0x07e0) {
|
||||
data[i] = NEW_TRANSPARENT_COLOR;
|
||||
} else {
|
||||
ubyte r = (ubyte)((col565 & 0xf800) >> 11);
|
||||
ubyte g = (ubyte)((col565 & 0x07c0) >> 6);
|
||||
ubyte b = (ubyte)(col565 & 0x001f);
|
||||
uint8_t r = (uint8_t)((col565 & 0xf800) >> 11);
|
||||
uint8_t g = (uint8_t)((col565 & 0x07c0) >> 6);
|
||||
uint8_t b = (uint8_t)(col565 & 0x001f);
|
||||
float brightness = ((r * 0.30f) + (g * 0.59f) + (b * 0.11f)) * recip32;
|
||||
ubyte elem = (ubyte)(255.0f * brightness);
|
||||
uint8_t elem = (uint8_t)(255.0f * brightness);
|
||||
if (brightness > 1.0f)
|
||||
elem = 255;
|
||||
data[i] = GR_RGB16(elem, elem, elem) | OPAQUE_FLAG;
|
||||
@ -2053,7 +2053,7 @@ int CreateSmolderingObject(vector *pos, int index, float lifetime, float max_siz
|
||||
}
|
||||
// Draws a colored alpha disk...useful for cool lighting effects
|
||||
void DrawColoredDisk(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size,
|
||||
ubyte saturate, ubyte lod) {
|
||||
uint8_t saturate, uint8_t lod) {
|
||||
rend_SetZBufferWriteMask(0);
|
||||
DrawColoredRing(pos, r, g, b, inner_alpha, outer_alpha, size, 0, saturate, lod);
|
||||
rend_SetZBufferWriteMask(1);
|
||||
@ -2072,7 +2072,7 @@ void DrawColoredGlow(vector *pos, float r, float g, float b, float size) {
|
||||
|
||||
// Draws a colored alpha ring...useful for cool lighting effects
|
||||
void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size,
|
||||
float inner_ring_ratio, ubyte saturate, ubyte lod) {
|
||||
float inner_ring_ratio, uint8_t saturate, uint8_t lod) {
|
||||
static vector circleVecs[3][32];
|
||||
static int lodSegments[3] = {32, 16, 8};
|
||||
static bool firstCall = true;
|
||||
@ -2151,7 +2151,7 @@ void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha,
|
||||
|
||||
// TODO: MTS: not used?
|
||||
// Draws a sphere with the appropriate texture. If texture=-1, then uses rgb as colors
|
||||
void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, ubyte saturate) {
|
||||
void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, uint8_t saturate) {
|
||||
static vector sphere_vecs[16][16];
|
||||
static int first = 1;
|
||||
g3Point sphere_points[16][16], *pntlist[4], draw_points[4];
|
||||
|
@ -180,8 +180,8 @@
|
||||
typedef struct {
|
||||
char name[PAGENAME_LEN]; // The filename of this animation
|
||||
|
||||
ubyte type; // type of fireball, see above
|
||||
ubyte tex_size; // What size texture to use for this animation
|
||||
uint8_t type; // type of fireball, see above
|
||||
uint8_t tex_size; // What size texture to use for this animation
|
||||
float total_life; // How long this animation should last (in seconds)
|
||||
float size; // How big this explosion is
|
||||
short bm_handle; // The handle to the vlip
|
||||
@ -250,11 +250,11 @@ void DrawBlastRingObject(object *obj);
|
||||
|
||||
// Draws a colored alpha disk...useful for cool lighting effects
|
||||
void DrawColoredDisk(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size,
|
||||
ubyte saturate = 0, ubyte lod = 1);
|
||||
uint8_t saturate = 0, uint8_t lod = 1);
|
||||
|
||||
// Draws a colored alpha ring...useful for cool lighting effects
|
||||
void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size,
|
||||
float inner_ring_ratio, ubyte saturate = 0, ubyte lod = 1);
|
||||
float inner_ring_ratio, uint8_t saturate = 0, uint8_t lod = 1);
|
||||
|
||||
// Creates a blast ring from an event
|
||||
void DoBlastRingEvent(int eventnum, void *data);
|
||||
@ -279,7 +279,7 @@ int GetRandomSmallExplosion();
|
||||
int GetRandomBillowingExplosion();
|
||||
|
||||
// Draws a sphere with the appropriate texture. If texture=-1, then uses rgb as colors
|
||||
void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, ubyte saturate = 1);
|
||||
void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, uint8_t saturate = 1);
|
||||
|
||||
// Creates end points that simulate lightning
|
||||
void CreateLightningRodPositions(vector *src, vector *dest, vector *world_vecs, int num_segments, float rand_mag,
|
||||
|
@ -309,7 +309,7 @@ typedef struct gamemode {
|
||||
// Structure for a terrain sound "band"
|
||||
typedef struct {
|
||||
int sound_index; // the sound to play
|
||||
ubyte low_alt, high_alt; // top & bottom of range of sound
|
||||
uint8_t low_alt, high_alt; // top & bottom of range of sound
|
||||
float low_volume, high_volume; // volume at top & bottom of range
|
||||
} terrain_sound_band;
|
||||
|
||||
|
@ -273,7 +273,7 @@ struct {
|
||||
#define CDI_CANNED 1
|
||||
|
||||
typedef struct {
|
||||
ubyte cinematic_type; // canned/not canned
|
||||
uint8_t cinematic_type; // canned/not canned
|
||||
int camera_objhandle; // object handle for camera to use
|
||||
|
||||
char *text_string; // not canned text string
|
||||
@ -1300,7 +1300,7 @@ void Cinematic_DrawText(void) {
|
||||
case GCF_TEXT_WIPEIN: {
|
||||
// first 1/3 is alpha in
|
||||
// last 2/3 is solid
|
||||
ubyte alpha = 0;
|
||||
uint8_t alpha = 0;
|
||||
|
||||
if (perc > 0.33f) {
|
||||
// middle 1/3
|
||||
@ -1308,7 +1308,7 @@ void Cinematic_DrawText(void) {
|
||||
} else if (perc <= 0.33f) {
|
||||
// first 1/3
|
||||
float new_p = perc / 0.33f;
|
||||
alpha = (ubyte)(new_p * 255.0f);
|
||||
alpha = (uint8_t)(new_p * 255.0f);
|
||||
}
|
||||
grtext_SetAlpha(alpha);
|
||||
|
||||
@ -1362,7 +1362,7 @@ void Cinematic_DrawText(void) {
|
||||
// first 1/3 is alpha in
|
||||
// middle 1/3 is solid
|
||||
// last 1/3 is alpha out
|
||||
ubyte alpha;
|
||||
uint8_t alpha;
|
||||
|
||||
if (perc > 0.33f && perc <= 0.66f) {
|
||||
// middle 1/3
|
||||
@ -1370,7 +1370,7 @@ void Cinematic_DrawText(void) {
|
||||
} else if (perc <= 0.33f) {
|
||||
// first 1/3
|
||||
float new_p = perc / 0.33f;
|
||||
alpha = (ubyte)(new_p * 255.0f);
|
||||
alpha = (uint8_t)(new_p * 255.0f);
|
||||
} else {
|
||||
// last 1/3
|
||||
float new_p = (perc - 0.66f) / 0.33f;
|
||||
@ -1378,7 +1378,7 @@ void Cinematic_DrawText(void) {
|
||||
new_p = 0.0f;
|
||||
if (new_p > 1.0f)
|
||||
new_p = 1.0f;
|
||||
alpha = (ubyte)(255.0f - (new_p * 255.0f));
|
||||
alpha = (uint8_t)(255.0f - (new_p * 255.0f));
|
||||
}
|
||||
grtext_SetAlpha(alpha);
|
||||
|
||||
@ -2208,20 +2208,20 @@ void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle) {
|
||||
//==================================================
|
||||
// Demo file support
|
||||
//==================================================
|
||||
static void mf_WriteInt(ubyte *buffer, int *pointer, int data);
|
||||
static void mf_WriteShort(ubyte *buffer, int *pointer, short data);
|
||||
static void mf_WriteByte(ubyte *buffer, int *pointer, ubyte data);
|
||||
static void mf_WriteFloat(ubyte *buffer, int *pointer, float data);
|
||||
static void mf_WriteBytes(ubyte *buffer, int *pointer, ubyte *data, int len);
|
||||
static void mf_WriteString(ubyte *buffer, int *pointer, const char *string);
|
||||
static int mf_ReadInt(ubyte *buffer, int *pointer);
|
||||
static short mf_ReadShort(ubyte *buffer, int *pointer);
|
||||
static ubyte mf_ReadByte(ubyte *buffer, int *pointer);
|
||||
static float mf_ReadFloat(ubyte *buffer, int *pointer);
|
||||
static void mf_ReadBytes(ubyte *buffer, int *pointer, ubyte *data, int len);
|
||||
static void mf_ReadString(ubyte *buffer, int *pointer, char *string);
|
||||
static void mf_WriteInt(uint8_t *buffer, int *pointer, int data);
|
||||
static void mf_WriteShort(uint8_t *buffer, int *pointer, short data);
|
||||
static void mf_WriteByte(uint8_t *buffer, int *pointer, uint8_t data);
|
||||
static void mf_WriteFloat(uint8_t *buffer, int *pointer, float data);
|
||||
static void mf_WriteBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len);
|
||||
static void mf_WriteString(uint8_t *buffer, int *pointer, const char *string);
|
||||
static int mf_ReadInt(uint8_t *buffer, int *pointer);
|
||||
static short mf_ReadShort(uint8_t *buffer, int *pointer);
|
||||
static uint8_t mf_ReadByte(uint8_t *buffer, int *pointer);
|
||||
static float mf_ReadFloat(uint8_t *buffer, int *pointer);
|
||||
static void mf_ReadBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len);
|
||||
static void mf_ReadString(uint8_t *buffer, int *pointer, char *string);
|
||||
|
||||
void Cinematic_DoDemoFileData(ubyte *buffer) {
|
||||
void Cinematic_DoDemoFileData(uint8_t *buffer) {
|
||||
int count = 0;
|
||||
char text_string[512];
|
||||
tCannedCinematicInfo canned_data;
|
||||
@ -2316,7 +2316,7 @@ void Cinematic_DoDemoFileData(ubyte *buffer) {
|
||||
}
|
||||
|
||||
void Cinematic_WriteDemoFileData(tCinematicDemoInfo *info) {
|
||||
ubyte buffer[1500];
|
||||
uint8_t buffer[1500];
|
||||
int count = 0;
|
||||
|
||||
// what kind of cinematic are we saving
|
||||
@ -2410,32 +2410,32 @@ void Cinematic_WriteDemoFileData(tCinematicDemoInfo *info) {
|
||||
DemoWriteCinematics(buffer, count);
|
||||
}
|
||||
|
||||
void mf_WriteInt(ubyte *buffer, int *pointer, int data) {
|
||||
void mf_WriteInt(uint8_t *buffer, int *pointer, int data) {
|
||||
memcpy(&buffer[(*pointer)], &data, sizeof(int));
|
||||
(*pointer) += sizeof(int);
|
||||
}
|
||||
|
||||
void mf_WriteShort(ubyte *buffer, int *pointer, short data) {
|
||||
void mf_WriteShort(uint8_t *buffer, int *pointer, short data) {
|
||||
memcpy(&buffer[(*pointer)], &data, sizeof(short));
|
||||
(*pointer) += sizeof(short);
|
||||
}
|
||||
|
||||
void mf_WriteByte(ubyte *buffer, int *pointer, ubyte data) {
|
||||
memcpy(&buffer[(*pointer)], &data, sizeof(ubyte));
|
||||
(*pointer) += sizeof(ubyte);
|
||||
void mf_WriteByte(uint8_t *buffer, int *pointer, uint8_t data) {
|
||||
memcpy(&buffer[(*pointer)], &data, sizeof(uint8_t));
|
||||
(*pointer) += sizeof(uint8_t);
|
||||
}
|
||||
|
||||
void mf_WriteFloat(ubyte *buffer, int *pointer, float data) {
|
||||
void mf_WriteFloat(uint8_t *buffer, int *pointer, float data) {
|
||||
memcpy(&buffer[(*pointer)], &data, sizeof(float));
|
||||
(*pointer) += sizeof(float);
|
||||
}
|
||||
|
||||
void mf_WriteBytes(ubyte *buffer, int *pointer, ubyte *data, int len) {
|
||||
void mf_WriteBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len) {
|
||||
memcpy(&buffer[(*pointer)], data, len);
|
||||
(*pointer) += len;
|
||||
}
|
||||
|
||||
void mf_WriteString(ubyte *buffer, int *pointer, const char *string) {
|
||||
void mf_WriteString(uint8_t *buffer, int *pointer, const char *string) {
|
||||
while (*string) {
|
||||
mf_WriteByte(buffer, pointer, (*string));
|
||||
string++;
|
||||
@ -2443,41 +2443,41 @@ void mf_WriteString(ubyte *buffer, int *pointer, const char *string) {
|
||||
mf_WriteByte(buffer, pointer, (*string));
|
||||
}
|
||||
|
||||
int mf_ReadInt(ubyte *buffer, int *pointer) {
|
||||
int mf_ReadInt(uint8_t *buffer, int *pointer) {
|
||||
int value;
|
||||
memcpy(&value, &buffer[(*pointer)], sizeof(value));
|
||||
(*pointer) += sizeof(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
short mf_ReadShort(ubyte *buffer, int *pointer) {
|
||||
short mf_ReadShort(uint8_t *buffer, int *pointer) {
|
||||
short value;
|
||||
memcpy(&value, &buffer[(*pointer)], sizeof(value));
|
||||
(*pointer) += sizeof(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
ubyte mf_ReadByte(ubyte *buffer, int *pointer) {
|
||||
ubyte value;
|
||||
uint8_t mf_ReadByte(uint8_t *buffer, int *pointer) {
|
||||
uint8_t value;
|
||||
memcpy(&value, &buffer[(*pointer)], sizeof(value));
|
||||
(*pointer) += sizeof(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
float mf_ReadFloat(ubyte *buffer, int *pointer) {
|
||||
float mf_ReadFloat(uint8_t *buffer, int *pointer) {
|
||||
float value;
|
||||
memcpy(&value, &buffer[(*pointer)], sizeof(value));
|
||||
(*pointer) += sizeof(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
void mf_ReadBytes(ubyte *buffer, int *pointer, ubyte *data, int len) {
|
||||
void mf_ReadBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len) {
|
||||
memcpy(data, &buffer[(*pointer)], len);
|
||||
(*pointer) += len;
|
||||
}
|
||||
|
||||
void mf_ReadString(ubyte *buffer, int *pointer, char *string) {
|
||||
ubyte data;
|
||||
void mf_ReadString(uint8_t *buffer, int *pointer, char *string) {
|
||||
uint8_t data;
|
||||
data = mf_ReadByte(buffer, pointer);
|
||||
while (data) {
|
||||
*string = data;
|
||||
|
@ -101,6 +101,6 @@ tHUDMode Cinematic_GetOldHudMode(void);
|
||||
// Only the demo system passing in a camera_handle, so it should never be explicitly passed by you
|
||||
void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle = -1);
|
||||
|
||||
void Cinematic_DoDemoFileData(ubyte *data);
|
||||
void Cinematic_DoDemoFileData(uint8_t *data);
|
||||
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ typedef struct game_event {
|
||||
int type;
|
||||
int id;
|
||||
int objhandle_detonator; // watch this object, if it dies/gets killed than cancel this game event
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
float start_time, end_time;
|
||||
int frame_born;
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
typedef struct {
|
||||
char name[PAGENAME_LEN];
|
||||
char dir_name[PAGENAME_LEN];
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
} gamefile;
|
||||
|
||||
extern int Num_gamefiles;
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
node *pathnodes;
|
||||
int num_nodes; // how many nodes in this path?
|
||||
char name[PAGENAME_LEN]; // the name of this path
|
||||
ubyte flags; // special properties of this path
|
||||
uint8_t flags; // special properties of this path
|
||||
bool used; // if this path is in use
|
||||
};
|
||||
|
||||
|
@ -737,7 +737,7 @@ bool SaveGameState(const char *pathname, const char *description) {
|
||||
START_VERIFY_SAVEFILE(fp);
|
||||
ASSERT(strlen(description) < sizeof(buf));
|
||||
strcpy(buf, description);
|
||||
cf_WriteBytes((ubyte *)buf, sizeof(buf), fp);
|
||||
cf_WriteBytes((uint8_t *)buf, sizeof(buf), fp);
|
||||
cf_WriteShort(fp, GAMESAVE_VERSION);
|
||||
|
||||
SGSSnapshot(fp); // Save snapshot? MUST KEEP THIS HERE.
|
||||
@ -771,7 +771,7 @@ bool SaveGameState(const char *pathname, const char *description) {
|
||||
// cf_WriteInt(fp,Times_game_restored);
|
||||
// Save weather
|
||||
cf_WriteInt(fp, sizeof(Weather));
|
||||
cf_WriteBytes((ubyte *)&Weather, sizeof(Weather), fp);
|
||||
cf_WriteBytes((uint8_t *)&Weather, sizeof(Weather), fp);
|
||||
|
||||
// Save active doorways
|
||||
cf_WriteInt(fp, MAX_ACTIVE_DOORWAYS);
|
||||
@ -878,7 +878,7 @@ void SGSXlateTables(CFILE *fp) {
|
||||
END_VERIFY_SAVEFILE(fp, "Xlate save");
|
||||
}
|
||||
|
||||
extern ubyte AutomapVisMap[MAX_ROOMS];
|
||||
extern uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
// initializes rooms
|
||||
void SGSRooms(CFILE *fp) {
|
||||
int i, f, p;
|
||||
@ -968,7 +968,7 @@ void SGSPlayers(CFILE *fp) {
|
||||
player *plr = &Players[0];
|
||||
|
||||
gs_WriteShort(fp, sizeof(player));
|
||||
cf_WriteBytes((ubyte *)plr, sizeof(player), fp);
|
||||
cf_WriteBytes((uint8_t *)plr, sizeof(player), fp);
|
||||
if (plr->guided_obj)
|
||||
gs_WriteInt(fp, plr->guided_obj->handle);
|
||||
|
||||
@ -990,7 +990,7 @@ void SGSVisEffects(CFILE *fp) {
|
||||
|
||||
for (i = 0; i <= Highest_vis_effect_index; i++) {
|
||||
if (VisEffects[i].type != VIS_NONE)
|
||||
cf_WriteBytes((ubyte *)&VisEffects[i], sizeof(vis_effect), fp);
|
||||
cf_WriteBytes((uint8_t *)&VisEffects[i], sizeof(vis_effect), fp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1014,7 +1014,7 @@ void SGSObjects(CFILE *fp) {
|
||||
cf_WriteShort(fp, (short)MAX_PLAYERS * 2);
|
||||
for (i = 0; i < MAX_PLAYERS * 2; i++) {
|
||||
cf_WriteShort(fp, strlen(MarkerMessages[i]) + 1);
|
||||
cf_WriteBytes((ubyte *)MarkerMessages[i], strlen(MarkerMessages[i]) + 1, fp);
|
||||
cf_WriteBytes((uint8_t *)MarkerMessages[i], strlen(MarkerMessages[i]) + 1, fp);
|
||||
}
|
||||
|
||||
// this method should maintain the object list as it currently stands in the level
|
||||
@ -1070,7 +1070,7 @@ void SGSObjects(CFILE *fp) {
|
||||
// Store whether or not we have a pointer to lighting_info
|
||||
gs_WriteByte(fp, op->lighting_info ? 1 : 0);
|
||||
if (op->lighting_info) {
|
||||
cf_WriteBytes((ubyte *)op->lighting_info, sizeof(*op->lighting_info), fp);
|
||||
cf_WriteBytes((uint8_t *)op->lighting_info, sizeof(*op->lighting_info), fp);
|
||||
}
|
||||
|
||||
// these objects FOR NOW won't be saved
|
||||
@ -1090,7 +1090,7 @@ void SGSObjects(CFILE *fp) {
|
||||
ii = (op->name) ? strlen(op->name) : 0;
|
||||
gs_WriteByte(fp, ii);
|
||||
if (ii > 0)
|
||||
cf_WriteBytes((ubyte *)op->name, ii, fp);
|
||||
cf_WriteBytes((uint8_t *)op->name, ii, fp);
|
||||
|
||||
// data universal to all objects that need to be saved.
|
||||
gs_WriteShort(fp, (short)op->id);
|
||||
@ -1153,12 +1153,12 @@ void SGSObjects(CFILE *fp) {
|
||||
ii = (op->custom_default_script_name) ? strlen(op->custom_default_script_name) : 0;
|
||||
gs_WriteByte(fp, ii);
|
||||
if (ii > 0)
|
||||
cf_WriteBytes((ubyte *)op->custom_default_script_name, ii, fp);
|
||||
cf_WriteBytes((uint8_t *)op->custom_default_script_name, ii, fp);
|
||||
|
||||
ii = (op->custom_default_module_name) ? strlen(op->custom_default_module_name) : 0;
|
||||
gs_WriteByte(fp, ii);
|
||||
if (ii > 0)
|
||||
cf_WriteBytes((ubyte *)op->custom_default_module_name, ii, fp);
|
||||
cf_WriteBytes((uint8_t *)op->custom_default_module_name, ii, fp);
|
||||
|
||||
INSURE_SAVEFILE;
|
||||
|
||||
@ -1169,13 +1169,13 @@ void SGSObjects(CFILE *fp) {
|
||||
// write out all structures here.
|
||||
// movement info.
|
||||
gs_WriteShort(fp, sizeof(op->mtype));
|
||||
cf_WriteBytes((ubyte *)&op->mtype, sizeof(op->mtype), fp);
|
||||
cf_WriteBytes((uint8_t *)&op->mtype, sizeof(op->mtype), fp);
|
||||
|
||||
INSURE_SAVEFILE;
|
||||
|
||||
// Control info, determined by CONTROL_TYPE
|
||||
gs_WriteShort(fp, sizeof(op->ctype));
|
||||
cf_WriteBytes((ubyte *)&op->ctype, sizeof(op->ctype), fp);
|
||||
cf_WriteBytes((uint8_t *)&op->ctype, sizeof(op->ctype), fp);
|
||||
|
||||
INSURE_SAVEFILE;
|
||||
|
||||
@ -1185,14 +1185,14 @@ void SGSObjects(CFILE *fp) {
|
||||
INSURE_SAVEFILE;
|
||||
// save out rendering information
|
||||
gs_WriteShort(fp, sizeof(op->rtype));
|
||||
cf_WriteBytes((ubyte *)&op->rtype, sizeof(op->rtype), fp);
|
||||
cf_WriteBytes((uint8_t *)&op->rtype, sizeof(op->rtype), fp);
|
||||
|
||||
cf_WriteFloat(fp, op->size);
|
||||
if (op->render_type == RT_POLYOBJ) {
|
||||
// Do Animation stuff
|
||||
custom_anim multi_anim_info;
|
||||
ObjGetAnimUpdate(i, &multi_anim_info);
|
||||
cf_WriteBytes((ubyte *)&multi_anim_info, sizeof(multi_anim_info), fp);
|
||||
cf_WriteBytes((uint8_t *)&multi_anim_info, sizeof(multi_anim_info), fp);
|
||||
}
|
||||
|
||||
INSURE_SAVEFILE;
|
||||
@ -1224,7 +1224,7 @@ void SGSObjAI(CFILE *fp, const ai_frame *ai) {
|
||||
return;
|
||||
|
||||
gs_WriteShort(fp, sizeof(ai_frame));
|
||||
cf_WriteBytes((ubyte *)ai, sizeof(ai_frame), fp);
|
||||
cf_WriteBytes((uint8_t *)ai, sizeof(ai_frame), fp);
|
||||
}
|
||||
|
||||
// saves script
|
||||
@ -1270,7 +1270,7 @@ void SGSObjEffects(CFILE *fp, const object *op) {
|
||||
gs_WriteByte(fp, (ei ? 1 : 0));
|
||||
if (ei) {
|
||||
gs_WriteShort(fp, sizeof(effect_info_s));
|
||||
cf_WriteBytes((ubyte *)ei, sizeof(effect_info_s), fp);
|
||||
cf_WriteBytes((uint8_t *)ei, sizeof(effect_info_s), fp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1282,7 +1282,7 @@ void SGSObjWB(CFILE *fp, object *op, int num_wbs) {
|
||||
gs_WriteByte(fp, (int8_t)num_wbs);
|
||||
for (i = 0; i < num_wbs; i++) {
|
||||
dynamic_wb_info *dwb = &op->dynamic_wb[i];
|
||||
cf_WriteBytes((ubyte *)dwb, sizeof(dynamic_wb_info), fp);
|
||||
cf_WriteBytes((uint8_t *)dwb, sizeof(dynamic_wb_info), fp);
|
||||
}
|
||||
} else {
|
||||
gs_WriteByte(fp, 0);
|
||||
@ -1300,7 +1300,7 @@ void SGSSpew(CFILE *fp) {
|
||||
for (i = 0; i < MAX_SPEW_EFFECTS; i++) {
|
||||
gs_WriteByte(fp, SpewEffects[i].inuse ? true : false);
|
||||
if (SpewEffects[i].inuse)
|
||||
cf_WriteBytes((ubyte *)&SpewEffects[i], sizeof(spewinfo), fp);
|
||||
cf_WriteBytes((uint8_t *)&SpewEffects[i], sizeof(spewinfo), fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ int LGSObjEffects(CFILE *fp, object *op);
|
||||
int LGSObjWB(CFILE *fp, object *op);
|
||||
|
||||
// loads script
|
||||
//@@vector *LGSScript(CFILE *fp, script_info *script, ubyte *is_scripted, int *memsize);
|
||||
//@@vector *LGSScript(CFILE *fp, script_info *script, uint8_t *is_scripted, int *memsize);
|
||||
|
||||
// loads special object info
|
||||
int LGSObjSpecial(CFILE *fp, object *op);
|
||||
|
@ -1135,9 +1135,9 @@ void PageInGeneric(int);
|
||||
void PageInShip(int);
|
||||
|
||||
// Data allocation arrays, for keeping track of what textures/sounds are level specific
|
||||
ubyte Models_to_free[MAX_POLY_MODELS];
|
||||
ubyte Textures_to_free[MAX_TEXTURES];
|
||||
ubyte Sounds_to_free[MAX_TEXTURES];
|
||||
uint8_t Models_to_free[MAX_POLY_MODELS];
|
||||
uint8_t Textures_to_free[MAX_TEXTURES];
|
||||
uint8_t Sounds_to_free[MAX_TEXTURES];
|
||||
|
||||
#ifdef EDITOR
|
||||
extern vector editor_player_pos;
|
||||
|
@ -248,14 +248,14 @@
|
||||
#define PROC_MEMORY_TYPE_WATER 2
|
||||
|
||||
typedef struct {
|
||||
ubyte type;
|
||||
uint8_t type;
|
||||
|
||||
ubyte frequency;
|
||||
ubyte speed;
|
||||
ubyte color;
|
||||
ubyte size;
|
||||
uint8_t frequency;
|
||||
uint8_t speed;
|
||||
uint8_t color;
|
||||
uint8_t size;
|
||||
|
||||
ubyte x1, y1, x2, y2;
|
||||
uint8_t x1, y1, x2, y2;
|
||||
|
||||
} static_proc_element;
|
||||
|
||||
@ -269,16 +269,16 @@ typedef struct {
|
||||
static_proc_element *static_proc_elements;
|
||||
ushort num_static_elements;
|
||||
|
||||
ubyte memory_type;
|
||||
uint8_t memory_type;
|
||||
|
||||
ubyte heat;
|
||||
ubyte thickness;
|
||||
ubyte light;
|
||||
uint8_t heat;
|
||||
uint8_t thickness;
|
||||
uint8_t light;
|
||||
|
||||
float last_evaluation_time;
|
||||
float evaluation_time;
|
||||
float osc_time;
|
||||
ubyte osc_value;
|
||||
uint8_t osc_value;
|
||||
|
||||
int last_procedural_frame; // last frame a procedural was calculated for this texture
|
||||
} proc_struct;
|
||||
@ -303,8 +303,8 @@ typedef struct {
|
||||
float sound_volume; // The volume for this texture's sound
|
||||
|
||||
short bumpmap; // The bumpmap for this texture, or -1 if there is none
|
||||
ubyte corona_type; // what type of corona this thing uses
|
||||
ubyte used; // is this texture free to be allocated?
|
||||
uint8_t corona_type; // what type of corona this thing uses
|
||||
uint8_t used; // is this texture free to be allocated?
|
||||
|
||||
} texture;
|
||||
|
||||
|
@ -292,16 +292,16 @@ static void RenderAfterburnMonitor(tGauge *gauge, bool modified);
|
||||
static void DrawGaugeMonitor(g3Point *pts, int bm, float brightness, float *alphas);
|
||||
|
||||
// renders a square texture onto the screen.
|
||||
static void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, ubyte alpha, bool saturate);
|
||||
static void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, uint8_t alpha, bool saturate);
|
||||
|
||||
// renders a square texture onto the screen.
|
||||
static void DrawGaugeQuad(g3Point *pts, int bm, ubyte alpha = 255, bool saturate = false);
|
||||
static void DrawGaugeQuad(g3Point *pts, int bm, uint8_t alpha = 255, bool saturate = false);
|
||||
|
||||
// renders a flat poly onto the screen with given color
|
||||
static void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, ubyte alpha);
|
||||
static void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, uint8_t alpha);
|
||||
|
||||
// renders a flat poly onto the screen with 4 colors (for each vertex)
|
||||
static void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, ubyte alpha);
|
||||
static void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, uint8_t alpha);
|
||||
|
||||
// correctly orders monitor vertices based off of UVs
|
||||
static int GetFirstVert(bsp_info *sm);
|
||||
@ -726,7 +726,7 @@ void RenderShipMonitor(tGauge *gauge, bool modified) {
|
||||
if (!gauge->functional)
|
||||
return;
|
||||
|
||||
ubyte alpha = 255;
|
||||
uint8_t alpha = 255;
|
||||
if (Objects[Players[Player_num].objnum].effect_info->type_flags & EF_CLOAKED) {
|
||||
float time_frame = Objects[Players[Player_num].objnum].effect_info->cloak_time;
|
||||
if (time_frame < HUD_CLOAKEND_TIME) {
|
||||
@ -745,7 +745,7 @@ void RenderShipMonitor(tGauge *gauge, bool modified) {
|
||||
g3_GetUnscaledMatrix(&view_matrix);
|
||||
|
||||
float inv_time_frame = (Gametime - (int)Gametime);
|
||||
float inv_alpha = (ubyte)(255 * (1.0f - (inv_time_frame / 2.0f)));
|
||||
float inv_alpha = (uint8_t)(255 * (1.0f - (inv_time_frame / 2.0f)));
|
||||
g3Point invpts[4];
|
||||
int i;
|
||||
|
||||
@ -843,12 +843,12 @@ void DrawGaugeMonitor(g3Point *pts, int bm, float brightness, float *alphas) {
|
||||
}
|
||||
|
||||
// renders a square texture onto the screen.
|
||||
void DrawGaugeQuad(g3Point *pts, int bm, ubyte alpha, bool saturate) {
|
||||
void DrawGaugeQuad(g3Point *pts, int bm, uint8_t alpha, bool saturate) {
|
||||
DrawGaugeQuad(pts, bm, 0, 0, 1, 1, alpha, saturate);
|
||||
}
|
||||
|
||||
// renders a square texture onto the screen.
|
||||
void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, ubyte alpha, bool saturate) {
|
||||
void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, uint8_t alpha, bool saturate) {
|
||||
g3Point *pntlist[4];
|
||||
g3Point pnts[4];
|
||||
|
||||
@ -887,14 +887,14 @@ void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1,
|
||||
}
|
||||
|
||||
// renders a flat poly onto the screen with given color
|
||||
void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, ubyte alpha) {
|
||||
void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, uint8_t alpha) {
|
||||
float ar[4] = {r, r, r, r}, ag[4] = {g, g, g, g}, ab[4] = {b, b, b, b};
|
||||
|
||||
DrawGaugeQuadFlat(pts, ar, ag, ab, alpha);
|
||||
}
|
||||
|
||||
// renders a flat poly onto the screen with 4 colors (for each vertex)
|
||||
void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, ubyte alpha) {
|
||||
void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, uint8_t alpha) {
|
||||
g3Point *pntlist[4];
|
||||
g3Point pnts[4];
|
||||
|
||||
|
@ -509,8 +509,8 @@ void CreateWindowMap(const char *map, int width, int height, windowmap_t *wndmap
|
||||
// TODO: MTS: only used in this file
|
||||
// Loads a tga or ogf file into a bitmap...returns handle to bm or -1 on error, and fills in the alphamap
|
||||
int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) {
|
||||
ubyte image_id_len, color_map_type, image_type, pixsize, descriptor;
|
||||
ubyte upside_down = 0;
|
||||
uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor;
|
||||
uint8_t upside_down = 0;
|
||||
ushort width, height;
|
||||
uint32_t pixel;
|
||||
int i, t, n;
|
||||
|
@ -589,8 +589,8 @@ void InitShipHUD(int ship) {
|
||||
HUD_resources.invpulse_bmp = -1;
|
||||
|
||||
// sets current hud mode static global
|
||||
// DAJ Current_pilot.get_hud_data((ubyte *)&Hud_mode);
|
||||
ubyte hud_tmp;
|
||||
// DAJ Current_pilot.get_hud_data((uint8_t *)&Hud_mode);
|
||||
uint8_t hud_tmp;
|
||||
Current_pilot.get_hud_data(&hud_tmp);
|
||||
Hud_mode = (tHUDMode)hud_tmp;
|
||||
}
|
||||
@ -759,8 +759,8 @@ redo_hud_switch:
|
||||
// save out current hud mode
|
||||
// JEFF: (only if going from HUD_FULLSCREEN->HUD_COCKPIT or vice-versa)
|
||||
if ((Hud_mode == HUD_FULLSCREEN && mode == HUD_COCKPIT) || (Hud_mode == HUD_COCKPIT && mode == HUD_FULLSCREEN)) {
|
||||
ubyte bmode = mode; // DAJ MAC using enums always int
|
||||
Current_pilot.set_hud_data((ubyte *)&bmode);
|
||||
uint8_t bmode = mode; // DAJ MAC using enums always int
|
||||
Current_pilot.set_hud_data((uint8_t *)&bmode);
|
||||
mprintf((0, "Saving new hud mode to pilot\n"));
|
||||
PltWriteFile(&Current_pilot);
|
||||
}
|
||||
@ -980,7 +980,7 @@ bool LGSHudState(CFILE *fp) {
|
||||
|
||||
while ((stat_mask = (ushort)cf_ReadShort(fp)) != 0) {
|
||||
tHUDItem huditem;
|
||||
ubyte item_type = (ubyte)cf_ReadByte(fp);
|
||||
uint8_t item_type = (uint8_t)cf_ReadByte(fp);
|
||||
|
||||
memset(&huditem, 0, sizeof(huditem));
|
||||
huditem.type = item_type;
|
||||
@ -995,7 +995,7 @@ bool LGSHudState(CFILE *fp) {
|
||||
huditem.y = cf_ReadShort(fp);
|
||||
huditem.color = (ddgr_color)cf_ReadInt(fp);
|
||||
huditem.flags = (ushort)cf_ReadShort(fp);
|
||||
huditem.alpha = (ubyte)cf_ReadByte(fp);
|
||||
huditem.alpha = (uint8_t)cf_ReadByte(fp);
|
||||
|
||||
huditem.buffer_size = (int)cf_ReadShort(fp);
|
||||
huditem.render_fn = NULL; // use pointer to function void (*fn)(struct tHUDItem *)
|
||||
@ -1013,7 +1013,7 @@ bool LGSHudState(CFILE *fp) {
|
||||
huditem.y = cf_ReadShort(fp);
|
||||
huditem.color = (ddgr_color)cf_ReadInt(fp);
|
||||
huditem.flags = (ushort)cf_ReadShort(fp);
|
||||
huditem.alpha = (ubyte)cf_ReadByte(fp);
|
||||
huditem.alpha = (uint8_t)cf_ReadByte(fp);
|
||||
|
||||
huditem.data.timer_handle = cf_ReadInt(fp);
|
||||
huditem.render_fn = RenderHUDTimer; // use pointer to function void (*fn)(struct tHUDItem *)
|
||||
@ -1340,7 +1340,7 @@ void RenderAuxHUDFrame() {
|
||||
char *GetControllerBindingText(int fidcont) {
|
||||
static char *cont_bind_txt;
|
||||
ct_type ctype[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags[CTLBINDS_PER_FUNC];
|
||||
ct_config_data cfgdata;
|
||||
tCfgDataParts cfgparts;
|
||||
if (-1 == fidcont)
|
||||
@ -1352,8 +1352,8 @@ char *GetControllerBindingText(int fidcont) {
|
||||
|
||||
Controller->get_controller_function(Cfg_joy_elements[fidcont].fn_id, ctype, &cfgdata, cfgflags);
|
||||
parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata);
|
||||
ubyte one_binding = cfgparts.bind_0;
|
||||
ubyte one_ctrlbind = cfgparts.ctrl_0;
|
||||
uint8_t one_binding = cfgparts.bind_0;
|
||||
uint8_t one_ctrlbind = cfgparts.ctrl_0;
|
||||
|
||||
cont_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding);
|
||||
return cont_bind_txt;
|
||||
@ -1362,7 +1362,7 @@ char *GetControllerBindingText(int fidcont) {
|
||||
char *GetKeyBindingText(int fidkey) {
|
||||
static char *key_bind_txt;
|
||||
ct_type ctype[CTLBINDS_PER_FUNC];
|
||||
ubyte cfgflags[CTLBINDS_PER_FUNC];
|
||||
uint8_t cfgflags[CTLBINDS_PER_FUNC];
|
||||
ct_config_data cfgdata;
|
||||
tCfgDataParts cfgparts;
|
||||
if (-1 == fidkey)
|
||||
@ -1374,8 +1374,8 @@ char *GetKeyBindingText(int fidkey) {
|
||||
|
||||
Controller->get_controller_function(Cfg_key_elements[fidkey].fn_id, ctype, &cfgdata, cfgflags);
|
||||
parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata);
|
||||
ubyte one_binding = cfgparts.bind_0;
|
||||
ubyte one_ctrlbind = cfgparts.ctrl_0;
|
||||
uint8_t one_binding = cfgparts.bind_0;
|
||||
uint8_t one_ctrlbind = cfgparts.ctrl_0;
|
||||
|
||||
key_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding);
|
||||
return key_bind_txt;
|
||||
@ -2152,9 +2152,9 @@ void LoadHudConfig(const char *filename, bool (*fn)(const char*, const char *, v
|
||||
tHUDItem hud_item;
|
||||
char operand[INFFILE_LINELEN]; // operand
|
||||
bool txpos = false, typos = false;
|
||||
ubyte r=GR_COLOR_RED(HUD_COLOR);
|
||||
ubyte g=GR_COLOR_GREEN(HUD_COLOR);
|
||||
ubyte b=GR_COLOR_BLUE(HUD_COLOR);
|
||||
uint8_t r=GR_COLOR_RED(HUD_COLOR);
|
||||
uint8_t g=GR_COLOR_GREEN(HUD_COLOR);
|
||||
uint8_t b=GR_COLOR_BLUE(HUD_COLOR);
|
||||
|
||||
// start over.
|
||||
ResetHud();
|
||||
@ -2178,9 +2178,9 @@ void LoadHudConfig(const char *filename, bool (*fn)(const char*, const char *, v
|
||||
switch (cmd)
|
||||
{
|
||||
case HUDCMD_TYPE: hud_item.type = atoi(operand); break;
|
||||
case HUDCMD_RED: r=(ubyte)atoi(operand); break;
|
||||
case HUDCMD_GREEN: g=(ubyte)atoi(operand); break;
|
||||
case HUDCMD_BLUE: b=(ubyte)atoi(operand); break;
|
||||
case HUDCMD_RED: r=(uint8_t)atoi(operand); break;
|
||||
case HUDCMD_GREEN: g=(uint8_t)atoi(operand); break;
|
||||
case HUDCMD_BLUE: b=(uint8_t)atoi(operand); break;
|
||||
case HUDCMD_X: hud_item.x = atoi(operand); break;
|
||||
case HUDCMD_Y: hud_item.y = atoi(operand); break;
|
||||
case HUDCMD_TX: hud_item.tx = atoi(operand); txpos = true; break;
|
||||
|
@ -474,13 +474,13 @@ typedef struct tHUDItem {
|
||||
short tx, ty; // text version x and y.
|
||||
float grscalex, grscaley; // used to scale graphics.
|
||||
|
||||
ubyte id; // id number.
|
||||
ubyte type; // custom of predefined hud item type.
|
||||
uint8_t id; // id number.
|
||||
uint8_t type; // custom of predefined hud item type.
|
||||
ushort stat; // stat mask (what class of hud items does this one belong to)
|
||||
|
||||
ushort flags; // more flags.
|
||||
ubyte alpha; // alpha of hud item
|
||||
ubyte saturation_count; // how saturated is this hud item (how bright).
|
||||
uint8_t alpha; // alpha of hud item
|
||||
uint8_t saturation_count; // how saturated is this hud item (how bright).
|
||||
|
||||
ddgr_color color; // color of hud item.
|
||||
ddgr_color tcolor; // text color of item.
|
||||
@ -594,17 +594,17 @@ int RenderHUDGetTextLineWidth(const char *string);
|
||||
int RenderHUDGetTextHeight(const char *string);
|
||||
|
||||
// renders a bitmap onto the hud
|
||||
void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, ubyte alpha,
|
||||
void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, uint8_t alpha,
|
||||
int sat_count = 0);
|
||||
|
||||
// renders text, scaled, alphaed, saturated,
|
||||
void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...);
|
||||
void RenderHUDText(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...);
|
||||
|
||||
// flags for RenderHudText.
|
||||
#define HUDTEXT_CENTERED 1
|
||||
|
||||
// renders text, scaled, alphaed, saturated,
|
||||
void RenderHUDTextFlags(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...);
|
||||
void RenderHUDTextFlags(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...);
|
||||
|
||||
// reset hud messages.
|
||||
void ResetHUDMessages();
|
||||
@ -651,7 +651,7 @@ struct tMsgList {
|
||||
|
||||
tMsgList();
|
||||
void set_limit(int limit) { m_limit = limit; };
|
||||
bool add(const char *msg, ubyte lvl = 0, ubyte hr = 0, ubyte min = 0, ubyte sec = 0);
|
||||
bool add(const char *msg, uint8_t lvl = 0, uint8_t hr = 0, uint8_t min = 0, uint8_t sec = 0);
|
||||
const char *get(int i);
|
||||
void reset();
|
||||
};
|
||||
|
@ -285,7 +285,7 @@ static inline int get_weapon_icon(int player, int type) {
|
||||
return HUD_resources.wpn_bmp;
|
||||
}
|
||||
|
||||
static void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *str);
|
||||
static void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *str);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Hud item display routines.
|
||||
@ -701,7 +701,7 @@ void RenderHUDSecondary(tHUDItem *item) {
|
||||
|
||||
void RenderHUDShipStatus(tHUDItem *item) {
|
||||
float clk_time_frame, inv_time_frame;
|
||||
ubyte clk_alpha = 0, inv_alpha;
|
||||
uint8_t clk_alpha = 0, inv_alpha;
|
||||
|
||||
// render text status
|
||||
if (Objects[Players[Player_num].objnum].effect_info->type_flags & EF_CLOAKED) {
|
||||
@ -858,7 +858,7 @@ int RenderHUDGetTextHeight(const char *string) {
|
||||
return (int)((str_height_curfont * aspect_y));
|
||||
}
|
||||
|
||||
void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, ubyte alpha,
|
||||
void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, uint8_t alpha,
|
||||
int sat_count) {
|
||||
int i;
|
||||
|
||||
@ -886,7 +886,7 @@ void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, flo
|
||||
}
|
||||
|
||||
// renders text, scaled, alphaed, saturated,
|
||||
void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...) {
|
||||
void RenderHUDText(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...) {
|
||||
std::va_list arglist;
|
||||
char buf[128];
|
||||
|
||||
@ -898,7 +898,7 @@ void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, con
|
||||
}
|
||||
|
||||
// renders text, scaled, alphaed, saturated,
|
||||
void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *str) {
|
||||
void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *str) {
|
||||
int i;
|
||||
|
||||
grtext_SetAlpha(alpha);
|
||||
@ -922,7 +922,7 @@ void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_
|
||||
}
|
||||
|
||||
// renders text, scaled, alphaed, saturated,
|
||||
void RenderHUDTextFlags(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...) {
|
||||
void RenderHUDTextFlags(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...) {
|
||||
std::va_list arglist;
|
||||
char buf[128];
|
||||
int i;
|
||||
@ -974,7 +974,7 @@ void RenderHUDScore(tHUDItem *item) {
|
||||
int text_height = grfont_GetHeight(HUD_FONT);
|
||||
snprintf(buf, sizeof(buf), "%d ", Score_added);
|
||||
w = RenderHUDGetTextLineWidth(buf); // * win_w/Game_window_w;
|
||||
ubyte alpha = std::min<float>(HUD_ALPHA, HUD_ALPHA * 4 * Score_added_timer / SCORE_ADDED_TIME);
|
||||
uint8_t alpha = std::min<float>(HUD_ALPHA, HUD_ALPHA * 4 * Score_added_timer / SCORE_ADDED_TIME);
|
||||
RenderHUDText(item->color, alpha, 0, item->x - w - win_w, item->y + text_height, buf);
|
||||
Score_added_timer -= Frametime;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ static tDirtyRect HUD_msg_dirty_rect;
|
||||
|
||||
static float Hud_timer = 0.0f;
|
||||
|
||||
static ubyte Hud_persistent_msg_id = HUD_INVALID_ID;
|
||||
static uint8_t Hud_persistent_msg_id = HUD_INVALID_ID;
|
||||
static float Hud_persistent_msg_timer = 0.0f;
|
||||
static int Hud_persistent_msg_flags = 0;
|
||||
static int Hud_persistent_msg_current_len;
|
||||
@ -1486,7 +1486,7 @@ void ResetGameMessages() {
|
||||
void AddGameMessage(const char *msg) {
|
||||
int secs = (int)Gametime;
|
||||
|
||||
Game_msg_list.add(msg, (ubyte)Current_mission.cur_level, (secs / 3600), (secs / 60), secs % 60);
|
||||
Game_msg_list.add(msg, (uint8_t)Current_mission.cur_level, (secs / 3600), (secs / 60), secs % 60);
|
||||
}
|
||||
|
||||
void SGSGameMessages(CFILE *fp) {
|
||||
@ -1547,7 +1547,7 @@ tMsgList::tMsgList() {
|
||||
m_msg = NULL;
|
||||
}
|
||||
|
||||
bool tMsgList::add(const char *msg, ubyte lvl, ubyte hr, ubyte min, ubyte sec) {
|
||||
bool tMsgList::add(const char *msg, uint8_t lvl, uint8_t hr, uint8_t min, uint8_t sec) {
|
||||
char buf[2048];
|
||||
|
||||
if (!m_limit)
|
||||
|
@ -682,7 +682,7 @@
|
||||
*
|
||||
* 113 8/27/98 6:23p Jeff
|
||||
* changed autoleveling in config so it is a slider...had to convert
|
||||
* global from bool->ubyte. Added fast headlight and mirrored surfaces to
|
||||
* global from bool->uint8_t. Added fast headlight and mirrored surfaces to
|
||||
* config menu
|
||||
*
|
||||
* 112 8/19/98 2:19p Jeff
|
||||
@ -1031,7 +1031,7 @@ static chunked_bitmap Title_bitmap;
|
||||
static bool Init_systems_init = false;
|
||||
static bool Graphics_init = false;
|
||||
static bool Title_bitmap_init = false;
|
||||
ubyte Use_motion_blur = 0;
|
||||
uint8_t Use_motion_blur = 0;
|
||||
|
||||
// The "root" directory of the D3 file tree
|
||||
char Base_directory[_MAX_PATH];
|
||||
@ -1195,12 +1195,12 @@ void SaveGameSettings() {
|
||||
// Write out force feedback
|
||||
Database->write("EnableJoystickFF", D3Use_force_feedback);
|
||||
Database->write("ForceFeedbackAutoCenter", D3Force_auto_center);
|
||||
ubyte force_gain;
|
||||
uint8_t force_gain;
|
||||
if (D3Force_gain < 0.0f)
|
||||
D3Force_gain = 0.0f;
|
||||
if (D3Force_gain > 1.0f)
|
||||
D3Force_gain = 1.0f;
|
||||
force_gain = (ubyte)((100.0f * D3Force_gain) + 0.5f);
|
||||
force_gain = (uint8_t)((100.0f * D3Force_gain) + 0.5f);
|
||||
Database->write("ForceFeedbackGain", force_gain);
|
||||
|
||||
#ifndef RELEASE // never save this value out in release.
|
||||
@ -1321,7 +1321,7 @@ void LoadGameSettings() {
|
||||
// force feedback stuff
|
||||
Database->read("EnableJoystickFF", &D3Use_force_feedback);
|
||||
Database->read("ForceFeedbackAutoCenter", &D3Force_auto_center);
|
||||
ubyte force_gain;
|
||||
uint8_t force_gain;
|
||||
Database->read("ForceFeedbackGain", &force_gain, sizeof(force_gain));
|
||||
if (force_gain > 100)
|
||||
force_gain = 100;
|
||||
|
@ -566,7 +566,7 @@ void lgoal::SendStateToPlayer(int index, int pnum) {
|
||||
// now update the buddy handle list of the clients
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
|
||||
size_offset = START_DATA(MP_WORLD_STATES, data, &count);
|
||||
|
||||
|
@ -68,7 +68,7 @@ static ushort *Dynamic_lightmap_memory = NULL;
|
||||
static float Light_component_scalar[32];
|
||||
float Ubyte_to_float[256];
|
||||
|
||||
static ubyte Lmi_spoken_for[MAX_LIGHTMAP_INFOS / 8];
|
||||
static uint8_t Lmi_spoken_for[MAX_LIGHTMAP_INFOS / 8];
|
||||
|
||||
static dynamic_lightmap *Dynamic_lightmaps;
|
||||
static dynamic_face Dynamic_face_list[MAX_DYNAMIC_FACES];
|
||||
@ -149,7 +149,7 @@ void InitDynamicLighting() {
|
||||
memset(&Dynamic_lightmaps[i], 0, sizeof(dynamic_lightmap));
|
||||
}
|
||||
|
||||
// Setup ubyte to float
|
||||
// Setup uint8_t to float
|
||||
for (i = 0; i < 256; i++)
|
||||
Ubyte_to_float[i] = (float)i / 255.0;
|
||||
|
||||
@ -174,7 +174,7 @@ void InitDynamicLighting() {
|
||||
|
||||
// Given a float, returns the index into the Ubyte_float_table that this number
|
||||
// corresponds to
|
||||
ubyte Float_to_ubyte(float fnum) {
|
||||
uint8_t Float_to_ubyte(float fnum) {
|
||||
int i;
|
||||
|
||||
if (fnum < 0 || fnum > 1.0) {
|
||||
@ -557,7 +557,7 @@ struct light_instance_context {
|
||||
} Light_instance_stack[MAX_SUBOBJECTS];
|
||||
|
||||
int Light_instance_depth = 0;
|
||||
ubyte Use_light_direction = 0;
|
||||
uint8_t Use_light_direction = 0;
|
||||
|
||||
vector Light_position;
|
||||
vector Light_direction;
|
||||
@ -1605,7 +1605,7 @@ void ApplyLightingToTerrain(vector *pos, int cellnum, float light_dist, float re
|
||||
|
||||
// TODO: MTS: Unused?
|
||||
// Sets pulse parameters for an entire room
|
||||
void SetRoomPulse(room *rp, ubyte pulse_time, ubyte pulse_offset) {
|
||||
void SetRoomPulse(room *rp, uint8_t pulse_time, uint8_t pulse_offset) {
|
||||
ASSERT(rp->used);
|
||||
|
||||
rp->pulse_time = pulse_time;
|
||||
|
@ -41,7 +41,7 @@ extern float Specular_tables[3][MAX_SPECULAR_INCREMENTS];
|
||||
|
||||
typedef struct {
|
||||
ushort *mem_ptr;
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
} dynamic_lightmap;
|
||||
|
||||
typedef struct {
|
||||
@ -50,7 +50,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
ushort cellnum;
|
||||
ubyte r, g, b;
|
||||
uint8_t r, g, b;
|
||||
} dynamic_cell;
|
||||
|
||||
// Sets up our dynamic lighting maps
|
||||
@ -82,7 +82,7 @@ int SearchLightQuadTree(face *fp, vector *rvec, vector *uvec, dynamic_face *dyna
|
||||
|
||||
// Given a float, returns the index into the Ubyte_float_table that this number
|
||||
// corresponds to
|
||||
ubyte Float_to_ubyte(float fnum);
|
||||
uint8_t Float_to_ubyte(float fnum);
|
||||
|
||||
extern float Ubyte_to_float[];
|
||||
|
||||
@ -98,7 +98,7 @@ void CountFaceLights();
|
||||
void DoFaceLighting();
|
||||
|
||||
// Sets pulse parameters for an entire room
|
||||
void SetRoomPulse(room *rp, ubyte pulse_time, ubyte pulse_offset);
|
||||
void SetRoomPulse(room *rp, uint8_t pulse_time, uint8_t pulse_offset);
|
||||
|
||||
// Returns the total number of bytes needed for volume lighting in this room
|
||||
int GetVolumeSizeOfRoom(room *rp, int *w = NULL, int *h = NULL, int *d = NULL);
|
||||
|
@ -55,16 +55,16 @@
|
||||
#define LMI_EXTERNAL_ROOM_OBJECT 6
|
||||
|
||||
typedef struct {
|
||||
ubyte xspacing, yspacing;
|
||||
uint8_t xspacing, yspacing;
|
||||
ushort lm_handle;
|
||||
vector upper_left, normal;
|
||||
ubyte width, height, x1, y1;
|
||||
ubyte used;
|
||||
uint8_t width, height, x1, y1;
|
||||
uint8_t used;
|
||||
|
||||
ushort dynamic;
|
||||
short spec_map;
|
||||
|
||||
ubyte type; // see LMI_types above
|
||||
uint8_t type; // see LMI_types above
|
||||
} lightmap_info;
|
||||
|
||||
extern lightmap_info *LightmapInfo;
|
||||
|
@ -281,7 +281,7 @@ int LoadGameState(const char *pathname) {
|
||||
gs_Xlates = new gs_tables;
|
||||
|
||||
// read in header and do version check.
|
||||
cf_ReadBytes((ubyte *)desc, sizeof(desc), fp);
|
||||
cf_ReadBytes((uint8_t *)desc, sizeof(desc), fp);
|
||||
version = (ushort)cf_ReadShort(fp);
|
||||
if (version < GAMESAVE_OLDVER) {
|
||||
Int3();
|
||||
@ -336,7 +336,7 @@ int LoadGameState(const char *pathname) {
|
||||
goto loadsg_error;
|
||||
}
|
||||
}
|
||||
cf_ReadBytes((ubyte *)&Weather, sizeof(Weather), fp);
|
||||
cf_ReadBytes((uint8_t *)&Weather, sizeof(Weather), fp);
|
||||
|
||||
// Restore active doorways
|
||||
{
|
||||
@ -425,7 +425,7 @@ bool GetGameStateInfo(const char *pathname, char *description, int *bm_handle) {
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
if (!cf_ReadBytes((ubyte *)desc, GAMESAVE_DESCLEN + 1, fp)) {
|
||||
if (!cf_ReadBytes((uint8_t *)desc, GAMESAVE_DESCLEN + 1, fp)) {
|
||||
strcpy(description, TXT_ILLEGALSAVEGAME);
|
||||
goto savesg_error;
|
||||
}
|
||||
@ -536,7 +536,7 @@ int LGSMission(const char *msnname, int level) {
|
||||
return LGS_OK;
|
||||
}
|
||||
|
||||
extern ubyte AutomapVisMap[MAX_ROOMS];
|
||||
extern uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
|
||||
// initializes rooms
|
||||
int LGSRooms(CFILE *fp) {
|
||||
@ -557,7 +557,7 @@ int LGSRooms(CFILE *fp) {
|
||||
}
|
||||
|
||||
for (i = 0; i <= highest_index; i++) {
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
gs_ReadByte(fp, used);
|
||||
if (used) {
|
||||
// reset lists
|
||||
@ -662,15 +662,15 @@ int LGSTriggers(CFILE *fp) {
|
||||
|
||||
typedef struct {
|
||||
int obj_handle, dest_objhandle;
|
||||
ubyte subnum, subnum2;
|
||||
uint8_t subnum, subnum2;
|
||||
|
||||
ushort modelnum;
|
||||
ushort vertnum, end_vertnum;
|
||||
} old_vis_attach_info;
|
||||
|
||||
typedef struct {
|
||||
ubyte type;
|
||||
ubyte id;
|
||||
uint8_t type;
|
||||
uint8_t id;
|
||||
|
||||
vector pos;
|
||||
|
||||
@ -685,7 +685,7 @@ typedef struct {
|
||||
int roomnum;
|
||||
ushort flags;
|
||||
int phys_flags;
|
||||
ubyte movement_type;
|
||||
uint8_t movement_type;
|
||||
short custom_handle;
|
||||
ushort lighting_color;
|
||||
|
||||
@ -742,7 +742,7 @@ int LGSVisEffects(CFILE *fp) {
|
||||
int roomnum, v;
|
||||
vis_effect vis;
|
||||
|
||||
cf_ReadBytes((ubyte *)&vis, sizeof(vis_effect), fp);
|
||||
cf_ReadBytes((uint8_t *)&vis, sizeof(vis_effect), fp);
|
||||
roomnum = vis.roomnum;
|
||||
|
||||
// Check for old struct, and if found, fix it
|
||||
@ -752,10 +752,10 @@ int LGSVisEffects(CFILE *fp) {
|
||||
old_vis_effect old_vis;
|
||||
|
||||
// Copy new into old
|
||||
memcpy((ubyte *)&old_vis, (ubyte *)&vis, sizeof(vis_effect));
|
||||
memcpy((uint8_t *)&old_vis, (uint8_t *)&vis, sizeof(vis_effect));
|
||||
|
||||
// Read extra data from old
|
||||
cf_ReadBytes(((ubyte *)&old_vis) + sizeof(vis_effect), sizeof(old_vis_effect) - sizeof(vis_effect), fp);
|
||||
cf_ReadBytes(((uint8_t *)&old_vis) + sizeof(vis_effect), sizeof(old_vis_effect) - sizeof(vis_effect), fp);
|
||||
|
||||
// Copy from old to new struct
|
||||
CopyVisStruct(&vis, &old_vis);
|
||||
@ -790,7 +790,7 @@ int LGSPlayers(CFILE *fp) {
|
||||
return LGS_OUTDATEDVER;
|
||||
} else {
|
||||
int guided_handle;
|
||||
cf_ReadBytes((ubyte *)plr, sizeof(player), fp);
|
||||
cf_ReadBytes((uint8_t *)plr, sizeof(player), fp);
|
||||
if (plr->guided_obj) {
|
||||
gs_ReadInt(fp, guided_handle);
|
||||
plr->guided_obj = &Objects[guided_handle & HANDLE_OBJNUM_MASK];
|
||||
@ -850,7 +850,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
int num_marker_msgs = cf_ReadShort(fp);
|
||||
for (i = 0; i < num_marker_msgs; i++) {
|
||||
int msg_len = cf_ReadShort(fp);
|
||||
cf_ReadBytes((ubyte *)MarkerMessages[i], msg_len, fp);
|
||||
cf_ReadBytes((uint8_t *)MarkerMessages[i], msg_len, fp);
|
||||
}
|
||||
|
||||
highest_index = (int)cf_ReadShort(fp);
|
||||
@ -952,7 +952,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
object_info *obji;
|
||||
door *door;
|
||||
int index, nattach, new_model, handle;
|
||||
ubyte type, dummy_type;
|
||||
uint8_t type, dummy_type;
|
||||
short sindex, size;
|
||||
|
||||
// if((i==98)||(i==100))
|
||||
@ -973,7 +973,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
Osiris_EnableEvents(OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS);
|
||||
continue;
|
||||
}
|
||||
ubyte l_rend_type;
|
||||
uint8_t l_rend_type;
|
||||
gs_ReadByte(fp, l_rend_type);
|
||||
|
||||
// See if the object has changed from it's original lightmap type
|
||||
@ -989,13 +989,13 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
op->lighting_render_type = l_rend_type;
|
||||
|
||||
// Store whether or not we have a pointer to lighting_info
|
||||
ubyte has_lightinfo;
|
||||
uint8_t has_lightinfo;
|
||||
gs_ReadByte(fp, has_lightinfo);
|
||||
if (has_lightinfo) {
|
||||
if (!op->lighting_info) {
|
||||
op->lighting_info = (light_info *)mem_malloc(sizeof(*op->lighting_info));
|
||||
}
|
||||
cf_ReadBytes((ubyte *)op->lighting_info, sizeof(*op->lighting_info), fp);
|
||||
cf_ReadBytes((uint8_t *)op->lighting_info, sizeof(*op->lighting_info), fp);
|
||||
}
|
||||
|
||||
// validate handle.
|
||||
@ -1024,7 +1024,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
if (!op->name)
|
||||
Error("Out of memory");
|
||||
|
||||
cf_ReadBytes((ubyte *)op->name, j, fp);
|
||||
cf_ReadBytes((uint8_t *)op->name, j, fp);
|
||||
op->name[j] = '\0';
|
||||
} else {
|
||||
op->name = NULL;
|
||||
@ -1152,7 +1152,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
if (!op->custom_default_script_name)
|
||||
Error("Out of memory");
|
||||
|
||||
cf_ReadBytes((ubyte *)op->custom_default_script_name, j, fp);
|
||||
cf_ReadBytes((uint8_t *)op->custom_default_script_name, j, fp);
|
||||
op->custom_default_script_name[j] = '\0';
|
||||
} else {
|
||||
op->custom_default_script_name = NULL;
|
||||
@ -1164,7 +1164,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
if (!op->custom_default_module_name)
|
||||
Error("Out of memory");
|
||||
|
||||
cf_ReadBytes((ubyte *)op->custom_default_module_name, j, fp);
|
||||
cf_ReadBytes((uint8_t *)op->custom_default_module_name, j, fp);
|
||||
op->custom_default_module_name[j] = '\0';
|
||||
} else {
|
||||
op->custom_default_module_name = NULL;
|
||||
@ -1184,7 +1184,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
retval = LGS_OUTDATEDVER;
|
||||
goto done;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)&op->mtype, size, fp);
|
||||
cf_ReadBytes((uint8_t *)&op->mtype, size, fp);
|
||||
|
||||
VERIFY_SAVEFILE;
|
||||
// Control info, determined by CONTROL_TYPE
|
||||
@ -1194,7 +1194,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
retval = LGS_OUTDATEDVER;
|
||||
goto done;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)&op->ctype, size, fp);
|
||||
cf_ReadBytes((uint8_t *)&op->ctype, size, fp);
|
||||
|
||||
VERIFY_SAVEFILE;
|
||||
// remap bitmap handle if this is a fireball!
|
||||
@ -1217,7 +1217,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
retval = LGS_OUTDATEDVER;
|
||||
goto done;
|
||||
}
|
||||
cf_ReadBytes((ubyte *)&op->rtype, size, fp);
|
||||
cf_ReadBytes((uint8_t *)&op->rtype, size, fp);
|
||||
|
||||
op->size = cf_ReadFloat(fp);
|
||||
|
||||
@ -1317,7 +1317,7 @@ int LGSObjects(CFILE *fp, int version) {
|
||||
}
|
||||
// Do Animation stuff
|
||||
custom_anim multi_anim_info;
|
||||
cf_ReadBytes((ubyte *)&multi_anim_info, sizeof(multi_anim_info), fp);
|
||||
cf_ReadBytes((uint8_t *)&multi_anim_info, sizeof(multi_anim_info), fp);
|
||||
ObjSetAnimUpdate(i, &multi_anim_info);
|
||||
break;
|
||||
}
|
||||
@ -1457,7 +1457,7 @@ int LGSObjAI(CFILE *fp, ai_frame **pai) {
|
||||
*pai = (ai_frame *)mem_malloc(size);
|
||||
ai = *pai;
|
||||
|
||||
cf_ReadBytes((ubyte *)ai, size, fp);
|
||||
cf_ReadBytes((uint8_t *)ai, size, fp);
|
||||
|
||||
return LGS_OK;
|
||||
}
|
||||
@ -1478,14 +1478,14 @@ int LGSObjEffects(CFILE *fp, object *op) {
|
||||
op->effect_info = (effect_info_s *)mem_malloc(size);
|
||||
effect_info_s *ei = op->effect_info;
|
||||
|
||||
cf_ReadBytes((ubyte *)ei, size, fp);
|
||||
cf_ReadBytes((uint8_t *)ei, size, fp);
|
||||
}
|
||||
|
||||
return LGS_OK;
|
||||
}
|
||||
|
||||
//@@// loads script
|
||||
//@@vector *LGSScript(CFILE *fp, script_info *script, ubyte *is_scripted, int *memsize)
|
||||
//@@vector *LGSScript(CFILE *fp, script_info *script, uint8_t *is_scripted, int *memsize)
|
||||
//@@{
|
||||
//@@ int i;
|
||||
//@@ char name[64];
|
||||
@ -1549,7 +1549,7 @@ int LGSObjWB(CFILE *fp, object *op) {
|
||||
|
||||
for (i = 0; i < num_wbs; i++) {
|
||||
dynamic_wb_info *dwb = &dwba[i];
|
||||
cf_ReadBytes((ubyte *)dwb, sizeof(dynamic_wb_info), fp);
|
||||
cf_ReadBytes((uint8_t *)dwb, sizeof(dynamic_wb_info), fp);
|
||||
}
|
||||
op->dynamic_wb = dwba;
|
||||
|
||||
@ -1571,10 +1571,10 @@ int LGSSpew(CFILE *fp) {
|
||||
gs_ReadShort(fp, spew_count);
|
||||
|
||||
for (i = 0; i < MAX_SPEW_EFFECTS; i++) {
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
gs_ReadByte(fp, used);
|
||||
if (used)
|
||||
cf_ReadBytes((ubyte *)&SpewEffects[i], sizeof(spewinfo), fp);
|
||||
cf_ReadBytes((uint8_t *)&SpewEffects[i], sizeof(spewinfo), fp);
|
||||
}
|
||||
|
||||
return LGS_OK;
|
||||
|
@ -631,7 +631,7 @@ char *_parse_escape_chars(char *buffer) {
|
||||
// see if we have a number
|
||||
if ((buffer[b_index] >= '0') && (buffer[b_index] <= '9')) {
|
||||
// we have a number, so parse the value
|
||||
ubyte value = 0;
|
||||
uint8_t value = 0;
|
||||
while ((buffer[b_index] >= '0') && (buffer[b_index] <= '9')) {
|
||||
value = (value * 10) + buffer[b_index] - '0';
|
||||
b_index++;
|
||||
|
@ -62,7 +62,7 @@ private:
|
||||
char m_type;
|
||||
char m_creation_effect;
|
||||
short m_creation_texture;
|
||||
ubyte m_cur_saturation_count;
|
||||
uint8_t m_cur_saturation_count;
|
||||
|
||||
int m_num_spawn_pnts;
|
||||
|
||||
|
@ -95,7 +95,7 @@ typedef struct {
|
||||
int num_items;
|
||||
|
||||
menu_item items[MAX_MENU_ITEMS];
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
} menu;
|
||||
|
||||
// returns whether we decided to quit the game or not
|
||||
|
@ -155,7 +155,7 @@ msn_urls *msn_GetURL(network_address *net_addr) {
|
||||
int count = 0;
|
||||
int size;
|
||||
int tries = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
float start_time;
|
||||
network_address from_addr;
|
||||
|
||||
@ -516,12 +516,12 @@ int msn_DownloadWithStatus(char *url, char *filename) {
|
||||
*/
|
||||
}
|
||||
|
||||
void msn_DoAskForURL(ubyte *indata, network_address *net_addr) {
|
||||
void msn_DoAskForURL(uint8_t *indata, network_address *net_addr) {
|
||||
static msn_urls *url;
|
||||
int count = 0;
|
||||
int size;
|
||||
int i;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int num_urls = 0;
|
||||
|
||||
if (Netgame.local_role == LR_SERVER) {
|
||||
@ -571,7 +571,7 @@ void msn_DoAskForURL(ubyte *indata, network_address *net_addr) {
|
||||
}
|
||||
}
|
||||
|
||||
void msn_DoCurrMsnURLs(ubyte *data, network_address *net_addr) {
|
||||
void msn_DoCurrMsnURLs(uint8_t *data, network_address *net_addr) {
|
||||
int count = 0;
|
||||
int num_urls = 0;
|
||||
int i;
|
||||
|
@ -58,8 +58,8 @@ typedef struct {
|
||||
} msn_urls;
|
||||
|
||||
// Function prototypes
|
||||
void msn_DoAskForURL(ubyte *indata, network_address *net_addr);
|
||||
void msn_DoCurrMsnURLs(ubyte *data, network_address *net_addr);
|
||||
void msn_DoAskForURL(uint8_t *indata, network_address *net_addr);
|
||||
void msn_DoCurrMsnURLs(uint8_t *data, network_address *net_addr);
|
||||
int msn_CheckGetMission(network_address *net_addr, char *filename);
|
||||
int msn_ShowDownloadChoices(msn_urls *urls);
|
||||
int msn_DownloadWithStatus(char *url, char *filename);
|
||||
|
@ -246,7 +246,7 @@ void mmItem::OnDraw() {
|
||||
ui_SetCharAlpha(255);
|
||||
ui_DrawString(m_colors[0], 0, 0, m_text);
|
||||
ui_DrawSetTextType(UI_TEXTTYPE_SATURATE);
|
||||
ui_SetCharAlpha((ubyte)m_alpha);
|
||||
ui_SetCharAlpha((uint8_t)m_alpha);
|
||||
for (i = 0; i < m_satcount; i++)
|
||||
ui_DrawString(m_colors[0], 0, 0, m_text);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
144
Descent3/multi.h
144
Descent3/multi.h
@ -46,7 +46,7 @@
|
||||
*
|
||||
* 166 9/09/99 12:24p Kevin
|
||||
* Fixed a bug that was causing problems in the Mac version
|
||||
* (Game_is_master_tracker_game was defined as a ubyte in the game, but an
|
||||
* (Game_is_master_tracker_game was defined as a uint8_t in the game, but an
|
||||
* int in the dll)
|
||||
*
|
||||
* 165 9/02/99 3:34p Jason
|
||||
@ -660,11 +660,11 @@ extern bool Multi_bail_ui_menu;
|
||||
#define PFP_FIRED 1 // the player fired this frame and the info should be packed in a player pos flag
|
||||
#define PFP_FIRED_RELIABLE 2 // used for secondaries of a non-peer to peer game
|
||||
typedef struct {
|
||||
ubyte fired_on_this_frame;
|
||||
ubyte wb_index;
|
||||
ubyte fire_mask;
|
||||
ubyte damage_scalar;
|
||||
ubyte reliable;
|
||||
uint8_t fired_on_this_frame;
|
||||
uint8_t wb_index;
|
||||
uint8_t fire_mask;
|
||||
uint8_t damage_scalar;
|
||||
uint8_t reliable;
|
||||
int dest_roomnum;
|
||||
} player_fire_packet;
|
||||
|
||||
@ -724,7 +724,7 @@ typedef struct {
|
||||
vector pos;
|
||||
int objnum;
|
||||
int roomnum;
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
short original_id;
|
||||
} powerup_respawn;
|
||||
|
||||
@ -737,7 +737,7 @@ extern powerup_timer Powerup_timer[];
|
||||
extern powerup_respawn Powerup_respawn[];
|
||||
extern network_game Network_games[];
|
||||
extern netplayer NetPlayers[MAX_NET_PLAYERS];
|
||||
extern ubyte Multi_receive_buffer[MAX_RECEIVE_SIZE];
|
||||
extern uint8_t Multi_receive_buffer[MAX_RECEIVE_SIZE];
|
||||
extern int Ok_to_join;
|
||||
extern int Num_powerup_respawn;
|
||||
extern int Num_powerup_timer;
|
||||
@ -757,22 +757,22 @@ extern int Multi_requested_damage_type;
|
||||
extern float Multi_requested_damage_amount;
|
||||
extern float Multi_additional_shields[];
|
||||
|
||||
extern ubyte Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
|
||||
extern uint8_t Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
|
||||
extern int Multi_send_size[MAX_NET_PLAYERS];
|
||||
extern float Multi_last_sent_time[MAX_NET_PLAYERS][MAX_NET_PLAYERS];
|
||||
extern int Multi_additional_damage_type[MAX_NET_PLAYERS];
|
||||
|
||||
extern ubyte Multi_reliable_urgent[MAX_NET_PLAYERS];
|
||||
extern ubyte Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
|
||||
extern uint8_t Multi_reliable_urgent[MAX_NET_PLAYERS];
|
||||
extern uint8_t 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 uint8_t Multi_reliable_sent_position[MAX_NET_PLAYERS];
|
||||
extern uint32_t Multi_visible_players[];
|
||||
|
||||
extern int Got_level_info;
|
||||
extern int Got_new_game_time;
|
||||
// For keeping track of buildings that have changed
|
||||
extern ubyte Multi_building_states[];
|
||||
extern uint8_t Multi_building_states[];
|
||||
extern ushort Multi_num_buildings_changed;
|
||||
|
||||
extern bool Multi_logo_state;
|
||||
@ -827,12 +827,12 @@ typedef struct vmt_descent3_struct {
|
||||
extern vmt_descent3_struct MTPilotinfo[MAX_NET_PLAYERS];
|
||||
|
||||
// Display a menu based on what the server just told us about
|
||||
void MultiDoGuidebotMenuData(ubyte *data);
|
||||
void MultiDoGuidebotMenuData(uint8_t *data);
|
||||
|
||||
// The user either wants a menu to display or they took an action off of the menu
|
||||
void MultiDoGuidebotMenuRequest(ubyte *data, int slot);
|
||||
void MultiDoGuidebotMenuRequest(uint8_t *data, int slot);
|
||||
|
||||
void MultiProcessBigData(ubyte *buf, int len, network_address *from_addr);
|
||||
void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr);
|
||||
|
||||
// Points the server_address variable at a new location
|
||||
void MultiSetServerAddress(network_address *addr);
|
||||
@ -844,7 +844,7 @@ void MultiDoFrame();
|
||||
int TryToJoinServer(network_address *addr);
|
||||
|
||||
// The server says we can join!
|
||||
void MultiDoConnectionAccepted(ubyte *data);
|
||||
void MultiDoConnectionAccepted(uint8_t *data);
|
||||
|
||||
// Polls for a connection message so we can finally join this game
|
||||
void MultiPollForConnectionAccepted();
|
||||
@ -860,7 +860,7 @@ void StartNewMultiplayerGame();
|
||||
void MultiCloseGame();
|
||||
|
||||
// The server sends to everyone that the player is dead
|
||||
void MultiSendPlayerDead(int slot, ubyte fate);
|
||||
void MultiSendPlayerDead(int slot, uint8_t fate);
|
||||
|
||||
// Called when you want to leave a netgame
|
||||
void MultiLeaveGame();
|
||||
@ -870,13 +870,13 @@ void MultiLeaveGame();
|
||||
void MultiProcessIncoming();
|
||||
|
||||
// Starts a packet of data
|
||||
int START_DATA(int type, ubyte *data, int *count, ubyte reliable = 0);
|
||||
int START_DATA(int type, uint8_t *data, int *count, uint8_t reliable = 0);
|
||||
|
||||
// End a pakcet of data
|
||||
void END_DATA(int count, ubyte *data, int offset);
|
||||
void END_DATA(int count, uint8_t *data, int offset);
|
||||
|
||||
// Skip the header stuff
|
||||
void SKIP_HEADER(ubyte *data, int *count);
|
||||
void SKIP_HEADER(uint8_t *data, int *count);
|
||||
|
||||
// Starts a level for multiplayer
|
||||
bool MultiStartNewLevel(int level);
|
||||
@ -886,7 +886,7 @@ int MultiCountPlayers();
|
||||
|
||||
// Puts player "slot" position info into the passed in buffer
|
||||
// Returns the number of bytes used
|
||||
int MultiStuffPosition(int slot, ubyte *data);
|
||||
int MultiStuffPosition(int slot, uint8_t *data);
|
||||
|
||||
// Sends a full packet out the the server
|
||||
// Resets the send_size variable
|
||||
@ -902,7 +902,7 @@ void MultiMakePlayerGhost(int slot);
|
||||
void MultiMakePlayerReal(int slot);
|
||||
|
||||
// Sends a fire packet from a player
|
||||
void MultiSendFirePlayerWB(int playernum, ubyte wb_index, ubyte fire_mask, ubyte reliable = 0, float scalar = 1.0);
|
||||
void MultiSendFirePlayerWB(int playernum, uint8_t wb_index, uint8_t fire_mask, uint8_t reliable = 0, float scalar = 1.0);
|
||||
|
||||
void MultiMakeMatrix(multi_orientation *dest, matrix *src);
|
||||
|
||||
@ -942,33 +942,33 @@ int MultiMatchGeneric(uint32_t unique_id);
|
||||
void MultiSendMessageToServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL);
|
||||
|
||||
// Sends an object from the server to the client
|
||||
void MultiSendObject(object *obj, ubyte announce, ubyte demo_record = false);
|
||||
void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record = false);
|
||||
|
||||
// Paints all the goal rooms in a level with their colors
|
||||
void MultiPaintGoalRooms(int *texcolors = NULL);
|
||||
|
||||
// Sends a special script packet to a player
|
||||
void MultiSendSpecialPacket(int slot, ubyte *outdata, int size);
|
||||
void MultiSendSpecialPacket(int slot, uint8_t *outdata, int size);
|
||||
|
||||
// Flushes all receive sockets so that there is no data coming from them
|
||||
void MultiFlushAllIncomingBuffers();
|
||||
|
||||
// Tells all clients to remove a specified object
|
||||
void MultiSendRemoveObject(object *obj, ubyte playsound);
|
||||
void MultiSendRemoveObject(object *obj, uint8_t playsound);
|
||||
|
||||
// Sends the special script packet to the server
|
||||
void MultiClientSendSpecialPacket(ubyte *outdata, int size);
|
||||
void MultiClientSendSpecialPacket(uint8_t *outdata, int size);
|
||||
|
||||
// Sends info out on my guided missile into a slot
|
||||
// returns number of bytes in packet
|
||||
int MultiStuffGuidedInfo(ubyte, ubyte *);
|
||||
int MultiStuffGuidedInfo(uint8_t, uint8_t *);
|
||||
|
||||
// Polls for a connection message so we can finally join this game
|
||||
// Client only
|
||||
int MultiPollForLevelInfo();
|
||||
|
||||
// Server is telling us about the level
|
||||
void MultiDoLevelInfo(ubyte *data);
|
||||
void MultiDoLevelInfo(uint8_t *data);
|
||||
|
||||
// Server is telling the client about the level currently playing
|
||||
// Server only
|
||||
@ -976,7 +976,7 @@ void MultiSendLevelInfo(int slot);
|
||||
|
||||
// Clients says he's ready for level info
|
||||
// so send it to him
|
||||
void MultiDoReadyForLevel(ubyte *data);
|
||||
void MultiDoReadyForLevel(uint8_t *data);
|
||||
|
||||
// Client is telling the server that he is ready for a level
|
||||
// Client only
|
||||
@ -992,10 +992,10 @@ void MultiEndLevel();
|
||||
void GetServerGameTime();
|
||||
|
||||
// Send robot info
|
||||
int MultiStuffRobotPosition(uint16_t objectnum, ubyte *data);
|
||||
int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data);
|
||||
|
||||
// Handle robot position
|
||||
void MultiDoRobotPos(ubyte *data);
|
||||
void MultiDoRobotPos(uint8_t *data);
|
||||
|
||||
// Handle robot (or any AI created) weapon fire
|
||||
int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum);
|
||||
@ -1004,7 +1004,7 @@ int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint1
|
||||
void MultiSendKillObject(object *hit_obj, object *killer, float damage, int death_flags, float delay, short seed);
|
||||
|
||||
// handle robot damage
|
||||
void MultiDoRobotExplode(ubyte *data);
|
||||
void MultiDoRobotExplode(uint8_t *data);
|
||||
|
||||
// Peer to peer request for damage
|
||||
void MultiSendRequestPeerDamage(object *, int, int, float);
|
||||
@ -1013,7 +1013,7 @@ void MultiSendRequestPeerDamage(object *, int, int, float);
|
||||
void MultiSendInitialRank(int pnum);
|
||||
|
||||
// Tells the other players that a slot is starting/stopping its on/off weapon
|
||||
void MultiSendOnOff(object *obj, ubyte on, ubyte wb_index, ubyte fire_mask);
|
||||
void MultiSendOnOff(object *obj, uint8_t on, uint8_t wb_index, uint8_t fire_mask);
|
||||
|
||||
// Tells all the clients to apply damage to a player
|
||||
void MultiSendAdditionalDamage(int slot, int type, float amount);
|
||||
@ -1025,19 +1025,19 @@ void MultiSendRequestCountermeasure(short objnum, int weapon_index);
|
||||
void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int weaponid);
|
||||
|
||||
// Handle message from server that robot/object took damage
|
||||
void MultiDoRobotDamage(ubyte *data);
|
||||
void MultiDoRobotDamage(uint8_t *data);
|
||||
|
||||
// Add an object to the list of objects that need an animation update next player packet interval
|
||||
void MultiAddObjAnimUpdate(int objnum);
|
||||
|
||||
// Stuff an animation update into a packet
|
||||
int MultiStuffObjAnimUpdate(uint16_t objnum, ubyte *data);
|
||||
int MultiStuffObjAnimUpdate(uint16_t objnum, uint8_t *data);
|
||||
|
||||
// Handle an animation update
|
||||
void MultiDoObjAnimUpdate(ubyte *data);
|
||||
void MultiDoObjAnimUpdate(uint8_t *data);
|
||||
|
||||
// Play a 3d sound that the server told us about
|
||||
void MultiDoPlay3dSound(ubyte *data);
|
||||
void MultiDoPlay3dSound(uint8_t *data);
|
||||
|
||||
// Tell the clients to play a 3d sound
|
||||
void MultiPlay3dSound(short soundidx, ushort objnum, int priority);
|
||||
@ -1046,63 +1046,63 @@ void MultiPlay3dSound(short soundidx, ushort objnum, int priority);
|
||||
void MultiSendRobotFireSound(short soundidx, ushort objnum);
|
||||
|
||||
// Play the robot sound that the server told us about
|
||||
void MultiDoRobotFireSound(ubyte *data);
|
||||
void MultiDoRobotFireSound(uint8_t *data);
|
||||
|
||||
// Add a turret to the list of stuff to be updated
|
||||
void MultiAddObjTurretUpdate(int objnum);
|
||||
|
||||
// Stuff turret data into a packet
|
||||
int MultiStuffTurretUpdate(uint16_t objnum, ubyte *data);
|
||||
int MultiStuffTurretUpdate(uint16_t objnum, uint8_t *data);
|
||||
|
||||
// Handle a turret update from the server
|
||||
void MultiDoTurretUpdate(ubyte *data);
|
||||
void MultiDoTurretUpdate(uint8_t *data);
|
||||
|
||||
// Handle a client use inventory item packet
|
||||
void MultiDoClientInventoryUseItem(int slot, ubyte *data);
|
||||
void MultiDoClientInventoryUseItem(int slot, uint8_t *data);
|
||||
|
||||
// Send a request to use an inventory item to the server
|
||||
void MultiSendClientInventoryUseItem(int type, int id);
|
||||
|
||||
// Handle a remove item from inventory
|
||||
void MultiDoClientInventoryRemoveItem(int slot, ubyte *data);
|
||||
void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data);
|
||||
|
||||
// Tell the clients to remove an item from a player's inventory
|
||||
void MultiSendInventoryRemoveItem(int slot, int type, int id);
|
||||
|
||||
void MultiAddObjWBAnimUpdate(int objnum);
|
||||
|
||||
int MultiStuffObjWBAnimUpdate(uint16_t objnum, ubyte *data);
|
||||
int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data);
|
||||
|
||||
void MultiDoObjWBAnimUpdate(ubyte *data);
|
||||
void MultiDoObjWBAnimUpdate(uint8_t *data);
|
||||
|
||||
void MultiDoBytesSent(ubyte *data);
|
||||
void MultiDoBytesSent(uint8_t *data);
|
||||
|
||||
void MultiSendBytesSent(int slot);
|
||||
|
||||
void MultiSendPPSSet(int pps);
|
||||
|
||||
void MultiDoPPSSet(ubyte *data, int slot);
|
||||
void MultiDoPPSSet(uint8_t *data, int slot);
|
||||
|
||||
void MultiSendGreetings(uint32_t id);
|
||||
|
||||
void MultiDoGreetings(ubyte *data, network_address *addr);
|
||||
void MultiDoGreetings(uint8_t *data, network_address *addr);
|
||||
|
||||
// We're asking to enter observer mode
|
||||
void MultiSendRequestToObserve(int mode, int on, int objnum);
|
||||
|
||||
// Server is telling us about players that we can see
|
||||
void MultiDoVisiblePlayers(ubyte *data);
|
||||
void MultiDoVisiblePlayers(uint8_t *data);
|
||||
|
||||
// Sends all the visible players to another player
|
||||
void MultiSendVisiblePlayers(int to_slot);
|
||||
|
||||
void MultiDoFileReq(ubyte *data);
|
||||
void MultiDoFileReq(uint8_t *data);
|
||||
|
||||
void MultiDoFileDenied(ubyte *data);
|
||||
void MultiDoFileDenied(uint8_t *data);
|
||||
|
||||
void MultiDoFileData(ubyte *data);
|
||||
void MultiDoFileData(uint8_t *data);
|
||||
|
||||
void MultiDoFileAck(ubyte *data);
|
||||
void MultiDoFileAck(uint8_t *data);
|
||||
|
||||
// Tells clients that a particular player's custom data is here and ready for downloading
|
||||
void MultiSendClientCustomData(int slot, int whoto = -1);
|
||||
@ -1121,10 +1121,10 @@ void MultiSendRequestShields(int type, float amount);
|
||||
|
||||
// Tells the clients to ghost or unghost an object
|
||||
void MultiSendGhostObject(object *obj, bool ghost);
|
||||
void MultiDoGhostObject(ubyte *data);
|
||||
void MultiDoGhostObject(uint8_t *data);
|
||||
|
||||
// Sends this nonreliable packet to everyone except the server and the named slot
|
||||
void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold);
|
||||
void MultiSendToAllExcept(int except, uint8_t *data, int size, int seq_threshold);
|
||||
|
||||
// Tells the server about the weapons we're carrying
|
||||
void MultiSendWeaponsLoad();
|
||||
@ -1136,19 +1136,19 @@ void MultiSendBreakGlass(room *rp, int facenum);
|
||||
void MultiSendHeartbeat();
|
||||
|
||||
// Ping functions to find the players latency
|
||||
void MultiDoPong(ubyte *data);
|
||||
void MultiDoPing(ubyte *data, network_address *addr);
|
||||
void MultiDoPong(uint8_t *data);
|
||||
void MultiDoPing(uint8_t *data, network_address *addr);
|
||||
void MultiSendPing(int slot);
|
||||
void MultiDoLagInfo(ubyte *data);
|
||||
void MultiDoLagInfo(uint8_t *data);
|
||||
|
||||
// Stuffs a players firing information into a packet
|
||||
int MultiStuffPlayerFire(int slot, ubyte *data);
|
||||
int MultiStuffPlayerFire(int slot, uint8_t *data);
|
||||
|
||||
// Stuffs request to move into a packet
|
||||
int MultiStuffRequestToMove(ubyte *data);
|
||||
int MultiStuffRequestToMove(uint8_t *data);
|
||||
|
||||
// Stuff info for a guided missile
|
||||
int MultiStuffGuidedInfo(int slot, ubyte *data);
|
||||
int MultiStuffGuidedInfo(int slot, uint8_t *data);
|
||||
|
||||
// Tell everyone I'm timingout my timeout weapon
|
||||
void MultiSendReleaseTimeoutMissile();
|
||||
@ -1170,33 +1170,33 @@ extern bool Multi_accept_state;
|
||||
void MultiSetAcceptState(bool state);
|
||||
|
||||
void MultiSendAiWeaponFlags(object *obj, int flags, int wb_index);
|
||||
void MultiDoAiWeaponFlags(ubyte *data);
|
||||
void MultiDoAiWeaponFlags(uint8_t *data);
|
||||
void MultiSendAttach(object *parent, char parent_ap, object *child, char child_ap, bool f_aligned);
|
||||
void MultiDoAttach(ubyte *data);
|
||||
void MultiDoAttach(uint8_t *data);
|
||||
void MultiSendAttachRad(object *parent, char parent_ap, object *child, float rad);
|
||||
void MultiDoAttachRad(ubyte *data);
|
||||
void MultiDoAttachRad(uint8_t *data);
|
||||
void MultiSendUnattach(object *child);
|
||||
void MultiDoUnattach(ubyte *data);
|
||||
void MultiDoUnattach(uint8_t *data);
|
||||
|
||||
void MultiDoJoinDemoObjects(ubyte *data);
|
||||
void MultiDoJoinDemoObjects(uint8_t *data);
|
||||
|
||||
// Rank stuff
|
||||
void MultiDoChangeRank(ubyte *data);
|
||||
void MultiDoChangeRank(uint8_t *data);
|
||||
|
||||
// Sets whether or not we want the logos to be displayed on ships
|
||||
void MultiSetLogoState(bool state);
|
||||
|
||||
void MultiSendThiefSteal(int player, int item);
|
||||
void MultiDoThiefSteal(ubyte *data);
|
||||
void MultiDoThiefSteal(uint8_t *data);
|
||||
|
||||
void MultiSetAudioTauntTime(float time, int to_who = -1);
|
||||
void MultiDoAudioTauntTime(ubyte *data);
|
||||
void MultiDoAudioTauntTime(uint8_t *data);
|
||||
|
||||
// Server only function to clear a Guidebot for a disconnected player
|
||||
void MultiClearGuidebot(int slot);
|
||||
|
||||
// Guided missile release
|
||||
void MultiDoMissileRelease(int from_slot, ubyte *data);
|
||||
void MultiDoMissileRelease(int from_slot, uint8_t *data);
|
||||
void MultiSendMissileRelease(int slot, bool is_guided);
|
||||
|
||||
// Server telling a client what ship to switch to
|
||||
@ -1205,7 +1205,7 @@ void MultiBashPlayerShip(int slot, char *ship);
|
||||
// Strips a player bare of weapons
|
||||
void MultiSendStripPlayer(int slot);
|
||||
|
||||
inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) {
|
||||
inline void MultiGetTypeID(uint8_t *data, int *count, int *type, int *id) {
|
||||
*id = -1;
|
||||
*type = MultiGetByte(data, count);
|
||||
|
||||
@ -1217,7 +1217,7 @@ inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) {
|
||||
*id = MultiMatchGeneric(hash_value);
|
||||
}
|
||||
|
||||
inline void MultiAddTypeID(int type, int id, ubyte *data, int *count) {
|
||||
inline void MultiAddTypeID(int type, int id, uint8_t *data, int *count) {
|
||||
uint32_t hash_value;
|
||||
hash_value = MultiGetMatchChecksum(type, id);
|
||||
|
||||
|
@ -158,7 +158,7 @@ extern int Use_file_xfer;
|
||||
// Tell the server about my info, such as name, ship type, etc
|
||||
void MultiSendMyInfo() {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending my info\n"));
|
||||
@ -224,7 +224,7 @@ void MultiSendMyInfo() {
|
||||
// Ask the server to tell me about the players
|
||||
void MultiSendRequestForPlayers() {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending request for players\n"));
|
||||
@ -239,7 +239,7 @@ void MultiSendRequestForPlayers() {
|
||||
// Ask the server to tell me about the buildings
|
||||
void MultiSendRequestForBuildings() {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending request for buildings\n"));
|
||||
@ -254,7 +254,7 @@ void MultiSendRequestForBuildings() {
|
||||
// Ask the server to tell me about the world
|
||||
void MultiSendRequestForWorldStates() {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending request for world states\n"));
|
||||
@ -275,7 +275,7 @@ void MultiSendRequestForWorldStates() {
|
||||
// Ask the server to tell me about the objects
|
||||
void MultiSendRequestForObjects() {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending request for objects\n"));
|
||||
@ -436,7 +436,7 @@ void MultiDoClientFrame() {
|
||||
}
|
||||
}
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE], count = 0, add_count = 0;
|
||||
uint8_t data[MAX_GAME_DATA_SIZE], count = 0, add_count = 0;
|
||||
|
||||
count = MultiStuffPosition(Player_num, data);
|
||||
|
||||
|
@ -295,7 +295,7 @@ int AskToJoin(network_address *addr) {
|
||||
int count = 0;
|
||||
int size;
|
||||
int tries = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
float start_time;
|
||||
network_address from_addr;
|
||||
|
||||
@ -421,7 +421,7 @@ int TryToJoinServer(network_address *addr) {
|
||||
|
||||
// The server says we can join!
|
||||
// Client only
|
||||
void MultiDoConnectionAccepted(ubyte *data) {
|
||||
void MultiDoConnectionAccepted(uint8_t *data) {
|
||||
int count = 0;
|
||||
ushort server_version;
|
||||
|
||||
@ -438,7 +438,7 @@ void MultiDoConnectionAccepted(ubyte *data) {
|
||||
mprintf((0, "Client/server versions match.\n"));
|
||||
|
||||
// Check if we have the mission needed
|
||||
ubyte len = MultiGetByte(data, &count);
|
||||
uint8_t len = MultiGetByte(data, &count);
|
||||
memcpy(Netgame.mission, &data[count], len);
|
||||
count += len;
|
||||
|
||||
@ -459,7 +459,7 @@ void MultiDoConnectionAccepted(ubyte *data) {
|
||||
SetGamemodeScript(Netgame.scriptname);
|
||||
|
||||
// Get my player num and copy my name over
|
||||
ubyte player_num = MultiGetByte(data, &count);
|
||||
uint8_t player_num = MultiGetByte(data, &count);
|
||||
char name[CALLSIGN_LEN];
|
||||
netplayer tempplayer;
|
||||
strcpy(name, Players[Player_num].callsign);
|
||||
@ -501,7 +501,7 @@ void MultiDoConnectionAccepted(ubyte *data) {
|
||||
void MultiPollForConnectionAccepted() {
|
||||
float start_time;
|
||||
int connected = 0;
|
||||
ubyte data[MAX_RECEIVE_SIZE];
|
||||
uint8_t data[MAX_RECEIVE_SIZE];
|
||||
|
||||
start_time = timer_GetTime();
|
||||
|
||||
@ -526,7 +526,7 @@ void MultiPollForConnectionAccepted() {
|
||||
// is successfully talking to the client
|
||||
// Server only
|
||||
void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr) {
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -598,7 +598,7 @@ void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr
|
||||
int MultiPollForLevelInfo() {
|
||||
float start_time, ask_time, initial_start_time;
|
||||
int connected = 0;
|
||||
ubyte data[MAX_RECEIVE_SIZE];
|
||||
uint8_t data[MAX_RECEIVE_SIZE];
|
||||
network_address from_addr;
|
||||
|
||||
ShowProgressScreen(TXT_MLTWAITSERVER);
|
||||
@ -718,7 +718,7 @@ void MultiProcessShipChecksum(MD5 *md5, int ship_index) {
|
||||
}
|
||||
|
||||
// Server is telling us about the level
|
||||
void MultiDoLevelInfo(ubyte *data) {
|
||||
void MultiDoLevelInfo(uint8_t *data) {
|
||||
int count = 0;
|
||||
char pshipmodel[PAGENAME_LEN];
|
||||
Current_pilot.get_ship(pshipmodel);
|
||||
@ -750,7 +750,7 @@ void MultiDoLevelInfo(ubyte *data) {
|
||||
// Server only
|
||||
void MultiSendLevelInfo(int slot) {
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -779,9 +779,9 @@ void MultiSendLevelInfo(int slot) {
|
||||
|
||||
// Clients says he's ready for level info
|
||||
// so send it to him
|
||||
void MultiDoReadyForLevel(ubyte *data) {
|
||||
void MultiDoReadyForLevel(uint8_t *data) {
|
||||
int count = 0;
|
||||
ubyte slot;
|
||||
uint8_t slot;
|
||||
char ship_name[PAGENAME_LEN];
|
||||
|
||||
// Skip header stuff
|
||||
@ -810,7 +810,7 @@ void MultiDoReadyForLevel(ubyte *data) {
|
||||
void MultiSendReadyForLevel() {
|
||||
ASSERT(Netgame.local_role != LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -906,7 +906,7 @@ int SearchForLocalGamesTCP(uint32_t ask, ushort port) {
|
||||
int count = 0;
|
||||
int size;
|
||||
int tries = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
network_address check_addr, from_addr;
|
||||
check_addr.connection_type = NP_TCP;
|
||||
if (ask) {
|
||||
@ -935,7 +935,7 @@ int SearchForGamesPXO(uint32_t ask, ushort port) {
|
||||
int count = 0;
|
||||
int size;
|
||||
int tries = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
network_address check_addr, from_addr;
|
||||
check_addr.connection_type = NP_TCP;
|
||||
if (ask) {
|
||||
|
@ -321,7 +321,7 @@ void *callback = NULL;
|
||||
module MultiDLLHandle = {NULL};
|
||||
int SearchForLocalGamesTCP(uint32_t ask, ushort port);
|
||||
int SearchForGamesPXO(uint32_t ask, ushort port);
|
||||
extern ubyte NewUIWindow_alpha;
|
||||
extern uint8_t NewUIWindow_alpha;
|
||||
extern void DoScreenshot();
|
||||
extern void UpdateAndPackGameList(void);
|
||||
extern bool Multi_Gamelist_changed;
|
||||
@ -846,7 +846,7 @@ void RemoveUITextItem(void *item) {
|
||||
UITextItem *old_text_item = (UITextItem *)item;
|
||||
delete old_text_item;
|
||||
}
|
||||
void *CreateNewUIBmpItem(int handle, ubyte alpha) {
|
||||
void *CreateNewUIBmpItem(int handle, uint8_t alpha) {
|
||||
UIBitmapItem *new_bmp_item;
|
||||
new_bmp_item = new UIBitmapItem(handle, alpha);
|
||||
return new_bmp_item;
|
||||
|
@ -149,7 +149,7 @@ int PollUI(void);
|
||||
void RemoveUITextItem(void *item);
|
||||
void *CreateNewUITextItem(const char *newtext, uint32_t color, int font = -1);
|
||||
void RemoveUIBmpItem(void *item);
|
||||
void *CreateNewUIBmpItem(int handle, ubyte alpha);
|
||||
void *CreateNewUIBmpItem(int handle, uint8_t alpha);
|
||||
void CloseSplashScreen(void);
|
||||
void CreateSplashScreen(const char *msg, int usecancel);
|
||||
void *UIConsoleGadgetCreate(UIWindow *parentid, int id, int x, int y, int font, int cols, int rows, int flags);
|
||||
|
@ -191,9 +191,9 @@ typedef struct {
|
||||
char voice_taunt2[_MAX_PATH];
|
||||
char voice_taunt3[_MAX_PATH];
|
||||
char voice_taunt4[_MAX_PATH];
|
||||
ubyte custom_file_seq;
|
||||
ubyte sequence; // where we are in the sequence chain
|
||||
ubyte pps;
|
||||
uint8_t custom_file_seq;
|
||||
uint8_t sequence; // where we are in the sequence chain
|
||||
uint8_t pps;
|
||||
HANDLE hPlayerEvent; // player event to use for directplay
|
||||
DWORD dpidPlayer; // directplay ID of player created
|
||||
float ping_time;
|
||||
@ -218,7 +218,7 @@ typedef struct {
|
||||
uint32_t flags;
|
||||
float last_update;
|
||||
bool dedicated_server;
|
||||
ubyte difficulty; // Game difficulty level
|
||||
uint8_t difficulty; // Game difficulty level
|
||||
uint32_t handle;
|
||||
} network_game;
|
||||
|
||||
@ -253,130 +253,130 @@ typedef struct {
|
||||
char connection_name[PAGENAME_LEN];
|
||||
network_address server_address; // The address of the server that we're talking to - not used if we are the server
|
||||
|
||||
ubyte local_role;
|
||||
ubyte server_sequence;
|
||||
uint8_t local_role;
|
||||
uint8_t server_sequence;
|
||||
float last_server_time; // last time we got a packet from the server
|
||||
ubyte packets_per_second; // how many packets per second we'll send out
|
||||
uint8_t packets_per_second; // how many packets per second we'll send out
|
||||
int flags;
|
||||
int timelimit; // how many minutes to play this level
|
||||
int killgoal; // kill goal for this level
|
||||
int respawn_time;
|
||||
int max_players;
|
||||
ubyte difficulty; // Game difficulty level
|
||||
uint8_t difficulty; // Game difficulty level
|
||||
u_char digest[16];
|
||||
} netgame_info;
|
||||
|
||||
// Inline functions for extracting/packing multiplayer data
|
||||
inline void MultiAddUbyte(ubyte element, ubyte *data, int *count) {
|
||||
inline void MultiAddUbyte(uint8_t element, uint8_t *data, int *count) {
|
||||
data[*count] = element;
|
||||
*count += sizeof(ubyte);
|
||||
*count += sizeof(uint8_t);
|
||||
}
|
||||
|
||||
inline void MultiAddByte(ubyte element, ubyte *data, int *count) {
|
||||
inline void MultiAddByte(uint8_t element, uint8_t *data, int *count) {
|
||||
data[*count] = element;
|
||||
*count += sizeof(ubyte);
|
||||
*count += sizeof(uint8_t);
|
||||
}
|
||||
|
||||
inline void MultiAddSbyte(int8_t element, ubyte *data, int *count) {
|
||||
inline void MultiAddSbyte(int8_t element, uint8_t *data, int *count) {
|
||||
data[*count] = element;
|
||||
*count += sizeof(int8_t);
|
||||
}
|
||||
|
||||
inline void MultiAddShort(short element, ubyte *data, int *count) {
|
||||
inline void MultiAddShort(short element, uint8_t *data, int *count) {
|
||||
*(short *)(data + *count) = INTEL_SHORT(element);
|
||||
*count += sizeof(short);
|
||||
}
|
||||
|
||||
inline void MultiAddUshort(ushort element, ubyte *data, int *count) {
|
||||
inline void MultiAddUshort(ushort element, uint8_t *data, int *count) {
|
||||
*(ushort *)(data + *count) = INTEL_SHORT(element);
|
||||
*count += sizeof(ushort);
|
||||
}
|
||||
|
||||
inline void MultiAddInt(int element, ubyte *data, int *count) {
|
||||
inline void MultiAddInt(int element, uint8_t *data, int *count) {
|
||||
*(int *)(data + *count) = INTEL_INT(element);
|
||||
*count += sizeof(int);
|
||||
}
|
||||
|
||||
inline void MultiAddUint(uint32_t element, ubyte *data, int *count) {
|
||||
inline void MultiAddUint(uint32_t element, uint8_t *data, int *count) {
|
||||
*(uint32_t *)(data + *count) = INTEL_INT(element);
|
||||
*count += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
inline void MultiAddFloat(float element, ubyte *data, int *count) {
|
||||
inline void MultiAddFloat(float element, uint8_t *data, int *count) {
|
||||
*(float *)(data + *count) = INTEL_FLOAT(element);
|
||||
*count += sizeof(float);
|
||||
}
|
||||
|
||||
inline void MultiAddString(const char *str, ubyte *data, int *count) {
|
||||
inline void MultiAddString(const char *str, uint8_t *data, int *count) {
|
||||
size_t len = strlen(str) + 1;
|
||||
assert(len <= 0xFF);
|
||||
|
||||
MultiAddByte((ubyte)len, data, count);
|
||||
MultiAddByte((uint8_t)len, data, count);
|
||||
memcpy(&data[*count], str, len);
|
||||
*count += len;
|
||||
}
|
||||
|
||||
inline ubyte MultiGetUbyte(ubyte *data, int *count) {
|
||||
ubyte element = (*(ubyte *)(data + *count));
|
||||
(*count) += sizeof(ubyte);
|
||||
inline uint8_t MultiGetUbyte(uint8_t *data, int *count) {
|
||||
uint8_t element = (*(uint8_t *)(data + *count));
|
||||
(*count) += sizeof(uint8_t);
|
||||
return element;
|
||||
}
|
||||
|
||||
inline ubyte MultiGetByte(ubyte *data, int *count) {
|
||||
ubyte element = (*(ubyte *)(data + *count));
|
||||
(*count) += sizeof(ubyte);
|
||||
inline uint8_t MultiGetByte(uint8_t *data, int *count) {
|
||||
uint8_t element = (*(uint8_t *)(data + *count));
|
||||
(*count) += sizeof(uint8_t);
|
||||
return element;
|
||||
}
|
||||
|
||||
inline int8_t MultiGetSbyte(ubyte *data, int *count) {
|
||||
inline int8_t MultiGetSbyte(uint8_t *data, int *count) {
|
||||
int8_t element = (*(int8_t *)(data + *count));
|
||||
(*count) += sizeof(int8_t);
|
||||
return element;
|
||||
}
|
||||
|
||||
inline short MultiGetShort(ubyte *data, int *count) {
|
||||
inline short MultiGetShort(uint8_t *data, int *count) {
|
||||
short element = (*(short *)(data + *count));
|
||||
*count += sizeof(short);
|
||||
return INTEL_SHORT(element);
|
||||
}
|
||||
|
||||
inline ushort MultiGetUshort(ubyte *data, int *count) {
|
||||
inline ushort MultiGetUshort(uint8_t *data, int *count) {
|
||||
ushort element = (*(ushort *)(data + *count));
|
||||
*count += sizeof(short);
|
||||
return INTEL_SHORT(element);
|
||||
}
|
||||
|
||||
inline int MultiGetInt(ubyte *data, int *count) {
|
||||
inline int MultiGetInt(uint8_t *data, int *count) {
|
||||
int element = (*(int *)(data + *count));
|
||||
*count += sizeof(int);
|
||||
return INTEL_INT(element);
|
||||
}
|
||||
|
||||
inline uint32_t MultiGetUint(ubyte *data, int *count) {
|
||||
inline uint32_t MultiGetUint(uint8_t *data, int *count) {
|
||||
uint32_t element = (*(uint32_t *)(data + *count));
|
||||
*count += sizeof(int);
|
||||
return INTEL_INT(element);
|
||||
}
|
||||
|
||||
inline float MultiGetFloat(ubyte *data, int *count) {
|
||||
inline float MultiGetFloat(uint8_t *data, int *count) {
|
||||
float element = (*(float *)(data + *count));
|
||||
*count += sizeof(float);
|
||||
return INTEL_FLOAT(element);
|
||||
}
|
||||
|
||||
inline void MultiGetString(char *str, ubyte *data, int *count) {
|
||||
ubyte len = MultiGetByte(data, count);
|
||||
inline void MultiGetString(char *str, uint8_t *data, int *count) {
|
||||
uint8_t len = MultiGetByte(data, count);
|
||||
memcpy(str, &data[*count], len);
|
||||
*count += len;
|
||||
}
|
||||
|
||||
inline void MultiAddVector(vector v, ubyte *data, int *count) {
|
||||
inline void MultiAddVector(vector v, uint8_t *data, int *count) {
|
||||
MultiAddFloat(v.x, data, count);
|
||||
MultiAddFloat(v.y, data, count);
|
||||
MultiAddFloat(v.z, data, count);
|
||||
}
|
||||
|
||||
inline vector MultiGetVector(ubyte *data, int *count) {
|
||||
inline vector MultiGetVector(uint8_t *data, int *count) {
|
||||
vector v;
|
||||
|
||||
v.x = MultiGetFloat(data, count);
|
||||
|
@ -166,7 +166,7 @@
|
||||
* prevention
|
||||
*
|
||||
* 231 5/03/99 4:22p Jeff
|
||||
* changed byte var to ubyte type for Linux
|
||||
* changed byte var to uint8_t type for Linux
|
||||
*
|
||||
* 230 5/03/99 2:36p Jason
|
||||
* changes for multiplayer games
|
||||
@ -936,7 +936,7 @@ void MultiCheckListen() {
|
||||
// Tells the client that we're done sending players
|
||||
void MultiSendDonePlayers(int slot) {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending done players\n"));
|
||||
@ -952,7 +952,7 @@ void MultiSendDonePlayers(int slot) {
|
||||
// Tells the client that we're done sending buildings
|
||||
void MultiSendDoneBuildings(int slot) {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending done buildings\n"));
|
||||
@ -966,7 +966,7 @@ void MultiSendDoneBuildings(int slot) {
|
||||
// Tells the client that we're done sending objects
|
||||
void MultiSendDoneObjects(int slot) {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending done objects\n"));
|
||||
@ -994,7 +994,7 @@ void MultiSendDoneObjects(int slot) {
|
||||
// Tells the client that we're done sending the world states
|
||||
void MultiSendDoneWorldStates(int slot) {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending done world states\n"));
|
||||
@ -1020,7 +1020,7 @@ void MultiClearPlayerMarkers(int slot) {
|
||||
// Tells our clients that a player disconnected
|
||||
void MultiSendPlayerDisconnect(int slot) {
|
||||
int size, count = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
|
||||
size = START_DATA(MP_DISCONNECT, data, &count);
|
||||
|
||||
@ -1112,7 +1112,7 @@ void MultiDisconnectPlayer(int slot) {
|
||||
void MultiSendPlayer(int slot, int which) {
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -1149,7 +1149,7 @@ void MultiSendPlayer(int slot, int which) {
|
||||
if (slot == which) {
|
||||
int myteam = GameDLLGetConnectingPlayersTeam(slot);
|
||||
|
||||
ubyte temp_team = (myteam == -1) ? 255 : myteam;
|
||||
uint8_t temp_team = (myteam == -1) ? 255 : myteam;
|
||||
MultiAddByte(temp_team, data, &count);
|
||||
|
||||
if (myteam >= 0 && myteam <= 4)
|
||||
@ -1162,7 +1162,7 @@ void MultiSendPlayer(int slot, int which) {
|
||||
|
||||
MultiAddShort(Players[slot].start_index, data, &count);
|
||||
} else {
|
||||
ubyte temp_team = (Players[which].team == -1) ? 255 : Players[which].team;
|
||||
uint8_t temp_team = (Players[which].team == -1) ? 255 : Players[which].team;
|
||||
MultiAddByte(temp_team, data, &count);
|
||||
}
|
||||
|
||||
@ -1204,7 +1204,7 @@ void MultiSendPlayer(int slot, int which) {
|
||||
void MultiSendBuildings(int slot) {
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -1253,7 +1253,7 @@ bool MultiIsValidMovedObject(object *obj) {
|
||||
}
|
||||
|
||||
void MultiSendJoinDemoObjects(int slot) {
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset, i;
|
||||
|
||||
@ -1283,7 +1283,7 @@ void MultiSendJoinDemoObjects(int slot) {
|
||||
nw_SendReliable(NetPlayers[slot].reliable_socket, data, count);
|
||||
}
|
||||
|
||||
int StuffObjectIntoPacket(object *obj, ubyte *data) {
|
||||
int StuffObjectIntoPacket(object *obj, uint8_t *data) {
|
||||
uint32_t index;
|
||||
int count = 0;
|
||||
bool obj_is_dummy = false;
|
||||
@ -1335,7 +1335,7 @@ int StuffObjectIntoPacket(object *obj, ubyte *data) {
|
||||
|
||||
if (obj->type == OBJ_MARKER) {
|
||||
// Add marker message to the end of this
|
||||
ubyte len = strlen(MarkerMessages[obj->id]) + 1;
|
||||
uint8_t len = strlen(MarkerMessages[obj->id]) + 1;
|
||||
MultiAddByte(len, data, &count);
|
||||
memcpy(data + count, MarkerMessages[obj->id], len);
|
||||
count += len;
|
||||
@ -1357,7 +1357,7 @@ int StuffObjectIntoPacket(object *obj, ubyte *data) {
|
||||
void MultiSendJoinObjects(int slot) {
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
ushort outgoing_objects[MAX_OBJECTS];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
@ -1417,7 +1417,7 @@ void MultiSendJoinObjects(int slot) {
|
||||
for (i = 0; i < num_objects_this_packet && !overflow; i++) {
|
||||
// Add objnum and id
|
||||
object *obj = &Objects[outgoing_objects[i + cur_object]];
|
||||
ubyte obj_data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t obj_data[MAX_GAME_DATA_SIZE];
|
||||
|
||||
int num_bytes = StuffObjectIntoPacket(obj, obj_data);
|
||||
|
||||
@ -1447,7 +1447,7 @@ void MultiSendJoinObjects(int slot) {
|
||||
MultiSendJoinDemoObjects(slot);
|
||||
}
|
||||
|
||||
void MultiStoreWorldPacket(int slot, ubyte *big_data, int *big_count, ubyte *cur_data, int *cur_count,
|
||||
void MultiStoreWorldPacket(int slot, uint8_t *big_data, int *big_count, uint8_t *cur_data, int *cur_count,
|
||||
int *size_offset) {
|
||||
if (*big_count + *cur_count >= (MAX_GAME_DATA_SIZE - 3)) {
|
||||
mprintf((0, "Starting another world packet!\n"));
|
||||
@ -1474,8 +1474,8 @@ void MultiSendWorldStates(int slot) {
|
||||
int i;
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
ubyte cur_data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t cur_data[MAX_GAME_DATA_SIZE];
|
||||
int cur_count;
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
@ -1820,7 +1820,7 @@ void MultiSendWorldStates(int slot) {
|
||||
}
|
||||
|
||||
// Sends this reliable packet to everyone except the server and the named slot
|
||||
void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_threshold, bool urgent) {
|
||||
void MultiSendReliablyToAllExcept(int except, uint8_t *data, int size, int seq_threshold, bool urgent) {
|
||||
for (int i = 0; i < MAX_NET_PLAYERS; i++) {
|
||||
if (!(NetPlayers[i].flags & NPF_CONNECTED))
|
||||
continue;
|
||||
@ -1835,7 +1835,7 @@ void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_thr
|
||||
}
|
||||
|
||||
// Sends this nonreliable packet to everyone except the server and the named slot
|
||||
void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold) {
|
||||
void MultiSendToAllExcept(int except, uint8_t *data, int size, int seq_threshold) {
|
||||
|
||||
ASSERT(Netgame.local_role == LR_SERVER);
|
||||
for (int i = 0; i < MAX_NET_PLAYERS; i++) {
|
||||
@ -1853,7 +1853,7 @@ void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold)
|
||||
|
||||
// Flushes all receive sockets so that there is no data coming from them
|
||||
void MultiFlushAllIncomingBuffers() {
|
||||
ubyte *data;
|
||||
uint8_t *data;
|
||||
network_address from_addr;
|
||||
int size;
|
||||
|
||||
@ -1903,7 +1903,7 @@ void MultiCheckToRepositionPowerups() {
|
||||
if (obj->flags & OF_STOPPED_THIS_FRAME) {
|
||||
// Send out our positional change
|
||||
int count = 0;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int size = START_DATA(MP_POWERUP_REPOSITION, data, &count);
|
||||
changed++;
|
||||
|
||||
@ -1982,11 +1982,11 @@ void MultiCheckToRespawnPowerups() {
|
||||
extern int Multi_occluded;
|
||||
// Sends out positional updates based on clients pps
|
||||
void MultiSendPositionalUpdates(int to_slot) {
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
|
||||
// Figure out if we should send positional updates to players
|
||||
for (int i = 0; i < MAX_PLAYERS; i++) {
|
||||
ubyte send_position = 0, timer_popped = 0;
|
||||
uint8_t send_position = 0, timer_popped = 0;
|
||||
|
||||
if ((Netgame.flags & NF_PEER_PEER) && i != Player_num)
|
||||
continue; // Don't send out other positions if in peer mode
|
||||
@ -2184,7 +2184,7 @@ void MultiSetupNonVisRobots(int slot, object *obj) { obj->generic_nonvis_flags |
|
||||
|
||||
// Sends out a list of generics that this client can't see
|
||||
void MultiSendGenericNonVis(int slot, ushort *objarray, int num) {
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -2369,7 +2369,7 @@ bool MultiIsGenericVisibleToPlayer(int test_objnum, int to_slot) {
|
||||
void MultiDoServerRobotFrame(int slot) {
|
||||
int rcount = 0;
|
||||
int m = 0;
|
||||
ubyte rdata[MAX_GAME_DATA_SIZE];
|
||||
uint8_t rdata[MAX_GAME_DATA_SIZE];
|
||||
|
||||
// send robot information for any robots that have moved.
|
||||
for (m = 0; m < Num_moved_robots[slot]; m++) {
|
||||
@ -2734,7 +2734,7 @@ void MultiDoServerFrame() {
|
||||
|
||||
// Tells clients to execute dlls on their machines
|
||||
void MultiSendClientExecuteDLL(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info) {
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -2959,9 +2959,9 @@ int GetRankIndex(int pnum, char *rankbuf) {
|
||||
}
|
||||
|
||||
// Tells the clients to change rank for a player
|
||||
void MultiSendChangeRank(int pnum, char *str, ubyte goodnews) {
|
||||
void MultiSendChangeRank(int pnum, char *str, uint8_t goodnews) {
|
||||
int size;
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
|
||||
mprintf((0, "Sending change rank!\n"));
|
||||
@ -2981,7 +2981,7 @@ void MultiSendChangeRank(int pnum, char *str, ubyte goodnews) {
|
||||
void ChangeRankIndex(int old_index, int pnum) {
|
||||
char str[255];
|
||||
int new_index = GetRankIndex(pnum);
|
||||
ubyte goodnews = 1;
|
||||
uint8_t goodnews = 1;
|
||||
|
||||
if (old_index < new_index) // promoted
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ void MultiDisconnectPlayer(int slot);
|
||||
void MultiSendPlayer(int slot, int which);
|
||||
|
||||
// Sends this reliable packet to everyone except the server and the named slot
|
||||
void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_threshold = 0, bool urgent = 1);
|
||||
void MultiSendReliablyToAllExcept(int except, uint8_t *data, int size, int seq_threshold = 0, bool urgent = 1);
|
||||
|
||||
// Tells clients to execute dlls on their machines
|
||||
void MultiSendClientExecuteDLL(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info = NULL);
|
||||
|
@ -1298,10 +1298,10 @@ extern bool Demo_call_ok;
|
||||
// The main entry point for all the multisafe functions
|
||||
// Pass the type of function you want, and then fill in the relevant fields
|
||||
// of the mstruct
|
||||
void msafe_CallFunction(ubyte type, msafe_struct *mstruct) {
|
||||
void msafe_CallFunction(uint8_t type, msafe_struct *mstruct) {
|
||||
if ((Demo_flags == DF_PLAYBACK) && (!Demo_call_ok))
|
||||
return;
|
||||
ubyte send_it = 1;
|
||||
uint8_t send_it = 1;
|
||||
switch (type) {
|
||||
case MSAFE_WEATHER_RAIN:
|
||||
SetRainState(mstruct->state, mstruct->scalar);
|
||||
@ -2458,17 +2458,17 @@ bool AddPowerupEnergyToPlayer(int id) {
|
||||
return true;
|
||||
}
|
||||
// returns true if it was handled
|
||||
bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup);
|
||||
bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup);
|
||||
bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pickup);
|
||||
bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup);
|
||||
bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup);
|
||||
bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup);
|
||||
bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup);
|
||||
bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup);
|
||||
// Does whatever magic needs to be done to get the default powerups to work
|
||||
void msafe_DoPowerup(msafe_struct *mstruct) {
|
||||
char pname[255];
|
||||
strcpy(pname, Object_info[MOBJ->id].name);
|
||||
ASSERT(MOBJ->type == OBJ_POWERUP);
|
||||
ASSERT(IOBJ->type == OBJ_PLAYER);
|
||||
ubyte pickup = 0;
|
||||
uint8_t pickup = 0;
|
||||
// Now go through and do the magic for each powerup
|
||||
bool handled = false;
|
||||
handled = HandleCommonPowerups(pname, mstruct, &pickup);
|
||||
@ -2567,9 +2567,9 @@ void CheckForWeaponSelect(int id, int weapon_index) {
|
||||
}
|
||||
}
|
||||
}
|
||||
extern ubyte AutomapVisMap[MAX_ROOMS];
|
||||
extern uint8_t AutomapVisMap[MAX_ROOMS];
|
||||
// New spiffy table-based code
|
||||
bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) {
|
||||
object *player = ObjGet(mstruct->ithandle);
|
||||
object *powerup = ObjGet(mstruct->objhandle);
|
||||
int p;
|
||||
@ -2676,7 +2676,7 @@ bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
return handled;
|
||||
}
|
||||
// returns true if it was handled
|
||||
bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) {
|
||||
int pnum = IOBJ->id;
|
||||
bool handled = false;
|
||||
// Shield bonus
|
||||
@ -2796,7 +2796,7 @@ bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) {
|
||||
bool handled = false;
|
||||
// Chaff
|
||||
if (!stricmp("Chaff", pname)) {
|
||||
@ -2980,7 +2980,7 @@ bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pic
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) {
|
||||
bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) {
|
||||
bool handled = false;
|
||||
int pnum = IOBJ->id;
|
||||
// Afterburner cooler
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "osiris_share.h"
|
||||
|
||||
// LOCAL MULTISAFE FUNCTIONS
|
||||
void msafe_CallFunction(ubyte type, msafe_struct *mstruct);
|
||||
void msafe_CallFunction(uint8_t type, msafe_struct *mstruct);
|
||||
void msafe_DoPowerup(msafe_struct *mstruct);
|
||||
|
||||
// Gets a value for the calling party
|
||||
@ -32,7 +32,7 @@ void msafe_GetValue(int type, msafe_struct *mstruct);
|
||||
|
||||
// MULTPLAYER SPECIFIC STUFF
|
||||
// MULTISAFE FUNCTIONS
|
||||
void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct);
|
||||
void MultiSendMSafeFunction(uint8_t type, msafe_struct *mstruct);
|
||||
void MultiSendMSafePowerup(msafe_struct *mstruct);
|
||||
|
||||
#endif
|
||||
|
@ -54,13 +54,13 @@ int VerifyMSafeObject(int objnum) {
|
||||
// this bool tells msafe if it's ok to process a call even though it's playing back a demo.
|
||||
bool Demo_call_ok = false;
|
||||
// Extracts the multisafe function to be executed on the client machine
|
||||
void MultiDoMSafeFunction(ubyte *data) {
|
||||
void MultiDoMSafeFunction(uint8_t *data) {
|
||||
msafe_struct base_mstruct;
|
||||
msafe_struct *mstruct = &base_mstruct;
|
||||
int count = 0;
|
||||
|
||||
SKIP_HEADER(data, &count);
|
||||
ubyte type = MultiGetUbyte(data, &count);
|
||||
uint8_t type = MultiGetUbyte(data, &count);
|
||||
switch (type) {
|
||||
case MSAFE_WEATHER_RAIN:
|
||||
mstruct->state = MultiGetByte(data, &count);
|
||||
@ -507,14 +507,14 @@ void MultiDoMSafeFunction(ubyte *data) {
|
||||
}
|
||||
}
|
||||
|
||||
void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct) {
|
||||
void MultiSendMSafeFunction(uint8_t type, msafe_struct *mstruct) {
|
||||
int sequence = -1;
|
||||
int to_slot = -1;
|
||||
uint32_t to_bitmask = 0xFFFFFFFF;
|
||||
|
||||
ASSERT((Demo_flags == DF_RECORDING) || (Netgame.local_role == LR_SERVER));
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
@ -1122,7 +1122,7 @@ void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct) {
|
||||
}
|
||||
|
||||
// Resolves a powerup that the server is telling us about
|
||||
void MultiDoMSafePowerup(ubyte *data) {
|
||||
void MultiDoMSafePowerup(uint8_t *data) {
|
||||
int count = 0;
|
||||
msafe_struct base_mstruct;
|
||||
msafe_struct *mstruct = &base_mstruct;
|
||||
@ -1151,7 +1151,7 @@ void MultiSendMSafePowerup(msafe_struct *mstruct) {
|
||||
|
||||
// ASSERT (Netgame.local_role==LR_SERVER);
|
||||
|
||||
ubyte data[MAX_GAME_DATA_SIZE];
|
||||
uint8_t data[MAX_GAME_DATA_SIZE];
|
||||
int count = 0;
|
||||
int size_offset;
|
||||
|
||||
|
@ -484,7 +484,7 @@ void NewUIClose() {
|
||||
// DoWaitMessage(false);
|
||||
void DoWaitMessage(bool enable, const char *message) {
|
||||
static bool opened = false;
|
||||
static ubyte cur_pos = 0;
|
||||
static uint8_t cur_pos = 0;
|
||||
float curpos_f;
|
||||
|
||||
// if (1) return;
|
||||
@ -848,7 +848,7 @@ void DrawLargeBitmap(tLargeBitmap *bmp, int x, int y, float alpha) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Listbox procedure.
|
||||
|
||||
ubyte NewUIWindow_alpha = 192;
|
||||
uint8_t NewUIWindow_alpha = 192;
|
||||
|
||||
NewUIWindow::NewUIWindow() : UIWindow() {}
|
||||
|
||||
|
@ -299,7 +299,7 @@ typedef struct tLargeBitmap {
|
||||
} tLargeBitmap;
|
||||
|
||||
// alpha for all NewUIWindows.
|
||||
extern ubyte NewUIWindow_alpha;
|
||||
extern uint8_t NewUIWindow_alpha;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Core interface with UI system
|
||||
|
@ -2198,7 +2198,7 @@ void newuiButton::OnDestroy() {
|
||||
}
|
||||
|
||||
void newuiButton::OnDraw() {
|
||||
ubyte alpha = IsDisabled() ? 128 : 255;
|
||||
uint8_t alpha = IsDisabled() ? 128 : 255;
|
||||
|
||||
if (GetStateItem(m_State)) {
|
||||
GetStateItem(m_State)->set_alpha(alpha);
|
||||
@ -3130,7 +3130,7 @@ void newuiListBox::OnDraw() {
|
||||
|
||||
// draw text?
|
||||
int i;
|
||||
ubyte alpha = 255;
|
||||
uint8_t alpha = 255;
|
||||
bool auto_select = ((m_Flags & UILB_AUTOSELECT) > 0);
|
||||
bool use_scroll = true;
|
||||
|
||||
|
@ -1210,7 +1210,7 @@ static short free_obj_list[MAX_OBJECTS];
|
||||
object Objects[MAX_OBJECTS];
|
||||
|
||||
tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY];
|
||||
ubyte Object_position_head;
|
||||
uint8_t Object_position_head;
|
||||
int16_t Object_map_position_history[MAX_OBJECTS];
|
||||
short Object_map_position_free_slots[MAX_OBJECT_POS_HISTORY];
|
||||
uint16_t Num_free_object_position_history;
|
||||
@ -1680,7 +1680,7 @@ void ObjSetAABB(object *obj) {
|
||||
//-----------------------------------------------------------------------------
|
||||
// initialize a new object. adds to the list for the given room
|
||||
// returns the object number
|
||||
int ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle) {
|
||||
int ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle) {
|
||||
int objnum;
|
||||
object *obj;
|
||||
int handle;
|
||||
@ -2398,7 +2398,7 @@ void DoFlyingControl(object *objp) {
|
||||
// Send an event to the Game DLLs so they can do any processing of game controls
|
||||
if (Game_mode & GM_MULTI) {
|
||||
DLLInfo.me_handle = DLLInfo.it_handle = objp->handle;
|
||||
DLLInfo.special_data = (ubyte *)&controls;
|
||||
DLLInfo.special_data = (uint8_t *)&controls;
|
||||
CallGameDLL(EVT_GAMEDOCONTROLS, &DLLInfo);
|
||||
}
|
||||
|
||||
|
@ -741,7 +741,7 @@ void ObjSetAABB(object *obj);
|
||||
|
||||
// initialize a new object. adds to the list for the given room
|
||||
// returns the object number
|
||||
int ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient,
|
||||
int ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient,
|
||||
int parent_handle = OBJECT_HANDLE_NONE);
|
||||
|
||||
// remove object from the world
|
||||
@ -824,7 +824,7 @@ typedef struct {
|
||||
vector pos[MAX_POSITION_HISTORY];
|
||||
} tPosHistory;
|
||||
extern tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY];
|
||||
extern ubyte Object_position_head;
|
||||
extern uint8_t Object_position_head;
|
||||
extern int16_t Object_map_position_history[MAX_OBJECTS];
|
||||
extern float Last_position_history_update[MAX_POSITION_HISTORY]; // last gametime the positions were updated
|
||||
void ObjInitPositionHistory(object *obj);
|
||||
|
@ -156,7 +156,7 @@ void FindPlayerThrusterColor(int slot, float *r, float *g, float *b) {
|
||||
Int3(); // No thruster glow?
|
||||
}
|
||||
|
||||
ubyte EasterEgg = 0;
|
||||
uint8_t EasterEgg = 0;
|
||||
#define EASTER_EGG_TIMER (3600 * 4)
|
||||
|
||||
void ReflectRay(vector *, vector *, vector *);
|
||||
|
@ -373,7 +373,7 @@ typedef struct {
|
||||
short from, to;
|
||||
float spc;
|
||||
int anim_sound_index;
|
||||
ubyte used;
|
||||
uint8_t used;
|
||||
} anim_entry;
|
||||
|
||||
typedef struct {
|
||||
@ -500,7 +500,7 @@ typedef struct {
|
||||
|
||||
// Death information
|
||||
death_info death_types[MAX_DEATH_TYPES]; // the ways this object can die
|
||||
ubyte death_probabilities[MAX_DEATH_TYPES]; // how likely each death is, from 0-100 (percent)
|
||||
uint8_t death_probabilities[MAX_DEATH_TYPES]; // how likely each death is, from 0-100 (percent)
|
||||
|
||||
// Valid for AI objects only
|
||||
t_ai_info *ai_info; // the AI info for this obj type
|
||||
|
@ -250,7 +250,7 @@ extern void Osiris_CancelTimer(int handle);
|
||||
// Osiris_TimerExists
|
||||
// Purpose:
|
||||
// Returns true if the timer is valid
|
||||
extern ubyte Osiris_TimerExists(int handle);
|
||||
extern uint8_t Osiris_TimerExists(int handle);
|
||||
|
||||
// Osiris_SaveSystemState
|
||||
// Purpose:
|
||||
@ -322,11 +322,11 @@ extern bool Show_osiris_debug;
|
||||
// Osiris_EnableEvents
|
||||
// Purpose:
|
||||
// Enables the passed in mask of event types to be called
|
||||
extern void Osiris_EnableEvents(ubyte mask);
|
||||
extern void Osiris_EnableEvents(uint8_t mask);
|
||||
// Osiris_DisableEvents
|
||||
// Purpose:
|
||||
// Disables the passed in mask of event types
|
||||
extern void Osiris_DisableEvents(ubyte mask);
|
||||
extern void Osiris_DisableEvents(uint8_t mask);
|
||||
|
||||
// Osiris_DisableCreateEvents
|
||||
// Purpose:
|
||||
|
@ -585,7 +585,7 @@ int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags
|
||||
return GoalAddGoal(obj, AIG_FOLLOW_PATH, (void *)&path_info, slot, 1.0f, flags, guid);
|
||||
}
|
||||
|
||||
int osipf_AIPowerSwitch(int objhandle, ubyte f_power_on) {
|
||||
int osipf_AIPowerSwitch(int objhandle, uint8_t f_power_on) {
|
||||
object *obj = ObjGet(objhandle);
|
||||
if (!obj) {
|
||||
mprintf((0, "Illegal Object passed to AIPowerSwitch\n"));
|
||||
@ -1632,7 +1632,7 @@ void osipf_ObjectValue(int handle, char op, char var_handle, void *ptr, int inde
|
||||
}
|
||||
}
|
||||
|
||||
ubyte osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec) {
|
||||
uint8_t osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec) {
|
||||
object *objp = ObjGet(objhandle);
|
||||
|
||||
if (!objp) {
|
||||
@ -2030,7 +2030,7 @@ float osipf_AIGetDistToObj(int objhandle, int otherobjhandle) {
|
||||
return dist;
|
||||
}
|
||||
|
||||
int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, ubyte f_enable) {
|
||||
int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, uint8_t f_enable) {
|
||||
object *obj = ObjGet(objhandle);
|
||||
|
||||
if (obj == NULL) {
|
||||
@ -2101,7 +2101,7 @@ void osipf_GetGroundPos(int objhandle, int ground_number, vector *ground_pnt, ve
|
||||
PhysCalcGround(ground_pnt, ground_normal, obj, ground_number);
|
||||
}
|
||||
|
||||
ubyte osipf_IsRoomValid(int roomnum) {
|
||||
uint8_t osipf_IsRoomValid(int roomnum) {
|
||||
if (roomnum == -1.0) {
|
||||
return 0;
|
||||
} else if (ROOMNUM_OUTSIDE(roomnum)) {
|
||||
@ -2158,7 +2158,7 @@ int osipf_GetAttachChildHandle(int objhandle, char attachpoint) {
|
||||
return (OBJECT_HANDLE_NONE);
|
||||
}
|
||||
|
||||
int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, ubyte f_use_aligned) {
|
||||
int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, uint8_t f_use_aligned) {
|
||||
object *parent = ObjGet(parenthandle);
|
||||
object *child = ObjGet(childhandle);
|
||||
|
||||
@ -2465,7 +2465,7 @@ int osipf_RayCast(int objhandle, vector *p0, vector *p1, int start_roomnum, floa
|
||||
// data, such as a string or a bitmap of 8-bit pixels.
|
||||
// Returns the number of bytes read.
|
||||
// Throws an exception of type (cfile_error *) if the OS returns an error on read
|
||||
int osipf_CFReadBytes(ubyte *buffer, int count, CFILE *cfp) { return cf_ReadBytes(buffer, count, cfp); }
|
||||
int osipf_CFReadBytes(uint8_t *buffer, int count, CFILE *cfp) { return cf_ReadBytes(buffer, count, cfp); }
|
||||
|
||||
// The following functions read numeric vales from a CFILE. All values are
|
||||
// stored in the file in Intel (little-endian) format. These functions
|
||||
@ -2509,7 +2509,7 @@ int osipf_CFReadString(char *buf, size_t n, CFILE *cfp) { return cf_ReadString(b
|
||||
// data, such as a string or a bitmap of 8-bit pixels.
|
||||
// Returns the number of bytes written.
|
||||
// Throws an exception of type (cfile_error *) if the OS returns an error on write
|
||||
int osipf_CFWriteBytes(const ubyte *buf, int count, CFILE *cfp) { return cf_WriteBytes(buf, count, cfp); }
|
||||
int osipf_CFWriteBytes(const uint8_t *buf, int count, CFILE *cfp) { return cf_WriteBytes(buf, count, cfp); }
|
||||
|
||||
// Writes a null-terminated string to a file. If the file is type binary,
|
||||
// the string is terminated in the file with a null. If the file is type
|
||||
@ -2567,7 +2567,7 @@ void osipf_OpenMessageWindow(const char *title, ...) {
|
||||
Int3(); // ummm, this is a blank function, should we ever be calling it?
|
||||
}
|
||||
|
||||
int osipf_ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
|
||||
int osipf_ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle,
|
||||
vector *initial_velocity) {
|
||||
object *obj;
|
||||
int objnum;
|
||||
@ -2792,7 +2792,7 @@ void osipf_ObjWBValue(int obj_handle, char wb_index, char op, char vtype, void *
|
||||
// Sets/Clears mission flags
|
||||
// flag is which mission flag to set/clear (1-32)
|
||||
// value is 0 to clear, or 1 to set
|
||||
void osipf_MissionFlagSet(int flag, ubyte value) {
|
||||
void osipf_MissionFlagSet(int flag, uint8_t value) {
|
||||
if (flag < 1 && flag > 32) {
|
||||
mprintf((0, "Invalid flag passed to osipf_MissionFlagSet(%d)\n", flag));
|
||||
return;
|
||||
@ -2901,7 +2901,7 @@ void osipf_CFclose(CFILE *file) { cfclose(file); }
|
||||
|
||||
int osipf_CFtell(CFILE *file) { return cftell(file); }
|
||||
|
||||
ubyte osipf_CFeof(CFILE *file) { return (cfeof(file) != 0) ? 1 : 0; }
|
||||
uint8_t osipf_CFeof(CFILE *file) { return (cfeof(file) != 0) ? 1 : 0; }
|
||||
|
||||
void osipf_SoundStop(int s_handle, bool f_immediately) {
|
||||
// JEFF - sorry, this can't be made multiplayer friendly
|
||||
|
@ -204,7 +204,7 @@ void osipf_GetGunPos(int objhandle, int gun_number, vector *gun_pnt, vector *gun
|
||||
|
||||
// Returns room values (Index is optional and not always used)
|
||||
void osipf_RoomValue(int roomnum, char op, char vhandle, void *ptr, int index = 0);
|
||||
ubyte osipf_IsRoomValid(int roomnum);
|
||||
uint8_t osipf_IsRoomValid(int roomnum);
|
||||
|
||||
// Returns player only values (Index is optional and not always used)
|
||||
void osipf_PlayerValue(int obj_handle, char op, char vhandle, void *ptr, int index = 0);
|
||||
@ -214,7 +214,7 @@ void osipf_ObjectCustomAnim(int handle, float start, float end, float time, char
|
||||
int osipf_GetAttachParent(int childhandle);
|
||||
int osipf_GetNumAttachSlots(int objhandle);
|
||||
int osipf_GetAttachChildHandle(int objhandle, char attachpoint);
|
||||
int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, ubyte f_use_aligned);
|
||||
int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, uint8_t f_use_aligned);
|
||||
int osipf_AttachObjectRad(int parenthandle, char parent_ap, int childhandle, float percent_rad);
|
||||
void osipf_UnattachFromParent(int objhandle);
|
||||
void osipf_UnattachChild(int objhandle, char parent_ap);
|
||||
@ -233,19 +233,19 @@ int osipf_AIFindEnergyCenter(int objhandle);
|
||||
float osipf_AIGetDistToObj(int objhandle, int otherobjhandle);
|
||||
|
||||
void osipf_AISetType(int objhandle, int type);
|
||||
int osipf_AIPowerSwitch(int objhandle, ubyte f_power_on);
|
||||
int osipf_AIPowerSwitch(int objhandle, uint8_t f_power_on);
|
||||
|
||||
int osipf_AIGoalAdd(int objhandle, int goal_type, int level, float influence, int guid, int flags, ...);
|
||||
int osipf_AIGoalAddEnabler(int objhandle, int goal_index, int enabler_type, float percent, float interval, void *ptr);
|
||||
void osipf_AIGoalClear(int objhandle, int goal_index);
|
||||
int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags, int slot = 3);
|
||||
void osipf_AISetGoalCircleDist(int objhandle, int goal_handle, float dist);
|
||||
int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, ubyte f_enable);
|
||||
int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, uint8_t f_enable);
|
||||
|
||||
ubyte osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec);
|
||||
ubyte osipf_AIMoveTowardsPosition(int objhandle, vector *pos, int *roomnum, float scalar, bool f_bline,
|
||||
uint8_t osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec);
|
||||
uint8_t osipf_AIMoveTowardsPosition(int objhandle, vector *pos, int *roomnum, float scalar, bool f_bline,
|
||||
bool f_bline_if_vis);
|
||||
ubyte osipf_AIMoveTowardsDir(int objhandle, vector *dir, float scalar);
|
||||
uint8_t osipf_AIMoveTowardsDir(int objhandle, vector *dir, float scalar);
|
||||
|
||||
void osipf_AIValue(int objhandle, char op, char vtype, void *ptr);
|
||||
|
||||
@ -254,7 +254,7 @@ void osipf_AIValue(int objhandle, char op, char vtype, void *ptr);
|
||||
// data, such as a string or a bitmap of 8-bit pixels.
|
||||
// Returns the number of bytes read.
|
||||
// Throws an exception of type (cfile_error *) if the OS returns an error on read
|
||||
int osipf_CFReadBytes(ubyte *buffer, int count, CFILE *cfp);
|
||||
int osipf_CFReadBytes(uint8_t *buffer, int count, CFILE *cfp);
|
||||
|
||||
// The following functions read numeric vales from a CFILE. All values are
|
||||
// stored in the file in Intel (little-endian) format. These functions
|
||||
@ -298,7 +298,7 @@ int osipf_CFReadString(char *buf, size_t n, CFILE *cfp);
|
||||
// data, such as a string or a bitmap of 8-bit pixels.
|
||||
// Returns the number of bytes written.
|
||||
// Throws an exception of type (cfile_error *) if the OS returns an error on write
|
||||
int osipf_CFWriteBytes(const ubyte *buf, int count, CFILE *cfp);
|
||||
int osipf_CFWriteBytes(const uint8_t *buf, int count, CFILE *cfp);
|
||||
|
||||
// Writes a null-terminated string to a file. If the file is type binary,
|
||||
// the string is terminated in the file with a null. If the file is type
|
||||
@ -341,7 +341,7 @@ void osipf_SetAllControls(bool enabled);
|
||||
void osipf_SetControls(int fn, bool enabled);
|
||||
|
||||
// Creates an object
|
||||
int osipf_ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL,
|
||||
int osipf_ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL,
|
||||
int parent_handle = OBJECT_HANDLE_NONE, vector *velocity = NULL);
|
||||
|
||||
// OBJECT Properties.
|
||||
@ -363,7 +363,7 @@ int osipf_MatcenFindId(char *str);
|
||||
// Sets/Clears mission flags
|
||||
// flag is which mission flag to set/clear (1-32)
|
||||
// value is 0 to clear, or 1 to set
|
||||
void osipf_MissionFlagSet(int flag, ubyte value);
|
||||
void osipf_MissionFlagSet(int flag, uint8_t value);
|
||||
|
||||
// Gets a mission flag
|
||||
// flag is what mission flag to get. Returns 1 if set, 0 if not.
|
||||
@ -384,7 +384,7 @@ void osipf_CFclose(CFILE *file);
|
||||
int osipf_CFtell(CFILE *file);
|
||||
|
||||
// returns 1 if the file is at the EOF, else 0 (like feof())
|
||||
ubyte osipf_CFeof(CFILE *file);
|
||||
uint8_t osipf_CFeof(CFILE *file);
|
||||
|
||||
void osipf_SoundStop(int s_handle, bool f_immediately = false);
|
||||
int osipf_SoundPlay2d(int obj_handle, int s_id, float volume = 1.0f);
|
||||
|
@ -649,7 +649,7 @@
|
||||
// Game global for current pilot
|
||||
pilot Current_pilot;
|
||||
char Default_pilot[_MAX_PATH] = {" "};
|
||||
ubyte ingame_difficulty = 1;
|
||||
uint8_t ingame_difficulty = 1;
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Internals (Globals for the file)
|
||||
@ -866,7 +866,7 @@ void PilotListSelectChangeCallback(int index) {
|
||||
|
||||
pilot *Pilot = &working_pilot;
|
||||
char name[PILOT_STRING_SIZE];
|
||||
ubyte difficulty;
|
||||
uint8_t difficulty;
|
||||
bool profanity, audiotaunts;
|
||||
bool in_edit = false;
|
||||
|
||||
@ -1307,7 +1307,7 @@ bool PilotCreate(pilot *Pilot, bool forceselection) {
|
||||
for (int id = 0; id < NUM_CONTROLLER_FUNCTIONS; id++) {
|
||||
ct_type type[2];
|
||||
ct_config_data value;
|
||||
ubyte flags[2];
|
||||
uint8_t flags[2];
|
||||
Controller->get_controller_function(Controller_needs[id].id, type, &value, flags);
|
||||
Pilot->controls[id].id = Controller_needs[id].id;
|
||||
Pilot->controls[id].type[0] = type[0];
|
||||
@ -1472,7 +1472,7 @@ bool PilotCopy(pilot *Src,pilot *Dest)
|
||||
{
|
||||
char sname[PILOT_STRING_SIZE];
|
||||
char sship[PAGENAME_LEN];
|
||||
ubyte sdiff;
|
||||
uint8_t sdiff;
|
||||
|
||||
Src->get_name(sname);
|
||||
Src->get_ship(sship);
|
||||
@ -3912,8 +3912,8 @@ clean_up:
|
||||
|
||||
// "Current Pilot" access functions
|
||||
void dCurrentPilotName(char *buffer) { Current_pilot.get_name(buffer); }
|
||||
ubyte dCurrentPilotDifficulty(void) {
|
||||
ubyte d;
|
||||
uint8_t dCurrentPilotDifficulty(void) {
|
||||
uint8_t d;
|
||||
Current_pilot.get_difficulty(&d);
|
||||
return d;
|
||||
}
|
||||
@ -3923,7 +3923,7 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) {
|
||||
char filename[_MAX_PATH];
|
||||
char pfilename[_MAX_FNAME];
|
||||
char buffer[256];
|
||||
ubyte temp_b;
|
||||
uint8_t temp_b;
|
||||
ushort temp_s;
|
||||
int temp_i;
|
||||
int filever, i, nctlfuncs;
|
||||
@ -4025,7 +4025,7 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) {
|
||||
}
|
||||
length = cf_ReadByte(file);
|
||||
if (length) {
|
||||
cf_ReadBytes((ubyte *)dummy, length, file);
|
||||
cf_ReadBytes((uint8_t *)dummy, length, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4061,8 +4061,8 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) {
|
||||
|
||||
// new flags for each controller item.
|
||||
if (filever >= 0xb) {
|
||||
Pilot->controls[y].flags[0] = (ubyte)cf_ReadByte(file);
|
||||
Pilot->controls[y].flags[1] = (ubyte)cf_ReadByte(file);
|
||||
Pilot->controls[y].flags[0] = (uint8_t)cf_ReadByte(file);
|
||||
Pilot->controls[y].flags[1] = (uint8_t)cf_ReadByte(file);
|
||||
}
|
||||
|
||||
if (keyconfig)
|
||||
|
@ -210,12 +210,12 @@ typedef struct
|
||||
int id;
|
||||
ct_type type[2];
|
||||
ct_config_data value;
|
||||
ubyte flags[2];
|
||||
uint8_t flags[2];
|
||||
} cntrldata;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ubyte highest_level;
|
||||
uint8_t highest_level;
|
||||
bool finished; // was mission finished?
|
||||
(different than highest level,btw) char mission_name[MSN_NAMELEN]; } tMissionData;
|
||||
|
||||
@ -243,7 +243,7 @@ typedef struct
|
||||
ushort hud_stat;
|
||||
ushort hud_graphical_stat;
|
||||
// hud display mode
|
||||
ubyte hud_mode;
|
||||
uint8_t hud_mode;
|
||||
// do we read the controller port also (beyond keyboard/mouse)
|
||||
char read_controller;
|
||||
// axis sensitivities
|
||||
@ -334,7 +334,7 @@ extern char Default_pilot[_MAX_PATH];
|
||||
|
||||
// "Current Pilot" access functions
|
||||
void dCurrentPilotName(char *buffer);
|
||||
ubyte dCurrentPilotDifficulty(void);
|
||||
uint8_t dCurrentPilotDifficulty(void);
|
||||
|
||||
void IncrementPilotRestoredGamesForMission(pilot *Pilot, const char *mission_name);
|
||||
void IncrementPilotSavedGamesForMission(pilot *Pilot, const char *mission_name);
|
||||
|
@ -203,7 +203,7 @@ void pilot::initialize(void) {
|
||||
guidebot_name = mem_strdup("GB");
|
||||
picture_id = PPIC_INVALID_ID;
|
||||
difficulty = DIFFICULTY_ROOKIE;
|
||||
hud_mode = (ubyte)HUD_COCKPIT;
|
||||
hud_mode = (uint8_t)HUD_COCKPIT;
|
||||
hud_stat = 0;
|
||||
hud_graphical_stat = STAT_STANDARD;
|
||||
game_window_w = Video_res_list[Game_video_resolution].width;
|
||||
@ -793,11 +793,11 @@ void pilot::get_multiplayer_data(char *logo, char *audio1, char *audio2, ushort
|
||||
}
|
||||
}
|
||||
|
||||
void pilot::set_difficulty(ubyte diff) {
|
||||
void pilot::set_difficulty(uint8_t diff) {
|
||||
difficulty = diff;
|
||||
write_pending = true;
|
||||
}
|
||||
void pilot::get_difficulty(ubyte *diff) {
|
||||
void pilot::get_difficulty(uint8_t *diff) {
|
||||
if (diff) {
|
||||
*diff = difficulty;
|
||||
}
|
||||
@ -848,7 +848,7 @@ void pilot::get_guidebot_name(char *name) {
|
||||
}
|
||||
}
|
||||
|
||||
void pilot::set_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) {
|
||||
void pilot::set_hud_data(uint8_t *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) {
|
||||
if (hmode) {
|
||||
// should do checking here
|
||||
switch (*hmode) {
|
||||
@ -882,7 +882,7 @@ void pilot::set_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, in
|
||||
write_pending = true;
|
||||
}
|
||||
}
|
||||
void pilot::get_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) {
|
||||
void pilot::get_hud_data(uint8_t *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) {
|
||||
if (hmode) {
|
||||
*hmode = hud_mode;
|
||||
}
|
||||
@ -1142,7 +1142,7 @@ void pilot::read_custom_multiplayer_data(CFILE *file, bool skip) {
|
||||
void pilot::write_difficulty(CFILE *file) { cf_WriteByte(file, difficulty); }
|
||||
|
||||
void pilot::read_difficulty(CFILE *file, bool skip) {
|
||||
ubyte temp;
|
||||
uint8_t temp;
|
||||
|
||||
temp = cf_ReadByte(file);
|
||||
if (!skip) {
|
||||
@ -1213,7 +1213,7 @@ void pilot::write_hud_data(CFILE *file) {
|
||||
}
|
||||
|
||||
void pilot::read_hud_data(CFILE *file, bool skip) {
|
||||
ubyte temp_b;
|
||||
uint8_t temp_b;
|
||||
ushort temp_s;
|
||||
int temp_i;
|
||||
|
||||
@ -1276,7 +1276,7 @@ void pilot::write_mission_data(CFILE *file) {
|
||||
|
||||
void pilot::read_mission_data(CFILE *file, bool skip) {
|
||||
int temp_i, i, temp_perm;
|
||||
ubyte temp_b1, temp_b2;
|
||||
uint8_t temp_b1, temp_b2;
|
||||
int temp_restores = 0, temp_saves = 0;
|
||||
char temp_s[MSN_NAMELEN];
|
||||
|
||||
@ -1398,7 +1398,7 @@ void pilot::write_controls(CFILE *file) {
|
||||
|
||||
void pilot::read_controls(CFILE *file, bool skip) {
|
||||
float temp_f;
|
||||
ubyte temp_b;
|
||||
uint8_t temp_b;
|
||||
int i;
|
||||
|
||||
// Controller data
|
||||
@ -1433,8 +1433,8 @@ void pilot::read_controls(CFILE *file, bool skip) {
|
||||
controls[y].type[0] = type[0];
|
||||
controls[y].type[1] = type[1];
|
||||
controls[y].value = value;
|
||||
controls[y].flags[0] = (ubyte)cf_ReadByte(file);
|
||||
controls[y].flags[1] = (ubyte)cf_ReadByte(file);
|
||||
controls[y].flags[0] = (uint8_t)cf_ReadByte(file);
|
||||
controls[y].flags[1] = (uint8_t)cf_ReadByte(file);
|
||||
|
||||
if (!skip)
|
||||
Controller->set_controller_function(controls[y].id, controls[y].type, controls[y].value, controls[y].flags);
|
||||
@ -1519,13 +1519,13 @@ void pilot::read_weapon_select(CFILE *file) {
|
||||
}
|
||||
|
||||
void pilot::read_gameplay_toggles(CFILE *file, bool skip) {
|
||||
ubyte count, i;
|
||||
uint8_t count, i;
|
||||
bool toggles[16];
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
toggles[i] = false;
|
||||
|
||||
count = (ubyte)cf_ReadByte(file);
|
||||
count = (uint8_t)cf_ReadByte(file);
|
||||
if (count > 16) {
|
||||
Int3();
|
||||
count = 16;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user