From 8d4addecfa8a1725bc6e65d727f329596284a25d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 3 Nov 2024 21:39:44 +0100 Subject: [PATCH] d3: resolve 175 instances of -Wunused-variable --- Descent3/AIGoal.cpp | 3 --- Descent3/AImain.cpp | 9 +-------- Descent3/BOA.cpp | 1 - Descent3/BriefingParse.cpp | 2 -- Descent3/Controls.cpp | 4 +--- Descent3/Game2DLL.cpp | 12 ++++++------ Descent3/Inventory.cpp | 6 +++--- Descent3/LoadLevel.cpp | 2 -- Descent3/Mission.cpp | 2 -- Descent3/ObjInit.cpp | 2 -- Descent3/OsirisLoadandBind.cpp | 2 +- Descent3/Player.cpp | 1 - Descent3/TelCom.cpp | 4 +--- Descent3/TelComCargo.cpp | 1 - Descent3/TelcomEffectsRender.cpp | 13 ++++--------- Descent3/TerrainSearch.cpp | 7 ------- Descent3/WeaponFire.cpp | 5 ----- Descent3/aipath.cpp | 5 ----- Descent3/aiterrain.cpp | 1 - Descent3/attach.cpp | 1 - Descent3/audiotaunts.cpp | 2 +- Descent3/bnode.cpp | 4 ++-- Descent3/cockpit.cpp | 1 - Descent3/config.cpp | 4 ++-- Descent3/credits.cpp | 3 --- Descent3/damage.cpp | 1 - Descent3/demofile.cpp | 3 --- Descent3/fireball.cpp | 3 --- Descent3/gauges.cpp | 1 - Descent3/hud.cpp | 1 - Descent3/huddisplay.cpp | 2 -- Descent3/hudmessage.cpp | 12 ------------ Descent3/init.cpp | 2 +- Descent3/lighting.cpp | 1 - Descent3/lightmap_info.cpp | 2 -- Descent3/loadstate.cpp | 4 +--- Descent3/menu.cpp | 2 +- Descent3/mmItem.cpp | 3 --- Descent3/multi.cpp | 23 +++++------------------ Descent3/multi_connect.cpp | 3 --- Descent3/multi_dll_mgr.cpp | 10 +++++----- Descent3/multi_ui.cpp | 3 --- Descent3/multisafe_server.cpp | 3 --- Descent3/newui.cpp | 1 - Descent3/newui_core.cpp | 4 ---- Descent3/object.cpp | 7 ------- Descent3/object_lighting.cpp | 3 --- Descent3/osiris_predefs.cpp | 1 - Descent3/procedurals.cpp | 6 ------ Descent3/render.cpp | 11 +---------- Descent3/renderobject.cpp | 3 --- Descent3/scorch.cpp | 3 --- Descent3/screens.cpp | 2 ++ Descent3/terrain.cpp | 1 - Descent3/terrainrender.cpp | 4 +--- Descent3/trigger.cpp | 1 - Descent3/viseffect.cpp | 13 ------------- Descent3/voice.cpp | 6 +++--- Descent3/weather.cpp | 1 - 59 files changed, 42 insertions(+), 201 deletions(-) diff --git a/Descent3/AIGoal.cpp b/Descent3/AIGoal.cpp index 22858d65a..d425e6262 100644 --- a/Descent3/AIGoal.cpp +++ b/Descent3/AIGoal.cpp @@ -868,7 +868,6 @@ void GoalClearAll(object *obj) { int GoalAllocSlot(object *obj, int level, float influence) { float lowest_influence_slot = -1.0; float lowest_influence = MAX_INFLUENCE + 1.0; - int alloc_slot = AI_INVALID_INDEX; ai_frame *ai_info = obj->ai_info; int cur_slot; @@ -1421,8 +1420,6 @@ bool GoalIsGoalEnabled(object *obj, int goal_index) { if (cur_goal->flags & GF_OBJ_IS_TARGET) { gobj = ObjGet(obj->ai_info->target_handle); } else if (cur_goal->flags & (GF_OBJS_ARE_SPECIES | GF_OBJS_ARE_ENEMIES | GF_OBJS_ARE_FRIENDS)) { - bool done = false; - if (cur_goal->flags & (GF_OBJS_ARE_SPECIES | GF_OBJS_ARE_FRIENDS)) { // chrishack -- not done } diff --git a/Descent3/AImain.cpp b/Descent3/AImain.cpp index ef3c18396..eaea662d2 100644 --- a/Descent3/AImain.cpp +++ b/Descent3/AImain.cpp @@ -1804,7 +1804,6 @@ bool move_relative_object_vec(object *obj, vector *vec, object *target, float ci vector from_target; vector opposite_fvec; vector goal_pos; - ai_frame *ai_info = obj->ai_info; bool f_done = false; from_target = obj->pos - target->pos; @@ -2862,8 +2861,7 @@ void AISeeTarget(object *obj, bool f_see) { // Note: Player position is also updated in the visibility test function // for MIN_VIS_RECENT_CHECK_INTERVAL seconds - object *targetptr; - object *other_obj = targetptr = ObjGet(ai_info->target_handle); + object *targetptr = ObjGet(ai_info->target_handle); if (targetptr) { if (f_see) @@ -4533,7 +4531,6 @@ void ai_move(object *obj) { bool f_dodge = false; // Are there any dodge goals bool f_avoid = false; // Are there any avoid goals int highest_influence_goal = -1; - float highest_influence = 0.0f; float highest_speed = 0.0f; bool f_turned = true; bool f_goal_found = false; @@ -4814,8 +4811,6 @@ void ai_move(object *obj) { bool f_orient = AITurnTowardsMatrix(obj, obj->ai_info->max_turn_rate, &orient); if (f_at_pos && f_orient) { - int goal_index = cur_goal - ai_info->goals; - if (cur_goal->type == AIG_PLACE_OBJ_ON_OBJ) { UnattachFromParent(child_obj); AttachObject(g_obj, c_ap, child_obj, p_ap, true); @@ -4850,8 +4845,6 @@ void ai_move(object *obj) { } if (f_at_pos) { - int goal_index = cur_goal - ai_info->goals; - AttachObject(obj, p_ap, g_obj, rad); if (cur_goal->g_info.attach_info.flags & GAF_TEMP_CLEAR_ROBOT_COLLISIONS) { diff --git a/Descent3/BOA.cpp b/Descent3/BOA.cpp index 79cb11c1b..e73028b11 100644 --- a/Descent3/BOA.cpp +++ b/Descent3/BOA.cpp @@ -1332,7 +1332,6 @@ void ValidateRoomPathPoint(int room, char *message, int len) { if (IsPathPointValid(room, &pos)) return; - bool f_found = false; // vector best_pnt; // float best_distance; diff --git a/Descent3/BriefingParse.cpp b/Descent3/BriefingParse.cpp index cfcfd8fbb..0dfbdcd04 100644 --- a/Descent3/BriefingParse.cpp +++ b/Descent3/BriefingParse.cpp @@ -275,7 +275,6 @@ static int ReadFullLine(char **data, CFILE *ifile) { // Parses the briefing file (calling the callbacks throughout), check return code int CBriefParse::ParseBriefing(const char *filename) { CFILE *ifile; - bool retvalue = false; bool voice_def_screen = false; char text_buf[8192], *text_ptr = NULL; bool abort = 0; @@ -285,7 +284,6 @@ int CBriefParse::ParseBriefing(const char *filename) { int beffect = bfxNONE; int x = 0, y = 0; char filen[40]; - bool emergency_exit = false; // the following block of 'globals' are for when parsing a text block, the information is stored // here until a $endtext is hit diff --git a/Descent3/Controls.cpp b/Descent3/Controls.cpp index d956e13e9..4011a0c84 100644 --- a/Descent3/Controls.cpp +++ b/Descent3/Controls.cpp @@ -452,9 +452,7 @@ bool Control_poll_flag = false; // determines if system is polling controls now. static bool Control_system_init = false; static float Control_interval_time = 0.0f; static float Control_current_time; -static float Control_frametime; -static float Key_pitch_ramp_time = 0.0f; -static float Key_heading_ramp_time = 0.0f; +// static float Control_frametime; static tSensitivity Key_ramp; diff --git a/Descent3/Game2DLL.cpp b/Descent3/Game2DLL.cpp index cf080a73e..959c1a121 100644 --- a/Descent3/Game2DLL.cpp +++ b/Descent3/Game2DLL.cpp @@ -592,7 +592,7 @@ bool InitGameModule(const char *name, module *mod) { // Clear out error queue mod_GetLastError(); if (!mod_LoadModule(mod, tmp_dll_name)) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_WARNING.printf("You are missing the DLL %s!", name); return false; } @@ -640,7 +640,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { mod_GetLastError(); DLLGameInit = (DLLGameInit_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameInit", 12); if (!DLLGameInit) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLGameInit!"; Int3(); FreeGameDLL(); @@ -650,7 +650,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { mod_GetLastError(); DLLGameCall = (DLLGameCall_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameCall", 8); if (!DLLGameCall) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLGameCall!"; Int3(); FreeGameDLL(); @@ -660,7 +660,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { mod_GetLastError(); DLLGameClose = (DLLGameClose_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameClose", 0); if (!DLLGameClose) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLGameClose!"; Int3(); FreeGameDLL(); @@ -670,7 +670,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { mod_GetLastError(); DLLGetGameInfo = (DLLGetGameInfo_fp)mod_GetSymbol(&GameDLLHandle, "DLLGetGameInfo", 4); if (!DLLGetGameInfo) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLGetGameInfo!"; Int3(); FreeGameDLL(); @@ -753,7 +753,7 @@ bool GetDLLGameInfo(const char *name, tDLLOptions *options) { mod_GetLastError(); modGetGameInfo = (DLLGetGameInfo_fp)mod_GetSymbol(&mod, "DLLGetGameInfo", 4); if (!modGetGameInfo) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLGetGameInfo!"; Int3(); CloseGameModule(&mod); diff --git a/Descent3/Inventory.cpp b/Descent3/Inventory.cpp index 575fa668f..4d34ff015 100644 --- a/Descent3/Inventory.cpp +++ b/Descent3/Inventory.cpp @@ -417,7 +417,7 @@ bool Inventory::AddObject(int object_handle, int flags, const char *description) ASSERT(obj->type == OBJ_BUILDING || obj->type == OBJ_ROBOT || obj->type == OBJ_POWERUP || obj->type == OBJ_CLUTTER); - inven_item *current = root, *prev = root, *newnode; + inven_item *prev = root, *newnode; if (count == 0) { // there are no items in the list...time to add @@ -531,7 +531,7 @@ bool Inventory::AddCounterMeasure(int id, int aux_type, int aux_id, int flags, c return false; } - inven_item *current = root, *prev = root, *newnode; + inven_item *prev = root, *newnode; if (count == 0) { // there are no items in the list...time to add @@ -606,7 +606,7 @@ bool Inventory::AddObjectItem(int otype, int oid, int oauxt, int oauxi, int flag if (count >= MAX_UNIQUE_INVEN_ITEMS) return false; - inven_item *current = root, *prev = root, *newnode; + inven_item *prev = root, *newnode; if (count == 0) { // there are no items in the list...time to add diff --git a/Descent3/LoadLevel.cpp b/Descent3/LoadLevel.cpp index 02ac3bdd3..4638a4118 100644 --- a/Descent3/LoadLevel.cpp +++ b/Descent3/LoadLevel.cpp @@ -3686,13 +3686,11 @@ extern bool Disable_editor_rendering; // Returns 1 if file read ok, else 0 int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { CFILE *ifile; - char tag[4]; int n, i, retval = 1; int version; bool f_read_AABB = false; bool no_128s = true; - int total = 0; #ifdef EDITOR Disable_editor_rendering = 1; Num_failed_xlate_items = 0; diff --git a/Descent3/Mission.cpp b/Descent3/Mission.cpp index f10a5b051..9180c0dce 100644 --- a/Descent3/Mission.cpp +++ b/Descent3/Mission.cpp @@ -1197,7 +1197,6 @@ bool LoadMission(const char *mssn) { void FreeMission() { // Free up mission script - int i; //,j; // close MN3 file if there is one. mn3_Close(); // Tell Osiris to shutdown the Osiris Mission Memory System, freeing all memory @@ -1265,7 +1264,6 @@ bool LoadMissionLevel(int level) { } // Test to see if levels are valid bool boa = true, terrain = true; - char str[255]; if (BOAGetMineChecksum() != BOA_vis_checksum) boa = false; diff --git a/Descent3/ObjInit.cpp b/Descent3/ObjInit.cpp index 813932147..2df2fdfed 100644 --- a/Descent3/ObjInit.cpp +++ b/Descent3/ObjInit.cpp @@ -1054,8 +1054,6 @@ int ObjInitFireball(object *objp) { } int ObjInitMarker(object *objp) { int ret = 1; - static int first = 1; - static int polynum = -1; ASSERT(objp->type == OBJ_MARKER); // Set size & shields objp->shields = 100; diff --git a/Descent3/OsirisLoadandBind.cpp b/Descent3/OsirisLoadandBind.cpp index f99025269..a1bd4e717 100644 --- a/Descent3/OsirisLoadandBind.cpp +++ b/Descent3/OsirisLoadandBind.cpp @@ -2683,7 +2683,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { return false; } - uint8_t version = (uint8_t)cf_ReadByte(file); + /* uint8_t version = */ cf_ReadByte(file); num_bytes_to_be_restored = cf_ReadInt(file); diff --git a/Descent3/Player.cpp b/Descent3/Player.cpp index 2264e9614..7d54094dd 100644 --- a/Descent3/Player.cpp +++ b/Descent3/Player.cpp @@ -2571,7 +2571,6 @@ void ResetPlayerControlType(int slot) { // Init physics object *playobj = &Objects[Players[slot].objnum]; - ship *ship = &Ships[Players[slot].ship_index]; playobj->mtype.phys_info = Ships[Players[slot].ship_index].phys_info; diff --git a/Descent3/TelCom.cpp b/Descent3/TelCom.cpp index 3eb970cdb..331e58cba 100644 --- a/Descent3/TelCom.cpp +++ b/Descent3/TelCom.cpp @@ -1144,7 +1144,6 @@ void TCMainMenuRenderCallback(void) { // Main menu bool TelComMainMenu(tTelComInfo *tcs) { - bool exitparse = false; int mm; mainmenu_system = -1; @@ -3304,7 +3303,7 @@ void PageInTexture(int n, bool resize); // Pages in all the necessary bitmaps, textures & sounds for the TelCom so that they are in memory void TelcomPageAllIn(void) { extern void UpdateInitMessage(float amount); // amount is 0 to 1 - const float TELCOM_SOUND_PORTION = 0.3f, TELCOM_BITMAP_PORTION = 0.3f, TELCOM_TEXTUREHI_PORTION = 0.2f, + const float TELCOM_SOUND_PORTION = 0.3f, TELCOM_BITMAP_PORTION = 0.3f, TELCOM_TEXTURELO_PORTION = 0.2f; int i; @@ -3719,7 +3718,6 @@ void TCSSSCallback(void) { vector view_pos; vector light_vec; matrix view_orient = IDENTITY_MATRIX; - matrix final_mat = IDENTITY_MATRIX; matrix rot_mat; // draw model. diff --git a/Descent3/TelComCargo.cpp b/Descent3/TelComCargo.cpp index 39854c706..579d5800a 100644 --- a/Descent3/TelComCargo.cpp +++ b/Descent3/TelComCargo.cpp @@ -148,7 +148,6 @@ bool TCCPlayerHasWeapon(int weapon_index) { int TCCargoCreateLine(int id, int y, const char *title, int type) { // char buffer[100]; int small_height = grfont_GetHeight(SM_FONT); - int big_height = grfont_GetHeight(BG_FONT); switch (id) { case LID_NONE: diff --git a/Descent3/TelcomEffectsRender.cpp b/Descent3/TelcomEffectsRender.cpp index b11654a6f..072c2e264 100644 --- a/Descent3/TelcomEffectsRender.cpp +++ b/Descent3/TelcomEffectsRender.cpp @@ -442,8 +442,6 @@ void RenderBmpBlur(tceffect *tce, float frametime, int xoff, int yoff, bool ok_t int sbm_handle = tce->bmpinfo.bm_handle; int dbm_handle = tce->bmpinfo.temp_bmhandle; bm_ClearBitmap(dbm_handle); - int x = 0; - int y = 0; bool done = false; if ((tce->flags == TC_BMPF_OUT) && (tce->bmpinfo.stage < 0)) done = true; @@ -636,7 +634,6 @@ void RenderBmpInvert(tceffect *tce, float frametime, int xoff, int yoff, bool ok 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; int how_many_across = tce->bmpinfo.chunk_bmp.w; int dim = bm_h(tce->bmpinfo.chunk_bmp.bm_array[0], 0); int shift; // speed up (since dim is always a power of 2) @@ -882,12 +879,10 @@ void RenderButton(tceffect *tce, float frametime, int xoff, int yoff, bool ok_to bool glow = false; while (PopEvent(tce, &evt)) { switch (evt.id) { - case TEVT_GAINFOCUS: { - int num = tce - TCEffects; - } break; - case TEVT_LOSTFOCUS: { - int num = tce - TCEffects; - } break; + case TEVT_GAINFOCUS: + break; + case TEVT_LOSTFOCUS: + break; case TEVT_MOUSEOVER: { if (tce->flags & OBF_GLOW) { if (tce->flags & OBF_MOUSEOVERFOCUS) { diff --git a/Descent3/TerrainSearch.cpp b/Descent3/TerrainSearch.cpp index 2d2403991..66fbce9f8 100644 --- a/Descent3/TerrainSearch.cpp +++ b/Descent3/TerrainSearch.cpp @@ -265,18 +265,12 @@ static uint16_t LOD_sort_num[MAX_TERRAIN_LOD]; // Variable to determine if we're in editor or game extern function_mode View_mode; -static vector TJoint_VectorAddZ; -static vector TJoint_VectorAddX; - // Since our terrain points increment in finite steps we can rotate 2 points (x,z) // just add them to a base point to get the final rotated point void PreRotateTerrain() { vector rvec = {1 * TERRAIN_SIZE, 0, 0}; vector fvec = {0, 0, 1 * TERRAIN_SIZE}; - vector tj_rvec = {4, 0, 0}; - vector tj_fvec = {0, 0, 4}; - TS_FVectorAdd = fvec * *TS_View_matrix; TS_RVectorAdd = rvec * *TS_View_matrix; @@ -792,7 +786,6 @@ float GetTerrainGroundPoint(vector *pos, vector *normal) { } int SimplifyVertexSlow(int x, int z, float delta) { - vector *eye = TS_View_position; g3Point p1, p2; p1.p3_codes = 0; diff --git a/Descent3/WeaponFire.cpp b/Descent3/WeaponFire.cpp index 936867a42..198d6423e 100644 --- a/Descent3/WeaponFire.cpp +++ b/Descent3/WeaponFire.cpp @@ -1210,8 +1210,6 @@ void AquireElectricalTarget(object *obj) { int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num) { int objnum; object *obj; - int parentnum = parent - Objects; - uint8_t terrain = 0; ASSERT(Weapons[weapon_num].used); @@ -1344,9 +1342,6 @@ int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num fate = fvi_FindIntersection(&fq, &hit_info); if (fate != HIT_NONE && fate != HIT_OUT_OF_TERRAIN_BOUNDS) { - float try_dist = vm_VectorDistance(&obj->pos, &end_pos); - float got_dist = vm_VectorDistance(&obj->pos, &hit_info.hit_pnt); - obj->ctype.laser_info.hit_pnt = hit_info.hit_pnt; obj->ctype.laser_info.hit_wall_pnt = hit_info.hit_face_pnt[0]; obj->ctype.laser_info.hit_room = hit_info.hit_room; diff --git a/Descent3/aipath.cpp b/Descent3/aipath.cpp index fd53ff795..b9c6cb2bc 100644 --- a/Descent3/aipath.cpp +++ b/Descent3/aipath.cpp @@ -231,9 +231,6 @@ static bool AIPathMoveToNextNode(ai_path_info *aip) { int c_path = aip->cur_path; int c_node = aip->cur_node; - int p_type = aip->path_type[c_path]; - int p_index = aip->path_id[c_path]; - c_node++; if (c_node <= aip->path_end_node[c_path]) { @@ -342,8 +339,6 @@ void AIPathMoveTurnTowardsNode(object *obj, vector *mdir, bool *f_moved) { bool f_reverse = (g_ptr->flags & GF_PATH_MOVE_REVERSE_DIR) != 0; - ai_frame *ai_info = obj->ai_info; - vector cur_pos; AIPathGetCurrentNodePos(aip, &cur_pos); diff --git a/Descent3/aiterrain.cpp b/Descent3/aiterrain.cpp index e31ed340d..ef08abbca 100644 --- a/Descent3/aiterrain.cpp +++ b/Descent3/aiterrain.cpp @@ -103,7 +103,6 @@ static void ai_check_terrain_node(int cur_node, int f_check_local_nodes) { int xcounter, ycounter; int xstart, xend; int ystart, yend; - int f_ignore_terrain_in_this_node = 0; // Chrishack -- Note diff --git a/Descent3/attach.cpp b/Descent3/attach.cpp index 0cc9e6a4c..04d366660 100644 --- a/Descent3/attach.cpp +++ b/Descent3/attach.cpp @@ -521,7 +521,6 @@ bool AttachObject(object *parent, char parent_ap, object *child, float percent_r ASSERT(child); poly_model *parent_pm = &Poly_models[parent->rtype.pobj_info.model_num]; - poly_model *child_pm = &Poly_models[parent->rtype.pobj_info.model_num]; if (parent_ap < 0 || parent_ap >= parent_pm->n_attach) { LOG_WARNING << "ATTACH: Parent AP invalid"; diff --git a/Descent3/audiotaunts.cpp b/Descent3/audiotaunts.cpp index 303beaa89..1f03e5653 100644 --- a/Descent3/audiotaunts.cpp +++ b/Descent3/audiotaunts.cpp @@ -96,7 +96,7 @@ bool taunt_PlayTauntFile(const char *filename) { if (!Audio_taunts_enabled) return false; - int ret = StreamPlay(filename, (MAX_GAME_VOLUME / 2.0f), 0); + StreamPlay(filename, (MAX_GAME_VOLUME / 2.0f), 0); return true; } diff --git a/Descent3/bnode.cpp b/Descent3/bnode.cpp index 1e9ad7d89..6c254fc61 100644 --- a/Descent3/bnode.cpp +++ b/Descent3/bnode.cpp @@ -322,9 +322,9 @@ int BNode_FindDirLocalVisibleBNode(int roomnum, vector *pos, vector *fvec, float float dot = *fvec * to; if (dot > 0.0f || f_retry) { - float node_size = 0.0f; + /* float node_size = 0.0f; - /* if(!f_retry) + if(!f_retry) { for(j = 0; j < bnlist->nodes[i].num_edges; j++) { diff --git a/Descent3/cockpit.cpp b/Descent3/cockpit.cpp index 617e917a5..1f81d071d 100644 --- a/Descent3/cockpit.cpp +++ b/Descent3/cockpit.cpp @@ -446,7 +446,6 @@ extern float GetTerrainDynamicScalar(vector *pos, int seg); extern void GetRoomDynamicScalar(vector *pos, room *rp, float *r, float *g, float *b); void RenderCockpit() { object *player_obj = &Objects[Players[Player_num].objnum]; - physics_info *player_phys = &player_obj->mtype.phys_info; vector view_pos, light_vec; matrix view_tmat; float view_z, view_y, view_x, keyframe; diff --git a/Descent3/config.cpp b/Descent3/config.cpp index 7ab97130d..d5dc55033 100644 --- a/Descent3/config.cpp +++ b/Descent3/config.cpp @@ -842,10 +842,10 @@ struct sound_menu { // retreive values from property sheet here. void finish() { - int iTemp; +#if defined(_DEBUG) char mixer_type = SOUND_MIXER_NONE; + int iTemp; -#if defined(_DEBUG) iTemp = *sndmixer; switch (iTemp) { diff --git a/Descent3/credits.cpp b/Descent3/credits.cpp index 584010def..ee4427551 100644 --- a/Descent3/credits.cpp +++ b/Descent3/credits.cpp @@ -349,10 +349,7 @@ void Credits_Display(void) { } int font_height = grfont_GetHeight(BIG_BRIEFING_FONT); - int total_pixel_height = font_height * count; - int cur_line = 0; - float total_pixel_count = 0; float cur_pixel_count = 0; float last_time = timer_GetTime(); diff --git a/Descent3/damage.cpp b/Descent3/damage.cpp index 7589de34f..6a9c00385 100644 --- a/Descent3/damage.cpp +++ b/Descent3/damage.cpp @@ -1210,7 +1210,6 @@ void KillObject(object *objp, object *killer, float damage, int death_flags, flo // If blast rings set, create 0-2 delayed blast rings if (death_flags & DF_BLAST_RING) { - float ring_size = OBJECT_OUTSIDE(objp) ? (objp->size * 3) : objp->size; int extras = ps_rand() % 3; for (int i = 0; i < extras; i++) CreateNewEvent(0, 0, (i * .1) + .1, objp, sizeof(*objp), DoBlastRingEvent); diff --git a/Descent3/demofile.cpp b/Descent3/demofile.cpp index 2cef503d5..a65cb72b7 100644 --- a/Descent3/demofile.cpp +++ b/Descent3/demofile.cpp @@ -309,7 +309,6 @@ static float Demo_next_frame = 0; static float Demo_frame_time = 0; static float Demo_last_pinfo; float Demo_frame_ofs; -static int Demo_auto_idx = 0; uint32_t Demo_flags = 0; uint16_t Demo_obj_map[MAX_OBJECTS]; static bool Demo_turretchanged[MAX_OBJECTS]; @@ -553,7 +552,6 @@ void DemoReadTurretChanged(void) { int objnum; uint16_t num_turrets; float turr_time; - int count = 0; float do_time; do_time = cf_ReadFloat(Demo_cfp); @@ -599,7 +597,6 @@ void DemoWriteObjAnimChanged(uint16_t objnum) { void DemoReadObjAnimChanged(void) { custom_anim multi_anim_info; int objnum; - int count = 0; float changetime; changetime = cf_ReadFloat(Demo_cfp); objnum = cf_ReadShort(Demo_cfp); diff --git a/Descent3/fireball.cpp b/Descent3/fireball.cpp index 5b51c729e..3c16fe54b 100644 --- a/Descent3/fireball.cpp +++ b/Descent3/fireball.cpp @@ -1043,7 +1043,6 @@ void CreateSplintersFromBody(object *obj, float explosion_mag, float lifetime) { vector rot_vecs[MAX_SUBOBJECTS]; int num_splinters = 0; int i, t; - int parent_objnum = obj - Objects; matrix m; m = obj->orient; vm_TransposeMatrix(&m); @@ -2230,8 +2229,6 @@ void DrawBlastRingObject(object *obj) { float cur_size = lifenorm * obj->ctype.blast_info.max_size; int i; g3Point *pntlist[4]; - static int grav_first = 1; - static int grav_texture; if (obj->id == GRAVITY_FIELD_INDEX) cur_size = (1 - lifenorm) * obj->ctype.blast_info.max_size; diff --git a/Descent3/gauges.cpp b/Descent3/gauges.cpp index 35f6dc3eb..24f62a50e 100644 --- a/Descent3/gauges.cpp +++ b/Descent3/gauges.cpp @@ -370,7 +370,6 @@ void InitGauges(tStatMask gauge_mask) { // deinitializes cockpit gauges void CloseGauges() { for (int i = 0; i < NUM_GAUGES; i++) { - uint16_t mask = Gauge_mask & (1 << i); Gauge_list[i].monitor = NULL; } Gauge_mask = 0; diff --git a/Descent3/hud.cpp b/Descent3/hud.cpp index 13c780908..24b28a516 100644 --- a/Descent3/hud.cpp +++ b/Descent3/hud.cpp @@ -1498,7 +1498,6 @@ void RenderHUDItems(tStatMask stat_mask) { char *keyp = NULL; char *axis = NULL; player *pp = &Players[Player_num]; - int fidkey = -1, fidcont = -1; int hudconty = 130; RenderHUDTextFlags(0, GR_GREEN, HUD_ALPHA, 0, 15, hudconty, TXT_ENABLED_CONTROLS); diff --git a/Descent3/huddisplay.cpp b/Descent3/huddisplay.cpp index 1d0e49d9f..4b8fa0092 100644 --- a/Descent3/huddisplay.cpp +++ b/Descent3/huddisplay.cpp @@ -667,9 +667,7 @@ void RenderHUDSecondary(tHUDItem *item) { int index = Players[Player_num].weapon[PW_SECONDARY].index; ship *ship = &Ships[Players[Player_num].ship_index]; otype_wb_info *wb = &ship->static_wb[index]; - weapon *wpn = GetWeaponFromIndex(Player_num, index); const char *text = TXT(Static_weapon_names_msg[index]); - float txt_w = (int)(grtext_GetLineWidth(text) / Hud_aspect_x) + 2; if (item->stat & STAT_GRAPHICAL) { int icon; diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index 0f596fb3b..a9ad06b39 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -520,8 +520,6 @@ bool AddMultipleLinesToHUDMessages(char *temp_message, ddgr_color color) { // Returns true if message added, or false if message not (because the previous message was the same) bool AddColoredHUDMessage(ddgr_color color, const char *format, ...) { std::va_list args; - char *message = NULL; - char *last_message = NULL; char temp_message[HUD_MESSAGE_LENGTH * 2]; va_start(args, format); @@ -556,8 +554,6 @@ bool AddFilteredColoredHUDMessage(ddgr_color color, const char *format, ...) { return false; // filter this message std::va_list args; - char *message = NULL; - char *last_message = NULL; char temp_message[HUD_MESSAGE_LENGTH * 2]; va_start(args, format); @@ -592,8 +588,6 @@ bool AddFilteredHUDMessage(const char *format, ...) { return false; // filter this message std::va_list args; - char *message = NULL; - char *last_message = NULL; char temp_message[HUD_MESSAGE_LENGTH * 2]; va_start(args, format); @@ -616,8 +610,6 @@ bool AddFilteredHUDMessage(const char *format, ...) { // Returns true if message added, or false if message not (because the previous message was the same) bool AddHUDMessage(const char *format, ...) { std::va_list args; - char *message = NULL; - char *last_message = NULL; char temp_message[HUD_MESSAGE_LENGTH * 2]; va_start(args, format); @@ -640,8 +632,6 @@ bool AddHUDMessage(const char *format, ...) { // Returns true if message added, or false if message not (because the previous message was the same) bool AddBlinkingHUDMessage(const char *format, ...) { std::va_list args; - char *message = NULL; - char *last_message = NULL; char temp_message[HUD_MESSAGE_LENGTH * 2]; va_start(args, format); @@ -908,7 +898,6 @@ void SendOffHUDInputMessage() { // Breaks up the input message so that if we overflow it starts on the next line nicely // Returns the number of characters in the next line int BreakupHUDInputMessage(char *str) { - int cur = 0; int last_space = -1; int len = strlen(HudInputMessage); @@ -1128,7 +1117,6 @@ void RenderScrollingHUDMessages() { char *message = HUD_messages[i]; int text_width = grtext_GetTextLineWidth(message); - int vp_width = Game_window_w; int y = (i * text_height) + Hud_scroll_offset; if (HUD_message_type[i] == HUD_MESSAGE_BLINKING) { diff --git a/Descent3/init.cpp b/Descent3/init.cpp index a6090ddb0..3ac87a73d 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1868,7 +1868,7 @@ void InitD3Systems1(bool editor) { gspy_Init(); // Sound initialization - int soundres = Sound_system.InitSoundLib(Descent, Sound_mixer, Sound_quality, false); + Sound_system.InitSoundLib(Descent, Sound_mixer, Sound_quality, false); // Initialize Cinematics system InitCinematics(); diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index 1a128b771..d0b457f5f 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -1059,7 +1059,6 @@ void ApplyLightingToRooms(vector *pos, int roomnum, float light_dist, float red_ int num_faces, i, t, lm_handle; uint16_t *dest_data; - int faces_misreported = 0; if (Dedicated_server) return; diff --git a/Descent3/lightmap_info.cpp b/Descent3/lightmap_info.cpp index 310298cee..a2e0a0144 100644 --- a/Descent3/lightmap_info.cpp +++ b/Descent3/lightmap_info.cpp @@ -35,8 +35,6 @@ lightmap_info *LightmapInfo = NULL; static uint16_t *Free_lmi_list = NULL; void CloseLightmapInfos() { - bool final_lightmap = true; - if (LightmapInfo) mem_free(LightmapInfo); diff --git a/Descent3/loadstate.cpp b/Descent3/loadstate.cpp index c64e4014e..c349e5d36 100644 --- a/Descent3/loadstate.cpp +++ b/Descent3/loadstate.cpp @@ -1308,8 +1308,6 @@ int LGSObjects(CFILE *fp, int version) { p_info->multi_turret_info.num_turrets = count; if ((count > 0) && (p_info->multi_turret_info.keyframes == NULL)) { - int cur = 0; - p_info->multi_turret_info.time = 0; p_info->multi_turret_info.keyframes = mem_rmalloc(count); p_info->multi_turret_info.last_keyframes = mem_rmalloc(count); @@ -1564,7 +1562,7 @@ int LGSObjSpecial(CFILE *fp, object *op) { // load spew int LGSSpew(CFILE *fp) { - int i, count = 0; + int i; // read GLOBAL value gs_ReadShort(fp, spew_count); diff --git a/Descent3/menu.cpp b/Descent3/menu.cpp index 0f7e6c5a0..450ff2b41 100644 --- a/Descent3/menu.cpp +++ b/Descent3/menu.cpp @@ -1105,7 +1105,7 @@ bool MenuNewGame() { std::vector filelist; int n_missions, res; bool found = false; - bool do_menu = true, load_mission = false, retval = true; + bool retval = true; #ifdef DEMO if (LoadMission("d3demo.mn3")) { CurrentPilotUpdateMissionStatus(true); diff --git a/Descent3/mmItem.cpp b/Descent3/mmItem.cpp index 43d2604b4..0c558b5f3 100644 --- a/Descent3/mmItem.cpp +++ b/Descent3/mmItem.cpp @@ -416,7 +416,6 @@ void mmInterface::OnDestroy() { // displays the copyright text void mmInterface::CopyrightText() { - int i; char type[16]; type[0] = 0; #ifdef DEMO @@ -464,8 +463,6 @@ void mmInterface::SetMusicRegion(int region) { // display menu scene void MenuScene() { - extern bool NewUI_wait_dialog; // is wait dialog up? - if (MM_object) { StartFrame(); diff --git a/Descent3/multi.cpp b/Descent3/multi.cpp index 543d298ed..fa3e8cd34 100644 --- a/Descent3/multi.cpp +++ b/Descent3/multi.cpp @@ -2016,7 +2016,6 @@ int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data) { MultiAddByte(0, data, &count); vector *vel = &obj->mtype.phys_info.velocity; - vector *rotvel = &obj->mtype.phys_info.rotvel; MultiAddShort((vel->x * 128.0), data, &count); MultiAddShort((vel->y * 128.0), data, &count); @@ -3774,7 +3773,6 @@ int MultiFindFreeSlot() { void MultiDoAskToJoin(uint8_t *data, network_address *from_addr) { uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; - int incount = 0; int size; size = START_DATA(MP_JOIN_RESPONSE, outdata, &count); @@ -4098,8 +4096,6 @@ void MultiSendBlowupBuilding(int hit_objnum, int killer_objnum, float damage) { int size_offset = 0; uint8_t data[MAX_GAME_DATA_SIZE]; - uint16_t short_damage = damage; - size_offset = START_DATA(MP_BLOWUP_BUILDING, data, &count, 1); MultiAddShort(hit_objnum, data, &count); MultiAddShort(killer_objnum, data, &count); @@ -4577,8 +4573,6 @@ void MultiDoJoinObjects(uint8_t *data) { uint32_t checksum; matrix orient; - uint8_t name_len = 0; - uint8_t num_persist_vars = 0; vm_MakeIdentity(&orient); @@ -4997,7 +4991,7 @@ void MultiDoMessageToServer(uint8_t *data) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); SKIP_HEADER(data, &count); - uint8_t slot = MultiGetByte(data, &count); + /* uint8_t slot = */ MultiGetByte(data, &count); int towho = (int8_t)MultiGetByte(data, &count); uint8_t len = MultiGetByte(data, &count); @@ -5320,8 +5314,6 @@ void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record) { if (demo_record) obj->flags |= OF_CLIENTDEMOOBJECT; - object *parent_obj = ObjGetUltimateParent(obj); - size_offset = START_DATA(MP_OBJECT, data, &count, 1); uint32_t index = MultiGetMatchChecksum(obj->type, obj->id); @@ -5489,7 +5481,6 @@ int MultiStuffGuidedInfo(int slot, uint8_t *data) { // Do velocity vector *vel = &obj->mtype.phys_info.velocity; - vector *rotvel = &obj->mtype.phys_info.rotvel; MultiAddShort(vel->x * 128.0, data, &count); MultiAddShort(vel->y * 128.0, data, &count); @@ -5654,7 +5645,7 @@ void MultiDoRemoveObject(uint8_t *data) { SKIP_HEADER(data, &count); uint16_t server_objnum = MultiGetUshort(data, &count); - uint8_t type = MultiGetByte(data, &count); + /* uint8_t type = */ MultiGetByte(data, &count); uint8_t sound = MultiGetByte(data, &count); @@ -5866,7 +5857,7 @@ void MultiDoOnOff(uint8_t *data) { uint8_t slot = MultiGetByte(data, &count); uint8_t on = MultiGetByte(data, &count); uint8_t wb_index = MultiGetByte(data, &count); - uint8_t fire_mask = MultiGetByte(data, &count); + /* uint8_t fire_mask = */ MultiGetByte(data, &count); if (on) { Objects[Players[slot].objnum].weapon_fire_flags |= WFF_ON_OFF; @@ -7353,8 +7344,6 @@ void MultiAddObjWBAnimUpdate(int objnum) { int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data) { // multi_anim multi_anim_info; - int count = 0; - int size = 0; if (Netgame.local_role != LR_SERVER) { BailOnMultiplayer(NULL); @@ -7677,7 +7666,7 @@ void MultiDoFileDenied(uint8_t *data) { // We asked for a file, but the request was denied for some reason int count = 0; SKIP_HEADER(data, &count); - uint16_t filenum = MultiGetUshort(data, &count); + /* uint16_t filenum = */ MultiGetUshort(data, &count); uint16_t playernum = MultiGetUshort(data, &count); uint16_t filewho = MultiGetUshort(data, &count); LOG_DEBUG.printf("Got a file denied packet from %d", playernum); @@ -7802,7 +7791,6 @@ void SendDataChunk(int playernum) { try { cf_ReadBytes(readbuf, dataread, NetPlayers[playernum].file_xfer_cfile); } catch (cfile_error *cfe) { - int t = cfe->read_write; // this is is here to fix compile warning // Woops, can't read the file, better error out! MultiCancelFile(playernum, NetPlayers[playernum].file_xfer_id, NetPlayers[playernum].file_xfer_who); Int3(); @@ -8123,7 +8111,7 @@ void MultiDoPing(uint8_t *data, network_address *addr) { int size_offset; SKIP_HEADER(data, &count); - uint8_t slot = MultiGetByte(data, &count); + /* uint8_t slot = */ MultiGetByte(data, &count); float pingtime = MultiGetFloat(data, &count); // Now send a response @@ -9299,7 +9287,6 @@ void DoReqPlayerList(network_address *addr) { memset(outdata, 0, sizeof(outdata)); size = START_DATA(MP_PLAYERLIST_DATA, outdata, &count); - uint16_t icurrplayers = 0; int i = 0; if (Dedicated_server) { // Skip the server player diff --git a/Descent3/multi_connect.cpp b/Descent3/multi_connect.cpp index 388a3ac53..492068f1b 100644 --- a/Descent3/multi_connect.cpp +++ b/Descent3/multi_connect.cpp @@ -595,7 +595,6 @@ void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr int MultiPollForLevelInfo() { float start_time, ask_time, initial_start_time; - int connected = 0; uint8_t data[MAX_RECEIVE_SIZE]; network_address from_addr; @@ -903,7 +902,6 @@ void MultiCloseGame() { int SearchForLocalGamesTCP(uint32_t ask, uint16_t port) { int count = 0; int size; - int tries = 0; uint8_t data[MAX_GAME_DATA_SIZE]; network_address check_addr, from_addr; check_addr.connection_type = NP_TCP; @@ -932,7 +930,6 @@ int SearchForLocalGamesTCP(uint32_t ask, uint16_t port) { int SearchForGamesPXO(uint32_t ask, uint16_t port) { int count = 0; int size; - int tries = 0; uint8_t data[MAX_GAME_DATA_SIZE]; network_address check_addr, from_addr; check_addr.connection_type = NP_TCP; diff --git a/Descent3/multi_dll_mgr.cpp b/Descent3/multi_dll_mgr.cpp index d7e3d961d..62ff2679b 100644 --- a/Descent3/multi_dll_mgr.cpp +++ b/Descent3/multi_dll_mgr.cpp @@ -638,14 +638,14 @@ int LoadMultiDLL(const char *name) { loaddll: if (!mod_LoadModule(&MultiDLLHandle, tmp_dll_name)) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_WARNING.printf("You are missing the DLL %s!", name); return 0; } DLLMultiInit = (DLLMultiInit_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiInit", 4); if (!DLLMultiInit) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLMultiInit!"; Int3(); FreeMultiDLL(); @@ -653,7 +653,7 @@ int LoadMultiDLL(const char *name) { } DLLMultiCall = (DLLMultiCall_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiCall", 4); if (!DLLMultiCall) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLMultiCall!"; Int3(); FreeMultiDLL(); @@ -661,7 +661,7 @@ int LoadMultiDLL(const char *name) { } DLLMultiClose = (DLLMultiClose_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiClose", 0); if (!DLLMultiClose) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLMultiClose!"; Int3(); FreeMultiDLL(); @@ -693,7 +693,7 @@ int LoadMultiDLL(const char *name) { DLLMultiScoreCall = (DLLMultiScoreCall_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiScoreEvent", 8); if (!DLLMultiScoreCall) { - int err = mod_GetLastError(); + mod_GetLastError(); LOG_FATAL << "Couldn't get a handle to the dll function DLLMultiScoreCall!"; Int3(); Supports_score_api = false; diff --git a/Descent3/multi_ui.cpp b/Descent3/multi_ui.cpp index b27cab6d0..090e26eca 100644 --- a/Descent3/multi_ui.cpp +++ b/Descent3/multi_ui.cpp @@ -723,10 +723,8 @@ void DoMultiAllowed(void) { int i; const char *p; int objid; - int *index_to_id = NULL; bool shipsallowed[MAX_SHIPS]; bool objsallowed[MAX_OBJECTS]; - ConfigItem **ship_list = NULL; size_t strMax = std::max(strlen(TXT_ALLOW), strlen(TXT_DISALLOW)) + 3; char *str = mem_rmalloc(strMax); @@ -1067,7 +1065,6 @@ void MultiGameOptionsMenu(int alloptions) { NewUIWindow main_wnd; main_wnd.Create(0, 0, rs.screen_width, rs.screen_height, UIF_PROCESS_ALL); - int num_text = 0, num_edit = 0; int return_id; int id = 0; diff --git a/Descent3/multisafe_server.cpp b/Descent3/multisafe_server.cpp index 503a42cc3..4fd31cff4 100644 --- a/Descent3/multisafe_server.cpp +++ b/Descent3/multisafe_server.cpp @@ -1147,9 +1147,6 @@ void MultiDoMSafePowerup(uint8_t *data) { // Sends a powerup over to be evaluated on the client machine void MultiSendMSafePowerup(msafe_struct *mstruct) { - int sequence = -1; - int to_slot = -1; - // ASSERT (Netgame.local_role==LR_SERVER); uint8_t data[MAX_GAME_DATA_SIZE]; diff --git a/Descent3/newui.cpp b/Descent3/newui.cpp index d5c3a1507..30a9231af 100644 --- a/Descent3/newui.cpp +++ b/Descent3/newui.cpp @@ -372,7 +372,6 @@ void GetCenteredTextPos(int width, int gap, int left_item_width, int middle_item int *mx, int *rx) { int center_x = width / 2; int width_of_items = 2 * gap + left_item_width + middle_item_width + right_item_width; - int center_of_items = width_of_items / 2; *lx = center_x - (width_of_items / 2); *mx = (*lx) + gap + left_item_width; diff --git a/Descent3/newui_core.cpp b/Descent3/newui_core.cpp index 7346455c6..7da027c62 100644 --- a/Descent3/newui_core.cpp +++ b/Descent3/newui_core.cpp @@ -3119,7 +3119,6 @@ void newuiListBox::OnDraw() { // draw text? int i; - uint8_t alpha = 255; bool auto_select = ((m_Flags & UILB_AUTOSELECT) > 0); bool use_scroll = true; @@ -3768,9 +3767,6 @@ void newuiComboBox::SetSelectChangeCallback(void (*fn)(int)) { selectchange_fn = // behavior when gadget is being drawn. void newuiComboBox::OnDraw() { m_barbmp->draw(0, 0); - bool auto_select = ((m_Flags & UILB_AUTOSELECT) > 0); - bool use_scroll = true; - ui_SetTextClip(m_boffs, 1, m_W - m_boffs - m_up_btn.W(), m_H - 1); // decide whether to show arrows. , tricky code. diff --git a/Descent3/object.cpp b/Descent3/object.cpp index 8701fd2a8..1ee5b8a69 100644 --- a/Descent3/object.cpp +++ b/Descent3/object.cpp @@ -1997,7 +1997,6 @@ void FreeAllObjects() { void ObjDeleteDead() { int i; object *objp; - int local_dead_player_object = -1; // Move all objects objp = Objects; @@ -2066,7 +2065,6 @@ void ObjDeleteDead() { if (IS_GUIDEBOT(objp)) { int i; - int handle = objp->handle; for (i = 0; i < MAX_PLAYERS; i++) { if (objp->handle == Buddy_handle[i]) { @@ -2615,7 +2613,6 @@ extern int DoAI; //-------------------------------------------------------------------- // Process an object for the current frame void ObjDoFrame(object *obj) { - int previous_room = obj->roomnum; float save_frametime = Frametime; ASSERT(obj->type != OBJ_NONE); @@ -3299,7 +3296,6 @@ bool ObjGetAnimUpdate(uint16_t objnum, custom_anim *multi_anim_info) { if ((objnum >= 0) && (obj->type != OBJ_NONE) && (obj->type != OBJ_WEAPON) && (obj->flags & OF_POLYGON_OBJECT)) { polyobj_info *pm = &obj->rtype.pobj_info; - ai_frame *ai_info = obj->ai_info; multi_anim_info->server_time = Gametime; multi_anim_info->server_anim_frame = (uint16_t)(pm->anim_frame * 256.0f); @@ -3367,8 +3363,6 @@ void SetObjectControlType(object *obj, int control_type) { p_info->multi_turret_info.num_turrets = count; if ((count > 0) && (p_info->multi_turret_info.keyframes == NULL)) { - int cur = 0; - p_info->multi_turret_info.time = 0; p_info->multi_turret_info.keyframes = mem_rmalloc(count); p_info->multi_turret_info.last_keyframes = mem_rmalloc(count); @@ -3431,7 +3425,6 @@ void ObjGetTurretUpdate(uint16_t objnum, multi_turret *multi_turret_info) { void ObjSetTurretUpdate(uint16_t objnum, multi_turret *multi_turret_info) { object *obj = &Objects[objnum]; - poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num]; polyobj_info *p_info = &obj->rtype.pobj_info; if ((objnum >= 0) && (obj->type != OBJ_NONE) && (obj->type != OBJ_WEAPON) && (obj->flags & OF_POLYGON_OBJECT) && diff --git a/Descent3/object_lighting.cpp b/Descent3/object_lighting.cpp index ada517e1c..18897f7f8 100644 --- a/Descent3/object_lighting.cpp +++ b/Descent3/object_lighting.cpp @@ -237,8 +237,6 @@ void DoObjectLight(object *obj) { hit_info.hit_pnt -= obj->orient.fvec / 4; - float dist = vm_VectorDistanceQuick(&hit_info.hit_pnt, &obj->pos); - // Now light up the hit area if (ROOMNUM_OUTSIDE(hit_info.hit_room)) ApplyLightingToTerrain(&hit_info.hit_pnt, CELLNUM(hit_info.hit_room), FAST_HEADLIGHT_SIZE, @@ -470,7 +468,6 @@ void ClearObjectLightmaps(object *obj) { poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num]; ASSERT(pm->n_models < MAX_SUBOBJECTS); - int faceCount = 0; for (Mnum = 0; Mnum < pm->n_models; Mnum++) { if (!IsNonRenderableSubmodel(pm, Mnum)) { mem_free(obj->lm_object.lightmap_faces[Mnum][0].u2); diff --git a/Descent3/osiris_predefs.cpp b/Descent3/osiris_predefs.cpp index 762bf8e84..b871da61c 100644 --- a/Descent3/osiris_predefs.cpp +++ b/Descent3/osiris_predefs.cpp @@ -1877,7 +1877,6 @@ int osipf_AIGoalAdd(int objhandle, int goal_type, int level, float influence, in // Pop Goal Local Variables va_start(marker, flags); int i_value = va_arg(marker, int); - int j_value = va_arg(marker, int); va_end(marker); // Do the actual goal and return; diff --git a/Descent3/procedurals.cpp b/Descent3/procedurals.cpp index 456a7d3a3..c1316a8c6 100644 --- a/Descent3/procedurals.cpp +++ b/Descent3/procedurals.cpp @@ -215,7 +215,6 @@ void InitProcedurals() { float fg = gcount; int g = std::min((fg * lo_norm) + (7.0 * hi_norm), 7.0); for (t = 0; t < 32; t++) { - int index = gcount * 32 + t; WaterProcTableLo[i][gcount * 32 + t] |= (g << 5); } } @@ -224,8 +223,6 @@ void InitProcedurals() { int g = std::min((fg * lo_norm) + (24.0 * hi_norm), 24.0); for (t = 0; t < 32; t++) { - int index = t * 4 + gcount; - WaterProcTableHi[i][t * 4 + gcount] |= (g << 5); } } @@ -483,8 +480,6 @@ static inline void PlaceProcPoint(int x, int y, uint8_t color) { } // Adds a sphere lightning bolt void AddProcSphereLightning(int handle, static_proc_element *proc) { - int procnum = proc - GameTextures[handle].procedural->static_proc_elements; - if (Detail_settings.Procedurals_enabled) { if (proc->frequency != 0 && ((FrameCount) % proc->frequency) != 0) return; @@ -1149,7 +1144,6 @@ void EvaluateWaterProcedural(int handle) { if (procedural->memory_type != PROC_MEMORY_TYPE_WATER) AllocateMemoryForWaterProcedural(handle); - int dest_bitmap = procedural->procedural_bitmap; for (int i = 0; i < procedural->num_static_elements; i++) { static_proc_element *proc = &procedural->static_proc_elements[i]; switch (proc->type) { diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 005abd6b9..db7b5ad1c 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -76,8 +76,6 @@ void RotateRoomPoints(room *rp, vector4 *world_vecs); #endif - -static int Faces_rendered = 0; extern float GetFPS(); extern uint8_t Outline_release_mode; // 3d point for each vertex for use during rendering a room @@ -709,7 +707,6 @@ void RotateAllExternalRooms() { room *rp = &Rooms[roomnum]; MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); - uint8_t andbyte = 0xff; g3Point pnt; External_room_codes[i] = 0xff; External_room_project_net[i] = 0; @@ -2446,7 +2443,7 @@ void RenderSingleLightGlow(int index) { // Draws a glow around a light void RenderSingleLightGlow2(int index) { static int first = 1; - static int normal_handle, star_handle; + static int star_handle; int bm_handle; room *rp = &Rooms[LightGlows[index].roomnum]; face *fp = &rp->faces[LightGlows[index].facenum]; @@ -2773,7 +2770,6 @@ void BuildMirroredRoomList() { cc.cc_and = 0xff; cc.cc_or = 0; int nv = fp->num_verts; - int clipped = 0; for (i = 0; i < fp->num_verts; i++) { vector temp_vec; @@ -2859,7 +2855,6 @@ void RenderMirroredRoom(room *rp) { #endif uint16_t save_flags[MAX_FACES_PER_ROOM]; bool restore_index = true; - int save_index = Global_buffer_index; // Save old rotated points if (rp->wpb_index == -1) { @@ -3001,7 +2996,6 @@ static int obj_sort_func(const obj_sort_item *a, const obj_sort_item *b) { static inline void IsRoomDynamicValid(room *rp, int x, int y, int z, float *r, float *g, float *b) { int w = rp->volume_width; int h = rp->volume_height; - int d = rp->volume_depth; uint8_t color = rp->volume_lights[(z * w * h) + (y * w) + x]; @@ -3058,9 +3052,6 @@ void GetRoomDynamicScalar(vector *pos, room *rp, float *r, float *g, float *b) { IsRoomDynamicValid(rp, int_x, next_y, next_z, &back_values_r[1], &back_values_g[1], &back_values_b[1]); IsRoomDynamicValid(rp, next_x, next_y, next_z, &back_values_r[2], &back_values_g[2], &back_values_b[2]); IsRoomDynamicValid(rp, next_x, int_y, next_z, &back_values_r[3], &back_values_g[3], &back_values_b[3]); - // Do front edge - int left_out = 0; - int right_out = 0; // Left edge left_norm_r = ((1 - fl_y) * front_values_r[0]) + (fl_y * front_values_r[1]); left_norm_g = ((1 - fl_y) * front_values_g[0]) + (fl_y * front_values_g[1]); diff --git a/Descent3/renderobject.cpp b/Descent3/renderobject.cpp index 082943092..547781364 100644 --- a/Descent3/renderobject.cpp +++ b/Descent3/renderobject.cpp @@ -996,7 +996,6 @@ void DrawDebugInfo(object *obj) { // Draw a shard void DrawShardObject(object *obj) { shard_info_s *si = &obj->rtype.shard_info; - bool flip = 0; g3Point rotated_points[3]; g3Point *pointlist[3]; uint8_t codes_and = 0xff; @@ -1335,7 +1334,6 @@ void RenderObject(object *obj) { float curr_alpha = 1.0f - alpha_step; float curr_t = t_interval; - float full_time = AFT / total_time; // how much of the interval we want to go across for (i = 0; i < num_iterations; i++) { if (!GetLinearPosition(positions, times, MAX_POSITION_HISTORY + 1, curr_t, &obj->pos)) @@ -1980,7 +1978,6 @@ void DrawPlayerDamageDisk(object *obj) { return; rend_SetZBias(-obj->size); int bm_handle; - int objnum = obj - Objects; float rot_temp = .25; // Higher is faster int int_game = Gametime / rot_temp; float diff = Gametime - (int_game * rot_temp); diff --git a/Descent3/scorch.cpp b/Descent3/scorch.cpp index 9f911031e..f1be9b912 100644 --- a/Descent3/scorch.cpp +++ b/Descent3/scorch.cpp @@ -293,9 +293,6 @@ struct { // Draw the scorch(es) for a given face void DrawScorches(int roomnum, int facenum) { - int i; - scorch *sp; - if (!Detail_settings.Scorches_enabled) return; diff --git a/Descent3/screens.cpp b/Descent3/screens.cpp index 978bfd5c4..c7cc0cdbd 100644 --- a/Descent3/screens.cpp +++ b/Descent3/screens.cpp @@ -221,8 +221,10 @@ #define BACKGROUND_VIS 0 #define OVERLAY_VIS 1 +/* static int Stat_ratings[] = {TXI_SCRNNONE, TXI_SCRNFEEBLE, TXI_SCRNPOOR, TXI_SCRNAVG, TXI_SCRNGOOD, TXI_SCRNEXCELLENT, TXI_SCRNSUPREME}; +*/ static struct { int state; diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index d982bc4b9..48b3e6b15 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -565,7 +565,6 @@ void BuildTerrainNormals() { for (z = 0, i = 0; i < TERRAIN_DEPTH - simplemul; i += simplemul, z++) { for (x = 0, t = 0; t < TERRAIN_WIDTH - simplemul; t += simplemul, x++) { - terrain_segment *tseg = &Terrain_seg[i * TERRAIN_WIDTH + t]; terrain_segment *tseg0 = &Terrain_seg[i * TERRAIN_WIDTH + t]; terrain_segment *tseg1 = &Terrain_seg[(i + simplemul) * TERRAIN_WIDTH + t]; terrain_segment *tseg2 = &Terrain_seg[((i + simplemul) * TERRAIN_WIDTH) + t + simplemul]; diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index bafca29ee..65e912f3e 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -1306,8 +1306,6 @@ void RenderTerrain(uint8_t from_mine, int left, int top, int right, int bot) { // Get the size of the current render window int render_width, render_height; rend_GetProjectionParameters(&render_width, &render_height); - float w2 = ((float)render_width - 1) / 2.0f; - float h2 = ((float)render_height - 1) / 2.0f; // Set up vars for (psuedo-)clipping window if (left < 0) { @@ -2689,7 +2687,7 @@ void DisplayTerrainList(int cellcount, bool from_automap) { rend_SetWrapType(WT_WRAP); } // Arrays for drawing -static int src[256]; +// static int src[256]; static g3Point base[256]; static g3Point *slist[256]; // Draws the 2 triangles of the Terrainlist[index] (software) diff --git a/Descent3/trigger.cpp b/Descent3/trigger.cpp index c1355f6f4..ef94e829b 100644 --- a/Descent3/trigger.cpp +++ b/Descent3/trigger.cpp @@ -167,7 +167,6 @@ void FreeTriggers() { // Generates an error if the trigger cannot be found // Paramaters: roomnum,facenum - the room and face with the trigger trigger *FindTrigger(int roomnum, int facenum) { - face *fp = &Rooms[roomnum].faces[facenum]; trigger *tp; int i; diff --git a/Descent3/viseffect.cpp b/Descent3/viseffect.cpp index 6152f97cc..74004c1c3 100644 --- a/Descent3/viseffect.cpp +++ b/Descent3/viseffect.cpp @@ -936,9 +936,7 @@ void CreateRandomParticles(int num_sparks, vector *pos, int roomnum, int bm_hand void DrawVisFadingLine(vis_effect *vis) { float norm_time; float time_live = Gametime - vis->creation_time; - float size = vis->size; - int visnum = vis - VisEffects; norm_time = time_live / vis->lifetime; if (norm_time >= 1) @@ -1087,7 +1085,6 @@ void DrawVisRainDrop(vis_effect *vis) { float time_live = Gametime - vis->creation_time; float size = vis->size; - int visnum = vis - VisEffects; int bm_handle; fireball *fb = &Fireballs[vis->id]; @@ -1147,7 +1144,6 @@ void DrawVisSnowflake(vis_effect *vis) { float time_live = Gametime - vis->creation_time; float size = vis->size; - int visnum = vis - VisEffects; int bm_handle; fireball *fb = &Fireballs[vis->id]; @@ -1464,9 +1460,7 @@ void DrawVisAxisBillboard(vis_effect *vis) { float norm_time, alpha_norm = 1; float uchange = 0, vchange = 0; float time_live = Gametime - vis->creation_time; - float size = vis->size; - int visnum = vis - VisEffects; int bm_handle; int i; @@ -1485,8 +1479,6 @@ void DrawVisAxisBillboard(vis_effect *vis) { pntlist[i] = &pnts[i]; } - fireball *fb = &Fireballs[vis->id]; - norm_time = time_live / vis->lifetime; if (vis->flags & VF_EXPAND) @@ -1572,11 +1564,8 @@ void DrawVisAxisBillboard(vis_effect *vis) { // Draws a bitmap that can orient around an axis void DrawVisBillboardSmoketrail(vis_effect *vis) { float norm_time, alpha_norm = 1; - float uchange = 0, vchange = 0; float time_live = Gametime - vis->creation_time; - float size = vis->size; - int visnum = vis - VisEffects; int bm_handle; // Get corners of this billboard @@ -1601,8 +1590,6 @@ void DrawVisBillboardSmoketrail(vis_effect *vis) { if (!GetBillboardCorners(pnts, &top_point, &bot_point, width)) return; - fireball *fb = &Fireballs[vis->id]; - for (int i = 0; i < 4; i++) { pnts[i].p3_flags |= PF_UV | PF_RGBA; pntlist[i] = &pnts[i]; diff --git a/Descent3/voice.cpp b/Descent3/voice.cpp index b889df501..2d76b9d96 100644 --- a/Descent3/voice.cpp +++ b/Descent3/voice.cpp @@ -152,9 +152,9 @@ void StartVoice(char *filename, int flags) { return; } - bool compressed = (flags & VF_COMPRESSED) ? true : false; - bool bit8 = (flags & VF_8BIT) ? true : false; - bool stereo = (flags & VF_STEREO) ? true : false; + // bool compressed = (flags & VF_COMPRESSED) ? true : false; + // bool bit8 = (flags & VF_8BIT) ? true : false; + // bool stereo = (flags & VF_STEREO) ? true : false; int vf = 0; diff --git a/Descent3/weather.cpp b/Descent3/weather.cpp index 29fb42bba..ec2515e49 100644 --- a/Descent3/weather.cpp +++ b/Descent3/weather.cpp @@ -155,7 +155,6 @@ void DoRainEffect() { if (visnum >= 0) { vis_effect *vis = &VisEffects[visnum]; float life = .2f; - float size = .7 + ((ps_rand() % 10) / 20.0); vis->lifeleft = life; vis->lifetime = life; vis->end_pos = norm;