build: resolve 101 instances of -Wunused-variable

This commit is contained in:
Jan Engelhardt 2024-11-03 21:39:51 +01:00
parent 8d4addecfa
commit 48953868df
33 changed files with 31 additions and 114 deletions

View File

@ -140,8 +140,6 @@ bool grMemorySurface::init(int w, int h, int bpp, char *data, int rowsize, unsig
// internal functions
// ---------------------------------------------------------------------------
static mem_bitmap grMemSurf_object;
bool gr_bm_mem_Blt16(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx, int sy, int sw, int sh);
bool gr_bm_mem_Blt16ck(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx, int sy, int sw, int sh);

View File

@ -96,7 +96,6 @@
#define STR_BUF_SIZE 512
static char Str_buf[STR_BUF_SIZE]; // String buffer for variable arguments
static char Draw_str_buf[STR_BUF_SIZE]; // used to buffer words in a string
// ---------------------------------------------------------------------------
// Viewport font and text funcitons

View File

@ -575,8 +575,6 @@ int bm_AllocNoMemBitmap(int w, int h) {
// Searches thru all bitmaps for a specific name, returns -1 if not found
// or index of bitmap with name
int bm_FindBitmapName(const char *name) {
int num_counted = 0;
bms_bitmap fbmp;
strcpy(fbmp.name, name);
bm_Node *fnode = bm_findNode(&fbmp);
@ -641,8 +639,6 @@ int bm_TestName(const char *src) {
strncpy(namedest, filename, limit);
namedest[limit] = 0;
int cur_len = strlen(namedest);
// Now, make sure there are no other bitmaps with this name
strcat(namedest, ".ogf");
if ((i = bm_FindBitmapName(namedest)) == -1)
@ -652,7 +648,6 @@ int bm_TestName(const char *src) {
// gets the filename from a path, plus appends our .ogf extension
void bm_ChangeEndName(const char *src, char *dest) {
uint32_t i, limit;
int last = -1;
int curnum = -1;
char namedest[256 + 16];
char path[256], ext[256], filename[256];

View File

@ -382,7 +382,7 @@ int bm_iff_parse_file(CFILE *ifile, iff_bitmap_header *bmheader, iff_bitmap_head
switch (sig) {
case IFF_SIG_FORM: {
int newsig = bm_iff_get_sig(ifile);
bm_iff_get_sig(ifile);
bmheader->type = TYPE_PBM;
break;
}

View File

@ -760,7 +760,6 @@ int grtext_GetTextLineWidth(const char *str) {
int line_width = 0, max_width = 0;
int rgb_define_mode = 0;
int strsize = strlen(str);
int line_idx = 0;
for (int i = 0; i < strsize; i++) {
int width;

View File

@ -174,7 +174,7 @@ static int create_audiobuf_handler(unsigned char major, unsigned char minor, uns
int flags = get_ushort(data + 2);
int sample_rate = get_ushort(data + 4);
int desired_buffer = get_int(data + 6);
// int desired_buffer = get_int(data + 6);
int channels = (flags & MVE_AUDIO_FLAGS_STEREO) ? 2 : 1;
int sample_size = (flags & MVE_AUDIO_FLAGS_16BIT) ? 2 : 1;
@ -338,12 +338,12 @@ static int video_codemap_handler(unsigned char major, unsigned char minor, unsig
static int video_data_handler(unsigned char major, unsigned char minor, unsigned char *data, int len, void *context) {
unsigned char *temp;
short nFrameHot = get_short(data);
short nFrameCold = get_short(data + 2);
short nXoffset = get_short(data + 4);
short nYoffset = get_short(data + 6);
short nXsize = get_short(data + 8);
short nYsize = get_short(data + 10);
// short nFrameHot = get_short(data);
// short nFrameCold = get_short(data + 2);
// short nXoffset = get_short(data + 4);
// short nYoffset = get_short(data + 6);
// short nXsize = get_short(data + 8);
// short nYsize = get_short(data + 10);
unsigned short nFlags = get_ushort(data + 12);
if (nFlags & 1) {

View File

@ -76,7 +76,7 @@ int mng_ReadNewGamefilePage(CFILE *infile, mngs_gamefile_page *gamefilepage) {
ASSERT(infile != NULL);
memset(gamefilepage, 0, sizeof(mngs_gamefile_page));
int version = cf_ReadShort(infile);
/* int version = */ cf_ReadShort(infile);
cf_ReadString(gamefilepage->gamefile_struct.name, PAGENAME_LEN, infile);
cf_ReadString(gamefilepage->gamefile_struct.dir_name, PAGENAME_LEN, infile);

View File

@ -1480,7 +1480,7 @@ void mng_TransferPages() {
continue;
}
pagetype = cf_ReadByte(infile);
int len = cf_ReadInt(infile);
/* int len = */ cf_ReadInt(infile);
switch (pagetype) {
case PAGETYPE_TEXTURE:
mng_ReadNewTexturePage(infile, &texpage);
@ -2208,7 +2208,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype
// If local is 1, deletes from the local table file
int mng_DeletePage(char *name, int dest_pagetype, int local) {
CFILE *infile, *outfile;
uint8_t pagetype, replaced = 0;
uint8_t pagetype;
int done = 0;
int deleted = 0;

View File

@ -176,7 +176,7 @@ int mng_ReadNewMegacellPage(CFILE *infile, mngs_megacell_page *megacellpage) {
int i;
ASSERT(infile != NULL);
memset(megacellpage, 0, sizeof(mngs_megacell_page));
int version = cf_ReadShort(infile);
/* int version = */ cf_ReadShort(infile);
cf_ReadString(megacellpage->megacell_struct.name, PAGENAME_LEN, infile);

View File

@ -225,7 +225,6 @@ void mng_InitPagelocks() {
// Returns pointer to locker's name, or NULL if the file is unlocked
char *mng_CheckIfLockerPresent() {
CFILE *infile;
int i = 0;
static char lockname[200];
ASSERT(Network_up);
@ -380,7 +379,6 @@ int mng_CheckIfPageLocked(mngs_Pagelock *pl) {
r = 2;
} else {
if (!stricmp(pl->name, testlock.name)) {
int test = 0;
if (pl->pagetype == testlock.pagetype) {
if (!stricmp(testlock.holder, "UNLOCKED"))
r = 0;
@ -602,7 +600,7 @@ int mng_DeletePagelock(char *name, int pagetype) {
// Given a list of names and a pagetype, deletes the ones already inside the lock file
int mng_DeletePagelockSeries(char *names[], int num, int pagetype) {
CFILE *infile, *outfile;
int done = 0, deleted = 0;
int done = 0;
mngs_Pagelock temp_pl;
infile = (CFILE *)cfopen(TableLockFilename, "rb");
@ -656,7 +654,7 @@ int mng_DeletePagelockSeries(char *names[], int num, int pagetype) {
// Goes through the pagelock table and deletes all duplicate entries
int mng_DeleteDuplicatePagelocks() {
CFILE *infile; //,*outfile;
int done = 0, deleted = 0;
int done = 0;
mngs_Pagelock temp_pl;
mngs_Pagelock *already_read;
int num = 0, duplicates = 0, i;
@ -727,7 +725,7 @@ int mng_UnlockPagelockSeries(const char *names[], int *pagetypes, int num) {
memset(already_done, 0, 500);
CFILE *infile, *outfile;
int done = 0, deleted = 0;
int done = 0;
mngs_Pagelock temp_pl;
int total = 0;

View File

@ -221,7 +221,7 @@ void mng_WriteNewSoundPage(CFILE *outfile, mngs_sound_page *soundpage) {
// Reads a sound page from an open file. Returns 0 on error.
int mng_ReadNewSoundPage(CFILE *infile, mngs_sound_page *soundpage) {
ASSERT(infile != NULL);
int version = cf_ReadShort(infile);
/* int version = */ cf_ReadShort(infile);
// read in name,rawfile name
cf_ReadString(soundpage->sound_struct.name, PAGENAME_LEN, infile);
cf_ReadString(soundpage->raw_name, PAGENAME_LEN, infile);

View File

@ -762,9 +762,8 @@ int mng_ReadNewTexturePage(CFILE *infile, mngs_texture_page *texpage) {
// If local is 1, deletes from the local table file
int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) {
CFILE *infile, *outfile;
uint8_t pagetype, replaced = 0;
uint8_t pagetype;
int done = 0;
int deleted = 0;
memset(&texpage1, 0, sizeof(mngs_texture_page));
if (local)
@ -796,7 +795,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) {
continue;
}
pagetype = cf_ReadByte(infile);
int len = cf_ReadInt(infile);
/* int len = */ cf_ReadInt(infile);
// If not a texture page, just read it in and write it right back out
if (pagetype != PAGETYPE_TEXTURE) {

View File

@ -510,7 +510,6 @@ inline void RenderSubmodelLightmapFace(poly_model *pm, bsp_info *sm, int facenum
inline void RenderSubmodelFaceFogged(poly_model *pm, bsp_info *sm, int facenum) {
g3Point *pointlist[100];
polyface *fp = &sm->faces[facenum];
int modelnum = sm - pm->submodel;
int t;
for (t = 0; t < fp->nverts; t++) {
@ -561,7 +560,6 @@ inline void RenderSubmodelFaceFogged(poly_model *pm, bsp_info *sm, int facenum)
inline void RenderSubmodelFaceSpecular(poly_model *pm, bsp_info *sm, int facenum) {
g3Point *pointlist[100];
polyface *fp = &sm->faces[facenum];
int modelnum = sm - pm->submodel;
int t;
bool smooth = 0;
@ -623,7 +621,6 @@ inline void RenderSubmodelFaceSpecular(poly_model *pm, bsp_info *sm, int facenum
// Draws a glowing cone of light that represents thrusters
void DrawThrusterEffect(vector *pos, float r, float g, float b, vector *norm, float size, float length) {
vector cur_pos = *pos;
float cur_length = 0;
vector glow_pos[MAX_PARTS];
float glow_size[MAX_PARTS];
int total_parts = 0;
@ -702,7 +699,6 @@ void RenderSubmodelFacesSorted(poly_model *pm, bsp_info *sm) {
int rcount;
int model_render_order[MAX_POLYGON_VECS];
int modelnum = sm - pm->submodel;
ASSERT(sm->nverts < MAX_POLYGON_VECS);

View File

@ -2441,8 +2441,6 @@ void SetModelAngles(poly_model *po, const float *normalized_angles) {
// Now do a parametric adjustment on the angles
int cur_angle = 0;
// If we're already at the high point of the interpolation then just
// stuff some values
if (cur_state == po->num_key_angles - 1) {
@ -2555,7 +2553,6 @@ void SetModelInterpPos(poly_model *po, const float *normalized_pos) {
// Now do a parametric adjustment on the positions
vector total_delta_pos = {0, 0, 0};
vector subpos;
vector final_pos;
@ -3122,7 +3119,6 @@ int CountFacesInPolymodel(poly_model *pm) {
// of that point
void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix *orient, int subnum, vector *pos,
vector *norm) {
bsp_info *sm = &pm->submodel[subnum];
float normalized_time[MAX_SUBOBJECTS];
int i;
@ -3174,8 +3170,6 @@ void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix
void GetPolyModelPointInWorld(vector *dest, poly_model *pm, vector *wpos, matrix *orient, int subnum,
float *normalized_time, vector *pos, vector *norm) {
bsp_info *sm = &pm->submodel[subnum];
ASSERT(!(pm->flags & PMF_NOT_RESIDENT));
if (!pm->new_style)

View File

@ -233,7 +233,6 @@ bool mod_FreeModule(module *handle) {
// mod_GetLastError to see if there was an error symstr is the name of the function you want to get the symbol for (Do
// NOT give any pre/suffix to this name) parmbytes is the size (in bytes) of the parameter list the function should have
MODPROCADDRESS mod_GetSymbol(module *handle, const char *symstr, uint8_t parmbytes) {
char buffer[256];
MODPROCADDRESS sym;
if (!handle) {
ModLastError = MODERR_INVALIDHANDLE;
@ -248,6 +247,7 @@ MODPROCADDRESS mod_GetSymbol(module *handle, const char *symstr, uint8_t parmbyt
return nullptr;
}
#if defined(WIN32)
char buffer[256];
// We need to first form the correct symbol name (for Windows)
if (parmbytes == 255)
sprintf(buffer, "%s", symstr);

View File

@ -440,7 +440,7 @@ int MainMultiplayerMenu() {
// void HotSpotCreate(int item,int parentitem, int id, int key, int txtitemoff, int txtitemon, int x, int y, int w,
// int h, int flags,int winnum)
void *exit_hs = DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0);
/* void *exit_hs = */ DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0);
void *priv_hs = DLLHotSpotCreate(main_wnd, 6, 0, priv_msg_off_text, priv_msg_on_text, 328, 403, 170, 15, 0);
@ -1188,7 +1188,7 @@ int SearchMasterTrackerGameMenu() {
// Menu loop
while (!exit_menu) {
if (ChatStarted)
const char *p = GetChatText();
GetChatText();
DLLDescentDefer();

View File

@ -134,7 +134,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) {
}
m_ListenSock = socket(AF_INET, SOCK_STREAM, 0);
if (INVALID_SOCKET == m_ListenSock) {
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return;
} else {
@ -145,7 +144,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) {
// Bind the listen socket
if (bind(m_ListenSock, (SOCKADDR *)&listensockaddr, sizeof(SOCKADDR))) {
// Couldn't bind the socket
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return;
}
@ -153,7 +151,6 @@ CFtpGet::CFtpGet(char *URL, char *localfile, char *Username, char *Password) {
// Listen for the server connection
if (listen(m_ListenSock, 1)) {
// Couldn't listen on the socket
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return;
}
@ -339,7 +336,6 @@ uint32_t CFtpGet::GetFile() {
close(m_ListenSock);
#endif
if (m_DataSock == INVALID_SOCKET) {
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return 0;
}
@ -363,7 +359,6 @@ uint32_t CFtpGet::IssuePort() {
// Get the address for the hListenSocket
iLength = sizeof(listenaddr);
if (getsockname(m_ListenSock, (SOCKADDR *)&listenaddr, &iLength) == SOCKET_ERROR) {
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return 0;
}
@ -374,7 +369,6 @@ uint32_t CFtpGet::IssuePort() {
// Now, reuse the socket address structure to
// get the IP address from the control socket.
if (getsockname(m_ControlSock, (SOCKADDR *)&listenaddr, &iLength) == SOCKET_ERROR) {
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return 0;
}
@ -411,7 +405,6 @@ uint32_t CFtpGet::IssuePort() {
if (nReplyCode != 250 || (ReadFTPServerReply() != 200)) // ummmmmmmm
#endif
{
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_SOCKET_ERROR;
return 0;
}
@ -445,7 +438,6 @@ int CFtpGet::ConnectControlSocket() {
return 0;
// Now we will connect to the host
if (connect(m_ControlSock, (SOCKADDR *)&hostaddr, sizeof(SOCKADDR))) {
int iWinsockErr = WSAGetLastError();
m_State = FTP_STATE_CANT_CONNECT;
return 0;
}
@ -479,7 +471,6 @@ uint32_t CFtpGet::SendFTPCommand(char *command) {
FlushControlChannel();
// Send the FTP command
if (SOCKET_ERROR == (send(m_ControlSock, command, strlen(command), 0))) {
int iWinsockErr = WSAGetLastError();
// Return 999 to indicate an error has occurred
return (999);
}
@ -579,7 +570,6 @@ uint32_t CFtpGet::ReadDataChannel() {
void CFtpGet::FlushControlChannel() {
fd_set read_fds;
TIMEVAL timeout;
int bytesin = 0;
char flushbuff[3];
timeout.tv_sec = 0;

View File

@ -182,7 +182,6 @@ void InitMTSockets() {
}
{
static HOSTENT lhe;
memset(&sockaddr, 0, sizeof(SOCKADDR_IN));
gtrackaddr.sin_family = AF_INET;
gtrackaddr.sin_addr.s_addr = INADDR_ANY;

View File

@ -1094,7 +1094,7 @@ int MainMultiplayerMenu() {
// void HotSpotCreate(int item,int parentitem, int id, int key, int txtitemoff, int txtitemon, int x, int y, int w,
// int h, int flags,int winnum)
void *exit_hs = DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0);
/* void *exit_hs = */ DLLHotSpotCreate(main_wnd, 5, KEY_ESC, exit_off_text, exit_on_text, 33, 427, 70, 15, 0);
void *priv_hs = DLLHotSpotCreate(main_wnd, 6, 0, priv_msg_off_text, priv_msg_on_text, 328, 403, 170, 15, 0);
@ -1371,7 +1371,6 @@ int MainMultiplayerMenu() {
memset(fmtchan, 0, 500);
int textx = 0;
int charpos = 0;
int endpos;
#define LIST_ROW1 90
@ -1737,7 +1736,6 @@ int SearchMasterTrackerGameMenu() {
int i = 0;
float last_req_time;
char selgame[200];
void *selti = nullptr;
void *return_text_on = DLLCreateNewUITextItem(TXT_PXO_RETURNTOCHAT, UICOL_HOTSPOT_HI);
void *return_text_off = DLLCreateNewUITextItem(TXT_PXO_RETURNTOCHAT, UICOL_HOTSPOT_LO);
void *game_head_text = DLLCreateNewUITextItem(TXT_PXO_GAMELISTHDR, UICOL_TEXT_NORMAL);
@ -1844,7 +1842,6 @@ int SearchMasterTrackerGameMenu() {
DLLNewUIWindowLoadBackgroundImage(main_wnd, "pxogame.ogf");
DLLNewUIWindowOpen(main_wnd);
*DLLNum_network_games_known = 0;
int lastgamesfound = 0;
int itemp;
last_req_time = DLLtimer_GetTime();
RequestGameList();
@ -1854,7 +1851,7 @@ int SearchMasterTrackerGameMenu() {
// Menu loop
while (!exit_menu) {
if (ChatStarted)
const char *p = GetChatText();
GetChatText();
DLLDescentDefer();
IdleGameTracker();

View File

@ -822,7 +822,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) {
int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3;
uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255));
int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2);
int x = 520;
ddgr_color color = 0;
int rank = 1;

View File

@ -859,7 +859,6 @@ void OnClientCollide(uint8_t *data) {
int pnum = me_obj->id; // player number
int pteam = DMFCBase->GetPlayerTeam(pnum); // player's team
int i;
bool play_return_home_msg = false;
for (i = 0; i < CTFNumOfTeams; i++) {
if (it_obj->id == FlagIDs[i])
@ -876,7 +875,6 @@ void OnClientCollide(uint8_t *data) {
// Did player collide with his own team's flag?
if (fteam == pteam) {
int16_t flag_count = 0;
vector fpos;
int groom;
int flagcount;
@ -963,7 +961,6 @@ void OnClientCollide(uint8_t *data) {
TeamScores[pteam] += score;
OverallTeamScores[pteam] += score;
int newscore = TeamScores[pteam];
switch (flagcount) {
case 1: {
@ -1121,7 +1118,6 @@ void OnClientLevelEnd(void) { DMFCBase->OnClientLevelEnd(); }
void OnPlayerChangeTeam(int player_num, int newteam, bool announce, bool spew_onrespawn) {
DMFCBase->OnPlayerChangeTeam(player_num, newteam, announce, spew_onrespawn);
player_record *pr = DMFCBase->GetPlayerRecordByPnum(player_num);
}
// OnClientPlayerKilled
@ -2183,8 +2179,6 @@ bool AddFlagToPlayer(int pnum, int team, int flagobjnum) {
// RemoveFlagFromPlayer
// removes a flag from a player
bool RemoveFlagFromPlayer(int pnum, int team) {
int flagobjnum = -1;
if (DMFCBase->GetLocalRole() == LR_SERVER) {
if (ChildFlags[team] == OBJECT_HANDLE_NONE)

View File

@ -921,7 +921,6 @@ void DMFCInputCommand_Piggyback(const char *input_string) {
}
char s[20];
bool turn_on = true;
object *pobj;
int pnum = basethis->GetPlayerNum();
pobj = &basethis->Objects[basethis->Players[pnum].objnum];

View File

@ -1738,7 +1738,6 @@ void DisplayWelcomeMessage(int player_num) {
}
void OnLabSpewTimer(void) {
int max_rooms = DMFCBase->GetHighestRoomIndex() + 1;
int objnum;
int index;
int virus_count;

View File

@ -74,7 +74,6 @@
IDMFC *DMFCBase = NULL;
static IDmfcStats *dstat = NULL;
static IMenuItem *OSMenuSave = NULL;
static object *dObjects = NULL;
static player *dPlayers = NULL;
@ -1268,7 +1267,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) {
if (DisplayScoreScreen)
return;
int x = 520;
int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3;
uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255));
int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2);

View File

@ -1149,7 +1149,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) {
int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3;
uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255));
int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2);
int x = 510;
int rank = 1;
ddgr_color color = 0;
bool hasorb;

View File

@ -262,7 +262,6 @@ static int Highlight_bmp;
static int LastHitPnum = -1;
static bool players_sorted = false; // the Sorted*[] have been sorted
static bool DisplayPowerBBlink = true;
static bool DisplayScoreBlink = true;
static bool DisplayScoreScreen = false;
static bool display_my_welcome = false;
@ -1696,8 +1695,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) {
int score_width = DLLgrtext_GetTextLineWidth("888");
int name_x = DMFCBase->GetGameWindowW() - name_width - score_width - 10;
int score_x = DMFCBase->GetGameWindowW() - score_width - 5;
int icon_size = height - 3;
int icon_x = name_x - icon_size - 3;
DLLgrtext_SetAlpha(alpha);
char name[256];
@ -1921,9 +1918,6 @@ void HandleMonsterballCollideWithWeapon(object *ball, weapon_collide_info *winfo
void bump_object(object *object0, vector *rotvel, vector *velocity, vector *pos, matrix *orient, float mass, float size,
vector *collision_point, vector *collision_normal, float rot_scalar, float vel_scalar) {
object *t = NULL;
object *other = NULL;
ASSERT(std::isfinite(rotvel->x));
ASSERT(std::isfinite(rotvel->y));
ASSERT(std::isfinite(rotvel->z));

View File

@ -817,7 +817,6 @@ void DisplayHUDScores(struct tHUDItem *hitem) {
int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3;
uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255));
int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2);
int x = 520;
ddgr_color color;
int rank = 1;

View File

@ -408,9 +408,6 @@ static int16_t Packet_free_list[MAX_PACKET_BUFFERS]; // contains i
static int Num_packet_buffers;
static int Largest_packet_index = 0;
static int Uncompressed_outgoing_data_len = 0;
static int Compressed_outgoing_data_len = 0;
int Next_packet_id;
int Last_packet_id;
@ -466,8 +463,6 @@ struct reliable_net_rcvbuffer {
uint8_t buffer[NETBUFFERSIZE];
};
static SOCKET Reliable_UDP_socket = INVALID_SOCKET;
static float first_sent_iamhere = 0;
static float last_sent_iamhere = 0;
@ -577,14 +572,7 @@ void nw_InitNetworking(int iReadBufSizeOverride) {
WORD ver = MAKEWORD(1, 1);
#endif
static char exewithpath[_MAX_PATH * 2];
static char exefile[_MAX_PATH * 2];
static char ourargs[_MAX_PATH * 2];
static char exedir[_MAX_PATH * 2];
static char exeext[_MAX_PATH];
static char *fixdir;
static char szconntype[100];
int parmlen;
int len = 99;
Database->read("NetworkConnection", szconntype, &len);
if (stricmp(szconntype, "DIALUP") == 0) {
@ -612,10 +600,17 @@ void nw_InitNetworking(int iReadBufSizeOverride) {
}
#ifdef WIN32
if (!dp_DidLobbyLaunchGame()) {
static char exewithpath[_MAX_PATH * 2];
static char exefile[_MAX_PATH * 2];
static char ourargs[_MAX_PATH * 2];
static char exedir[_MAX_PATH * 2];
static char exeext[_MAX_PATH];
static char *fixdir;
// Tell direct play about this game
char *p = GetCommandLine();
LOG_DEBUG.printf("Command line: %s", p);
parmlen = strlen(p);
int parmlen = strlen(p);
int a;
for (a = 0; a < parmlen; ++a) {
@ -851,7 +846,6 @@ void nw_GetNumbersFromHostAddress(network_address *address, char *str) {
// returns the ip address of this computer
uint32_t nw_GetThisIP() {
SOCKADDR_IN local_address;
int address_size = sizeof(SOCKADDR);
if (Net_fixed_ip != INADDR_NONE) {
return Net_fixed_ip;
@ -1078,7 +1072,6 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) {
int use_buffer = -1;
reliable_socket *rsocket;
reliable_header send_header;
int send_this_packet = 1;
if (length == 0) {
LOG_ERROR << "Attempting to send 0 byte network packet in nw_SendReliable()";
@ -1252,12 +1245,9 @@ void nw_DoNetworkIdle(void) {
void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) {
int i;
int rcode = -1;
int16_t max_len = NETBUFFERSIZE;
static reliable_header rcv_buff;
static SOCKADDR rcv_addr;
int bytesin = 0;
int addrlen = sizeof(SOCKADDR);
uint32_t rcvid; // The id of who we actually received a packet from, as opposed to socketid parm
if (NP_TCP == naddr->connection_type) {
@ -2505,11 +2495,6 @@ int nw_DoReceiveCallbacks(void) {
void nw_ReliableResend(void) {
int i, j;
int rcode = -1;
int16_t max_len = NETBUFFERSIZE;
static reliable_header rcv_buff;
static SOCKADDR rcv_addr;
int bytesin = 0;
int addrlen = sizeof(SOCKADDR);
reliable_socket *rsocket = NULL;
// Go through each reliable socket that is connected and do any needed work.
for (j = 0; j < MAXRELIABLESOCKETS; j++) {

View File

@ -1573,7 +1573,6 @@ void ConvertAxisAmountToEuler(vector *n, float *w, vector *e) {
float t;
float scale = *w / .0001f;
float w_n = .0001f;
vector s_result;
if (*w == 0.0f) {
@ -2159,7 +2158,6 @@ void collide_generic_and_weapon(object *robotobj, object *weapon, vector *collis
float damage_to_apply;
uint8_t electrical = (Weapons[weapon->id].flags & WF_ELECTRICAL) ? 1 : 0;
bool f_stick = ((weapon->mtype.phys_info.flags & PF_STICK) != 0);
bool f_energy = ((Weapons[weapon->id].flags & WF_MATTER_WEAPON) == 0);
int damage_type;
// Check for lava & volatile surfaces on an object

View File

@ -2123,7 +2123,6 @@ int fvi_QuickDistObjectList(vector *pos, int init_room_index, float rad, int16_t
fvi_wall_max_xyz = fvi_max_xyz;
if (ROOMNUM_OUTSIDE(init_room_index)) {
int num_cells = 0;
int next_y_delta;
int xstart, xend, ystart, yend;
int check_x, check_y;
@ -3326,7 +3325,6 @@ void check_hit_obj(int objnum) {
vector hit_point;
float cur_dist;
const object *obj = &Objects[objnum];
bool f_x = false;
int collision_type;
int m_obj_index = fvi_query_ptr->thisobjnum;
object *m_obj = &Objects[m_obj_index];
@ -4461,7 +4459,6 @@ int fvi_room(int room_index, int from_portal, int room_obj) {
int portal_num;
// vector col_point[32];
// vector col_normal[32];
int num_cols = 0;
object *this_obj;
uint8_t msector = 0;

View File

@ -1948,7 +1948,6 @@ void do_walking_sim(object *obj) {
vector total_force = Zero_vector; // Constant force acting on an object
bool f_continue_sim; // Should we run another simulation loop
bool f_start_fvi_record = true; // Records the rooms that are passed thru
poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num];
@ -1974,8 +1973,6 @@ void do_walking_sim(object *obj) {
obj->flags &= (~OF_STOPPED_THIS_FRAME);
// Do rotation velocity/accel stuff
bool f_rotated = false;
if (!(fabs(pi->velocity.x) > .000001 || fabs(pi->velocity.y) > .000001 || fabs(pi->velocity.z) > .000001 ||
fabs(pi->thrust.x) > .000001 || fabs(pi->thrust.y) > .000001 || fabs(pi->thrust.z) > .000001 ||
fabs(pi->rotvel.x) > .000001 || fabs(pi->rotvel.y) > .000001 || fabs(pi->rotvel.z) > .000001 ||

View File

@ -696,8 +696,6 @@ void UIListBox::OnDraw() {
// behavior when key is pressed.
void UIListBox::OnKeyDown(int key) {
UIGadget *gadget = this;
if (key == KEY_UP) {
if (m_SelectedIndex > 0) {
if (m_SelectedIndex == m_Index)
@ -837,7 +835,6 @@ void UIListBox::OnUserProcess() {
// check if x and y selection hits a selected item.
bool UIListBox::MseCheckSelect(int x, int y) {
int i, ty;
bool use_scroll = !(m_Flags & UILB_NOSCROLL);
if (!m_NumItems)
return false;

View File

@ -539,8 +539,6 @@ bool ui_HideCursor() {
}
// set user interface screen resolution
void ui_SetScreenMode(int w, int h) {
int old_w = UI_screen_width;
int old_h = UI_screen_height;
UI_screen_width = w;
UI_screen_height = h;
UI_aspect_x = (float)w / (float)FIXED_SCREEN_WIDTH;