diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 9610934a5..8a56e872d 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -23,9 +23,10 @@ if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) endif() endif() -# Build does not work with signed chars! +# Build does not work with signed chars! Also set a stricter warning level, but silence the pointless and annoying parts of level 4 (Intentionally only for C++! The C code we use is too old and would warn too much) if (MSVC) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J /W4 /wd4100 /wd4127 /wd4131 /wd4201 /wd4210 /wd4244 /wd4245 /wd4324 /wd4389 /wd4505 /wd4706 /wd4456 /wd4457 /wd4458 /wd4459 /wd4703" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4189" ) # "unused initialized local variable" - useful warning that creates too much noise in external or macro based code. Can be enabled for cleanup passes on the code. else() set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" ) endif() diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 07bdbd68c..54f1ec8d0 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -474,7 +474,6 @@ int32_t clipmove(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_t vec2_t const clipMin = { cent.x - rad, cent.y - rad }; vec2_t const clipMax = { cent.x + rad, cent.y + rad }; - int clipshapeidx = -1; int clipsectcnt = 0; int clipspritecnt = 0; @@ -958,8 +957,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum, int32_t clipsectcnt = 0; - uspriteptr_t curspr=NULL; // non-NULL when handling sprite with sector-like clipping - int32_t curidx=-1, clipspritecnt = 0; + int32_t clipspritecnt = 0; //Extra walldist for sprites on sector lines const int32_t extradist = walldist+MAXCLIPDIST+1; @@ -1063,7 +1061,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum, while ((j = it.NextIndex()) >= 0) { const int32_t cstat = sprite[j].cstat; - int32_t daz, daz2; + int32_t daz = 0, daz2 = 0; if (sprite[j].cstat2 & CSTAT2_SPRITE_NOFIND) continue; if (cstat&dasprclipmask) @@ -1203,7 +1201,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, usectorptr_t sec, hitdata_t * int32_t vx, int32_t vy, int32_t vz, uint16_t stat, int16_t heinum, int32_t z, int32_t how, const intptr_t *tmp) { - int32_t x1 = INT32_MAX, y1, z1; + int32_t x1 = INT32_MAX, y1 = 0, z1 = 0; int32_t i; if (stat&2) @@ -1278,7 +1276,7 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32 int16_t tempshortcnt, tempshortnum; uspriteptr_t curspr = NULL; - int32_t clipspritecnt, curidx=-1; + int32_t clipspritecnt; // tmp: { (int32_t)curidx, (spritetype *)curspr, (!=0 if outer sector) } intptr_t *tmpptr=NULL; const int32_t dawalclipmask = (cliptype&65535); diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 157dc1f23..8d1ca222d 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -359,7 +359,6 @@ FGameTexture *mdloadskin(idmodel_t *m, int32_t number, int32_t pal, int32_t surf { int32_t i; mdskinmap_t *sk, *skzero = NULL; - int32_t doalloc = 1; if (m->mdnum == 2) surf = 0; @@ -1361,9 +1360,6 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) if (!tex) continue; - FGameTexture *det = nullptr, *glow = nullptr; - float detscale = 1.f; - int palid = TRANSLATION(Translation_Remap + curbasepal, globalpal); GLInterface.SetFade(sector[tspr->sectnum].floorpal); GLInterface.SetTexture(tex, palid, CLAMP_XY); diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index da370a1ce..d6281f126 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -3921,7 +3921,6 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) GLInterface.SetMatrix(Matrix_Model, mat); - int palId = TRANSLATION(Translation_Remap + curbasepal, globalpal); GLInterface.SetPalswap(globalpal); GLInterface.SetFade(sector[tspr->sectnum].floorpal); diff --git a/source/common/2d/v_2ddrawer.cpp b/source/common/2d/v_2ddrawer.cpp index 8c7ae5973..443acb293 100644 --- a/source/common/2d/v_2ddrawer.cpp +++ b/source/common/2d/v_2ddrawer.cpp @@ -749,7 +749,6 @@ void F2DDrawer::AddPoly(FGameTexture *texture, FVector2 *points, int npoints, void F2DDrawer::AddPoly(FGameTexture* img, FVector4* vt, size_t vtcount, const unsigned int* ind, size_t idxcount, int translation, PalEntry color, FRenderStyle style, int clipx1, int clipy1, int clipx2, int clipy2) { RenderCommand dg; - int method = 0; if (!img || !img->isValid()) return; @@ -835,7 +834,6 @@ void F2DDrawer::AddFlatFill(int left, int top, int right, int bottom, FGameTextu dg.mFlags = DTF_Wrap; float fs = 1.f / float(flatscale); - bool flipc = false; float sw = GetClassicFlatScalarWidth(); float sh = GetClassicFlatScalarHeight(); diff --git a/source/common/2d/v_draw.cpp b/source/common/2d/v_draw.cpp index 4a99b8cac..a82effc70 100644 --- a/source/common/2d/v_draw.cpp +++ b/source/common/2d/v_draw.cpp @@ -671,7 +671,6 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double { INTBOOL boolval; int intval; - bool translationset = false; bool fillcolorset = false; if (!fortext) diff --git a/source/common/audio/music/music.cpp b/source/common/audio/music/music.cpp index 1b36041da..76a2d4200 100644 --- a/source/common/audio/music/music.cpp +++ b/source/common/audio/music/music.cpp @@ -684,8 +684,6 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force) return true; } - int lumpnum = -1; - int length = 0; ZMusic_MusicStream handle = nullptr; MidiDeviceSetting* devp = MidiDevices.CheckKey(musicname); diff --git a/source/common/audio/sound/oalsound.cpp b/source/common/audio/sound/oalsound.cpp index 4ef36cb4d..f3c46746d 100644 --- a/source/common/audio/sound/oalsound.cpp +++ b/source/common/audio/sound/oalsound.cpp @@ -329,7 +329,6 @@ public: virtual FString GetStats() { FString stats; - size_t pos = 0, len = 0; ALfloat volume; ALint offset; ALint processed; diff --git a/source/common/audio/sound/s_environment.cpp b/source/common/audio/sound/s_environment.cpp index c5f1a5cf7..7a2dbd9a5 100644 --- a/source/common/audio/sound/s_environment.cpp +++ b/source/common/audio/sound/s_environment.cpp @@ -530,7 +530,7 @@ void S_ReadReverbDef (FScanner &sc) { const ReverbContainer *def; ReverbContainer *newenv; - REVERB_PROPERTIES props; + REVERB_PROPERTIES props = {}; char *name; int id1, id2, i, j; bool inited[NUM_REVERB_FIELDS]; diff --git a/source/common/audio/sound/s_reverbedit.cpp b/source/common/audio/sound/s_reverbedit.cpp index 398d4f2f5..9787ffa8c 100644 --- a/source/common/audio/sound/s_reverbedit.cpp +++ b/source/common/audio/sound/s_reverbedit.cpp @@ -309,7 +309,6 @@ DEFINE_ACTION_FUNCTION(DReverbEdit, GetValue) } } ACTION_RETURN_FLOAT(v); - return 1; } DEFINE_ACTION_FUNCTION(DReverbEdit, SetValue) @@ -337,14 +336,12 @@ DEFINE_ACTION_FUNCTION(DReverbEdit, SetValue) } ACTION_RETURN_FLOAT(v); - return 1; } DEFINE_ACTION_FUNCTION(DReverbEdit, GrayCheck) { PARAM_PROLOGUE; ACTION_RETURN_BOOL(CurrentEnv->Builtin); - return 1; } DEFINE_ACTION_FUNCTION(DReverbEdit, GetSelectedEnvironment) diff --git a/source/common/audio/sound/s_sound.cpp b/source/common/audio/sound/s_sound.cpp index 46119a322..315dd0438 100644 --- a/source/common/audio/sound/s_sound.cpp +++ b/source/common/audio/sound/s_sound.cpp @@ -164,7 +164,6 @@ void SoundEngine::CacheSound (sfxinfo_t *sfx) { if (GSnd && !sfx->bTentative) { - sfxinfo_t *orig = sfx; while (!sfx->bRandomHeader && sfx->link != sfxinfo_t::NO_LINK) { sfx = &S_sfx[sfx->link]; diff --git a/source/common/console/c_cvars.cpp b/source/common/console/c_cvars.cpp index 7e5bd94ba..3c987268e 100644 --- a/source/common/console/c_cvars.cpp +++ b/source/common/console/c_cvars.cpp @@ -333,6 +333,7 @@ UCVarValue FBaseCVar::FromBool (bool value, ECVarType type) break; default: + ret.Int = 0; break; } @@ -363,6 +364,7 @@ UCVarValue FBaseCVar::FromInt (int value, ECVarType type) break; default: + ret.Int = 0; break; } @@ -395,6 +397,7 @@ UCVarValue FBaseCVar::FromFloat (float value, ECVarType type) break; default: + ret.Int = 0; break; } @@ -456,6 +459,7 @@ UCVarValue FBaseCVar::FromString (const char *value, ECVarType type) break; default: + ret.Int = 0; break; } @@ -1643,7 +1647,6 @@ CCMD (archivecvar) void C_ListCVarsWithoutDescription() { FBaseCVar* var = CVars; - int count = 0; while (var) { diff --git a/source/common/console/c_dispatch.cpp b/source/common/console/c_dispatch.cpp index 004c5be3e..fe71c546d 100644 --- a/source/common/console/c_dispatch.cpp +++ b/source/common/console/c_dispatch.cpp @@ -1014,7 +1014,6 @@ void FExecList::AddPullins(TArray &wads, FConfigFile *config) const FExecList *C_ParseExecFile(const char *file, FExecList *exec) { char cmd[4096]; - int retval = 0; FileReader fr; diff --git a/source/common/cutscenes/movieplayer.cpp b/source/common/cutscenes/movieplayer.cpp index 04cf6a2ca..3788f7b20 100644 --- a/source/common/cutscenes/movieplayer.cpp +++ b/source/common/cutscenes/movieplayer.cpp @@ -805,7 +805,6 @@ DEFINE_ACTION_FUNCTION(_MoviePlayer, Frame) PARAM_SELF_STRUCT_PROLOGUE(MoviePlayer); PARAM_FLOAT(clock); ACTION_RETURN_INT(self->Frame(int64_t(clock))); - return 0; } DEFINE_ACTION_FUNCTION(_MoviePlayer, Destroy) diff --git a/source/common/cutscenes/screenjob.cpp b/source/common/cutscenes/screenjob.cpp index b14fa9398..4ac10b593 100644 --- a/source/common/cutscenes/screenjob.cpp +++ b/source/common/cutscenes/screenjob.cpp @@ -142,7 +142,6 @@ DObject* CreateRunner(bool clearbefore) void AddGenericVideo(DObject* runner, const FString& fn, int soundid, int fps) { - auto obj = runnerclass->CreateNew(); auto func = LookupFunction("ScreenJobRunner.AddGenericVideo", false); VMValue val[] = { runner, &fn, soundid, fps }; VMCall(func, val, 4, nullptr, 0); diff --git a/source/common/engine/palettecontainer.cpp b/source/common/engine/palettecontainer.cpp index 15689ed73..9648f2528 100644 --- a/source/common/engine/palettecontainer.cpp +++ b/source/common/engine/palettecontainer.cpp @@ -649,7 +649,6 @@ bool FRemapTable::AddTint(int start, int end, int r, int g, int b, int amount) bool FRemapTable::AddToTranslation(const char *range) { int start,end; - bool desaturated = false; FScanner sc; sc.OpenMem("translation", range, int(strlen(range))); diff --git a/source/common/engine/serializer.cpp b/source/common/engine/serializer.cpp index 505bd044d..a8e15e974 100644 --- a/source/common/engine/serializer.cpp +++ b/source/common/engine/serializer.cpp @@ -619,7 +619,6 @@ void FSerializer::ReadObjects(bool hubtravel) if (BeginObject(nullptr)) { FString clsname; // do not deserialize the class type directly so that we can print appropriate errors. - int pindex = -1; Serialize(*this, "classtype", clsname, nullptr); PClass *cls = PClass::FindClass(clsname); @@ -652,7 +651,6 @@ void FSerializer::ReadObjects(bool hubtravel) { if (obj != nullptr) { - int pindex = -1; try { obj->SerializeUserVars(*this); diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index 47932334d..3e7cdef79 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -218,7 +218,6 @@ void FileSystem::InitMultipleFiles (TArray &filenames, bool quiet, Lump for(unsigned i=0;i &folderdata, int width, int height LastChar = maxchar; auto count = maxchar - minchar + 1; Chars.Resize(count); - int fontheight = 0; for (int i = 0; i < count; i++) { diff --git a/source/common/fonts/v_text.cpp b/source/common/fonts/v_text.cpp index dc182f89d..e9ccb2a50 100644 --- a/source/common/fonts/v_text.cpp +++ b/source/common/fonts/v_text.cpp @@ -88,7 +88,6 @@ TArray V_BreakLines (FFont *font, int maxwidth, const uint8_t *str { if (*string == '[') { - const uint8_t* start = string; while (*string != ']' && *string != '\0') { string++; diff --git a/source/common/models/models_voxel.cpp b/source/common/models/models_voxel.cpp index 809d25400..39711bfef 100644 --- a/source/common/models/models_voxel.cpp +++ b/source/common/models/models_voxel.cpp @@ -205,7 +205,6 @@ void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3 float PivotX = mVoxel->Mips[0].Pivot.X; float PivotY = mVoxel->Mips[0].Pivot.Y; float PivotZ = mVoxel->Mips[0].Pivot.Z; - int h = mVoxel->Mips[0].SizeZ; FModelVertex vert; unsigned int indx[4]; diff --git a/source/common/platform/win32/base_sysfb.cpp b/source/common/platform/win32/base_sysfb.cpp index 9c9bb4a54..8130b8b6c 100644 --- a/source/common/platform/win32/base_sysfb.cpp +++ b/source/common/platform/win32/base_sysfb.cpp @@ -279,7 +279,7 @@ void SystemBaseFrameBuffer::PositionWindow(bool fullscreen, bool initialcall) RECT r; LONG style, exStyle; - RECT monRect; + RECT monRect = {}; if (!m_Fullscreen && fullscreen && !initialcall) SaveWindowedPos(); if (m_Monitor) diff --git a/source/common/platform/win32/i_crash.cpp b/source/common/platform/win32/i_crash.cpp index df2a6241e..82265e5c1 100644 --- a/source/common/platform/win32/i_crash.cpp +++ b/source/common/platform/win32/i_crash.cpp @@ -340,7 +340,7 @@ static HANDLE WriteMyMiniDump (void) MINIDUMP_EXCEPTION_INFORMATION exceptor = { DbgThreadID, &CrashPointers, FALSE }; WCHAR dbghelpPath[MAX_PATH+12], *bs; WRITEDUMP pMiniDumpWriteDump; - HANDLE file; + HANDLE file = INVALID_HANDLE_VALUE; BOOL good = FALSE; HMODULE dbghelp = NULL; diff --git a/source/common/platform/win32/i_dijoy.cpp b/source/common/platform/win32/i_dijoy.cpp index e4021cc10..61e7605b3 100644 --- a/source/common/platform/win32/i_dijoy.cpp +++ b/source/common/platform/win32/i_dijoy.cpp @@ -281,14 +281,6 @@ CUSTOM_CVAR(Bool, joy_dinput, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCA static const uint8_t POVButtons[9] = { 0x01, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x09, 0x00 }; -//("dc12a687-737f-11cf-884d-00aa004b2e24") -static const IID IID_IWbemLocator = { 0xdc12a687, 0x737f, 0x11cf, - { 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24 } }; - -//("4590f811-1d3a-11d0-891f-00aa004b2e24") -static const CLSID CLSID_WbemLocator = { 0x4590f811, 0x1d3a, 0x11d0, - { 0x89, 0x1f, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24 } }; - // CODE -------------------------------------------------------------------- //=========================================================================== diff --git a/source/common/platform/win32/i_input.cpp b/source/common/platform/win32/i_input.cpp index 1b49f5680..c62bbcf42 100644 --- a/source/common/platform/win32/i_input.cpp +++ b/source/common/platform/win32/i_input.cpp @@ -514,8 +514,6 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_WTSSESSION_CHANGE: case WM_POWERBROADCAST: { - int oldstate = SessionState; - if (message == WM_WTSSESSION_CHANGE && lParam == (LPARAM)SessionID) { #ifdef _DEBUG diff --git a/source/common/platform/win32/i_mouse.cpp b/source/common/platform/win32/i_mouse.cpp index 7da7e1c4b..102b1fbab 100644 --- a/source/common/platform/win32/i_mouse.cpp +++ b/source/common/platform/win32/i_mouse.cpp @@ -268,7 +268,6 @@ void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult) } else { - bool pauseState = false; bool captureModeInGame = sysCallbacks.CaptureModeInGame && sysCallbacks.CaptureModeInGame(); want_native = ((!m_use_mouse || menuactive != MENU_WaitKey) && (!captureModeInGame || GUICapture)); diff --git a/source/common/platform/win32/i_system.cpp b/source/common/platform/win32/i_system.cpp index 0ec546567..07d00b59b 100644 --- a/source/common/platform/win32/i_system.cpp +++ b/source/common/platform/win32/i_system.cpp @@ -288,8 +288,8 @@ static void DoPrintStr(const char *cpt, HWND edit, HANDLE StdOut) wchar_t wbuf[256]; int bpos = 0; - CHARRANGE selection; - CHARRANGE endselection; + CHARRANGE selection = {}; + CHARRANGE endselection = {}; LONG lines_before = 0, lines_after; CHARFORMAT format; diff --git a/source/common/platform/win32/st_start.cpp b/source/common/platform/win32/st_start.cpp index 71ff4b1cd..43e113a1b 100644 --- a/source/common/platform/win32/st_start.cpp +++ b/source/common/platform/win32/st_start.cpp @@ -113,7 +113,7 @@ CUSTOM_CVAR(Int, showendoom, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) FStartupScreen *FStartupScreen::CreateInstance(int max_progress) { FStartupScreen *scr = NULL; - HRESULT hr; + HRESULT hr = -1; if (!Args->CheckParm("-nostartup")) { diff --git a/source/common/platform/win32/st_start_util.cpp b/source/common/platform/win32/st_start_util.cpp index bfad11662..ec9da4677 100644 --- a/source/common/platform/win32/st_start_util.cpp +++ b/source/common/platform/win32/st_start_util.cpp @@ -751,9 +751,9 @@ FStrifeStartupScreen::FStrifeStartupScreen(int max_progress, long& hr) if (lumpnum >= 0 && (lumplen = fileSystem.FileLength(lumpnum)) == StrifeStartupPicSizes[i]) { - auto lumpr = fileSystem.OpenFileReader(lumpnum); + auto lumpr1 = fileSystem.OpenFileReader(lumpnum); StartupPics[i] = new uint8_t[lumplen]; - lumpr.Read(StartupPics[i], lumplen); + lumpr1.Read(StartupPics[i], lumplen); } } diff --git a/source/common/platform/win32/win32glvideo.cpp b/source/common/platform/win32/win32glvideo.cpp index 3508f07da..1d0cbae8b 100644 --- a/source/common/platform/win32/win32glvideo.cpp +++ b/source/common/platform/win32/win32glvideo.cpp @@ -423,8 +423,6 @@ bool Win32GLVideo::InitHardware(HWND Window, int multisample) } int prof = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; - const char *version = Args->CheckValue("-glversion"); - for (; prof <= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; prof++) { diff --git a/source/common/rendering/gl/gl_framebuffer.cpp b/source/common/rendering/gl/gl_framebuffer.cpp index 4e1af90b2..2ff99b511 100644 --- a/source/common/rendering/gl/gl_framebuffer.cpp +++ b/source/common/rendering/gl/gl_framebuffer.cpp @@ -326,7 +326,6 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation) { if (mat->Source()->GetUseType() == ETextureType::SWCanvas) return; - int flags = mat->GetScaleFlags(); int numLayers = mat->NumLayers(); MaterialLayerInfo* layer; auto base = static_cast(mat->GetLayer(0, translation, &layer)); diff --git a/source/common/rendering/gl/gl_hwtexture.cpp b/source/common/rendering/gl/gl_hwtexture.cpp index a23ef82cc..e2a7074bf 100644 --- a/source/common/rendering/gl/gl_hwtexture.cpp +++ b/source/common/rendering/gl/gl_hwtexture.cpp @@ -301,8 +301,6 @@ void FHardwareTexture::BindToFrameBuffer(int width, int height) bool FHardwareTexture::BindOrCreate(FTexture *tex, int texunit, int clampmode, int translation, int flags) { - int usebright = false; - bool needmipmap = (clampmode <= CLAMP_XY) && !forcenofilter; // Bind it to the system. diff --git a/source/common/rendering/gl/gl_renderbuffers.cpp b/source/common/rendering/gl/gl_renderbuffers.cpp index 08c3de3c1..88d7bce42 100644 --- a/source/common/rendering/gl/gl_renderbuffers.cpp +++ b/source/common/rendering/gl/gl_renderbuffers.cpp @@ -444,8 +444,6 @@ bool FGLRenderBuffers::CheckFrameBufferCompleteness() if (result == GL_FRAMEBUFFER_COMPLETE) return true; - bool FailedCreate = true; - if (gl_debug_level > 0) { FString error = "glCheckFramebufferStatus failed: "; diff --git a/source/common/rendering/gl/gl_renderstate.cpp b/source/common/rendering/gl/gl_renderstate.cpp index d742f35fd..04fe15ae2 100644 --- a/source/common/rendering/gl/gl_renderstate.cpp +++ b/source/common/rendering/gl/gl_renderstate.cpp @@ -318,7 +318,6 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio lastClamp = clampmode; lastTranslation = translation; - int usebright = false; int maxbound = 0; int numLayers = mat->NumLayers(); diff --git a/source/common/rendering/gles/gles_framebuffer.cpp b/source/common/rendering/gles/gles_framebuffer.cpp index 3391a6f02..70684f5f2 100644 --- a/source/common/rendering/gles/gles_framebuffer.cpp +++ b/source/common/rendering/gles/gles_framebuffer.cpp @@ -286,7 +286,6 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation) { if (mat->Source()->GetUseType() == ETextureType::SWCanvas) return; - int flags = mat->GetScaleFlags(); int numLayers = mat->NumLayers(); MaterialLayerInfo* layer; auto base = static_cast(mat->GetLayer(0, translation, &layer)); diff --git a/source/common/rendering/gles/gles_hwtexture.cpp b/source/common/rendering/gles/gles_hwtexture.cpp index a342f24c2..cd756b287 100644 --- a/source/common/rendering/gles/gles_hwtexture.cpp +++ b/source/common/rendering/gles/gles_hwtexture.cpp @@ -166,9 +166,6 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int void FHardwareTexture::AllocateBuffer(int w, int h, int texelsize) { - int rw = GetTexDimension(w); - int rh = GetTexDimension(h); - if (texelsize < 1 || texelsize > 4) texelsize = 4; glTextureBytes = texelsize; bufferpitch = w; @@ -287,8 +284,6 @@ void FHardwareTexture::BindToFrameBuffer(int width, int height) bool FHardwareTexture::BindOrCreate(FTexture *tex, int texunit, int clampmode, int translation, int flags) { - int usebright = false; - bool needmipmap = (clampmode <= CLAMP_XY) && !forcenofilter; // Bind it to the system. diff --git a/source/common/rendering/gles/gles_postprocess.cpp b/source/common/rendering/gles/gles_postprocess.cpp index bd78d294c..caf147240 100644 --- a/source/common/rendering/gles/gles_postprocess.cpp +++ b/source/common/rendering/gles/gles_postprocess.cpp @@ -161,7 +161,6 @@ void FGLRenderer::DrawPresentTexture(const IntRect &box, bool applyGamma) for (size_t n = 0; n < mPresentShader->Uniforms.mFields.size(); n++) { - int index = -1; UniformFieldDesc desc = mPresentShader->Uniforms.mFields[n]; int loc = mPresentShader->Uniforms.UniformLocation[n]; switch (desc.Type) diff --git a/source/common/rendering/gles/gles_renderbuffers.cpp b/source/common/rendering/gles/gles_renderbuffers.cpp index 1d8147ae1..4d587aa87 100644 --- a/source/common/rendering/gles/gles_renderbuffers.cpp +++ b/source/common/rendering/gles/gles_renderbuffers.cpp @@ -302,9 +302,6 @@ namespace OpenGLESRenderer if (result == GL_FRAMEBUFFER_COMPLETE) return true; - bool FailedCreate = true; - - FString error = "glCheckFramebufferStatus failed: "; switch (result) { diff --git a/source/common/rendering/gles/gles_renderer.cpp b/source/common/rendering/gles/gles_renderer.cpp index b3b79ddae..0cd4d8e5e 100644 --- a/source/common/rendering/gles/gles_renderer.cpp +++ b/source/common/rendering/gles/gles_renderer.cpp @@ -110,7 +110,6 @@ FGLRenderer::~FGLRenderer() bool FGLRenderer::StartOffscreen() { - bool firstBind = (mFBID == 0); if (mFBID == 0) glGenFramebuffers(1, &mFBID); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &mOldFBID); diff --git a/source/common/rendering/gles/gles_renderstate.cpp b/source/common/rendering/gles/gles_renderstate.cpp index 961ec8121..ca29fcd6e 100644 --- a/source/common/rendering/gles/gles_renderstate.cpp +++ b/source/common/rendering/gles/gles_renderstate.cpp @@ -458,7 +458,6 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio lastClamp = clampmode; lastTranslation = translation; - int usebright = false; int maxbound = 0; int numLayers = mat->NumLayers(); diff --git a/source/common/rendering/gles/gles_shader.cpp b/source/common/rendering/gles/gles_shader.cpp index 37a9fd7ed..54b02067d 100644 --- a/source/common/rendering/gles/gles_shader.cpp +++ b/source/common/rendering/gles/gles_shader.cpp @@ -392,7 +392,6 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * assert(screen->mLights != NULL); - bool lightbuffertype = screen->mLights->GetBufferType(); unsigned int lightbuffersize = screen->mLights->GetBlockSize(); vp_comb.Format("#version 100\n#define NUM_UBO_LIGHTS %d\n#define NO_CLIPDISTANCE_SUPPORT\n", lightbuffersize); @@ -851,7 +850,7 @@ void FShaderCollection::CompileShaders(EPassType passType) mMaterialShaders.Push(shc); if (i < SHADER_NoTexture) { - FShader *shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc, defaultshaders[i].lightfunc, defaultshaders[i].Defines, false, passType); + shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc, defaultshaders[i].lightfunc, defaultshaders[i].Defines, false, passType); mMaterialShadersNAT.Push(shc); } } diff --git a/source/common/rendering/hwrenderer/data/flatvertices.cpp b/source/common/rendering/hwrenderer/data/flatvertices.cpp index 6fe258b26..599f98793 100644 --- a/source/common/rendering/hwrenderer/data/flatvertices.cpp +++ b/source/common/rendering/hwrenderer/data/flatvertices.cpp @@ -149,7 +149,6 @@ std::pair FFlatVertexBuffer::AllocVertices(unsigned { FFlatVertex *p = GetBuffer(); auto index = mCurIndex.fetch_add(count); - auto offset = index; if (index + count >= BUFFER_SIZE_TO_USE) { // If a single scene needs 2'000'000 vertices there must be something very wrong. diff --git a/source/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp b/source/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp index 97420e0c2..f37a454fb 100644 --- a/source/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp +++ b/source/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp @@ -152,7 +152,7 @@ FString RemoveSamplerBindings(FString code, TArray> &sam char *chars = code.LockBuffer(); ptrdiff_t startIndex = 0; - ptrdiff_t startpos, endpos; + ptrdiff_t startpos, endpos = 0; while (true) { ptrdiff_t matchIndex = code.IndexOf("layout(binding", startIndex); @@ -216,7 +216,6 @@ FString RemoveSamplerBindings(FString code, TArray> &sam FString RemoveLayoutLocationDecl(FString code, const char *inoutkeyword) { - ptrdiff_t len = code.Len(); char *chars = code.LockBuffer(); ptrdiff_t startIndex = 0; diff --git a/source/common/rendering/hwrenderer/hw_draw2d.cpp b/source/common/rendering/hwrenderer/hw_draw2d.cpp index af10a7bf2..c54ba71d4 100644 --- a/source/common/rendering/hwrenderer/hw_draw2d.cpp +++ b/source/common/rendering/hwrenderer/hw_draw2d.cpp @@ -89,7 +89,6 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state) for(auto &cmd : commands) { - int gltrans = -1; state.SetRenderStyle(cmd.mRenderStyle); state.EnableBrightmap(!(cmd.mRenderStyle.Flags & STYLEF_ColorIsFixed)); state.EnableFog(2); // Special 2D mode 'fog'. diff --git a/source/common/rendering/r_videoscale.cpp b/source/common/rendering/r_videoscale.cpp index f94621e9d..c135a129b 100644 --- a/source/common/rendering/r_videoscale.cpp +++ b/source/common/rendering/r_videoscale.cpp @@ -105,7 +105,6 @@ namespace // minimum set in GZDoom 4.0.0, but only while those fonts are required. static bool lastspecialUI = false; - bool isInActualMenu = false; bool specialUI = (!sysCallbacks.IsSpecialUI || sysCallbacks.IsSpecialUI()); diff --git a/source/common/rendering/v_video.cpp b/source/common/rendering/v_video.cpp index 4a8638593..7d8075c4f 100644 --- a/source/common/rendering/v_video.cpp +++ b/source/common/rendering/v_video.cpp @@ -374,8 +374,6 @@ void V_InitScreen() void V_Init2() { - float gamma = static_cast(screen)->Gamma; - { DFrameBuffer *s = screen; screen = NULL; diff --git a/source/common/rendering/vulkan/system/vk_device.cpp b/source/common/rendering/vulkan/system/vk_device.cpp index be83d8937..add03b8e6 100644 --- a/source/common/rendering/vulkan/system/vk_device.cpp +++ b/source/common/rendering/vulkan/system/vk_device.cpp @@ -347,8 +347,6 @@ void VulkanDevice::CreateInstance() VkBool32 VulkanDevice::DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* callbackData, void* userData) { - VulkanDevice *device = (VulkanDevice*)userData; - static std::mutex mtx; static std::set seenMessages; static int totalMessages; diff --git a/source/common/rendering/vulkan/system/vk_framebuffer.cpp b/source/common/rendering/vulkan/system/vk_framebuffer.cpp index e189f4b24..ca9f1a4a6 100644 --- a/source/common/rendering/vulkan/system/vk_framebuffer.cpp +++ b/source/common/rendering/vulkan/system/vk_framebuffer.cpp @@ -421,7 +421,6 @@ IDataBuffer *VulkanFrameBuffer::CreateDataBuffer(int bindingpoint, bool ssbo, bo { auto buffer = new VKDataBuffer(bindingpoint, ssbo, needsresize); - auto fb = GetVulkanFrameBuffer(); switch (bindingpoint) { case LIGHTBUF_BINDINGPOINT: LightBufferSSO = buffer; break; diff --git a/source/common/scripting/backend/codegen.cpp b/source/common/scripting/backend/codegen.cpp index 185c79d59..baca40503 100644 --- a/source/common/scripting/backend/codegen.cpp +++ b/source/common/scripting/backend/codegen.cpp @@ -2436,7 +2436,7 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build) ExpEmit result; bool intconst = false; - int intconstval; + int intconstval = 0; if (Right->isConstant() && Right->ValueType->GetRegType() == REGT_INT) { @@ -4396,7 +4396,7 @@ ExpEmit FxBinaryLogical::Emit(VMFunctionBuilder *build) build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 1 : 0); build->Emit(OP_JMP, 1); build->BackpatchListToHere(no); - auto ctarget = build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 0 : 1); + build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 0 : 1); list.DeleteAndClear(); list.ShrinkToFit(); return to; @@ -8036,7 +8036,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) } // No need to create a dedicated node here, all builtins map directly to trivial operations. Self->ValueType = TypeSInt32; // all builtins treat the texture index as integer. - FxExpression *x; + FxExpression *x = nullptr; switch (MethodName.GetIndex()) { case NAME_IsValid: diff --git a/source/common/scripting/core/vmdisasm.cpp b/source/common/scripting/core/vmdisasm.cpp index 81f767d06..ae9078e62 100644 --- a/source/common/scripting/core/vmdisasm.cpp +++ b/source/common/scripting/core/vmdisasm.cpp @@ -265,7 +265,7 @@ void VMDumpConstants(FILE *out, const VMScriptFunction *func) void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction *func) { - VMFunction *callfunc; + VMFunction *callfunc = nullptr; const char *name; int col; int mode; @@ -665,7 +665,6 @@ static int print_reg(FILE *out, int col, int arg, int mode, int immshift, const default: return col+printf_wrapper(out, "$%d", arg); } - return col; } //========================================================================== diff --git a/source/common/scripting/vm/vmexec.h b/source/common/scripting/vm/vmexec.h index defbcdf6d..c9bd1a225 100644 --- a/source/common/scripting/vm/vmexec.h +++ b/source/common/scripting/vm/vmexec.h @@ -1302,12 +1302,10 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret) ASSERTF(a); ASSERTF(B); ASSERTKF(C); fb = reg.f[B]; fc = konstf[C]; goto Do_MODF; - NEXTOP; OP(MODF_KR): ASSERTF(a); ASSERTKF(B); ASSERTF(C); fb = konstf[B]; fc = reg.f[C]; goto Do_MODF; - NEXTOP; OP(POWF_RR): ASSERTF(a); ASSERTF(B); ASSERTF(C); @@ -1712,7 +1710,6 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret) // PrintParameters(reg.param + f->NumParam - B, B); throw; } - return 0; } static double DoFLOP(int flop, double v) diff --git a/source/common/scripting/vm/vmframe.cpp b/source/common/scripting/vm/vmframe.cpp index 1fc82549d..6cb03be43 100644 --- a/source/common/scripting/vm/vmframe.cpp +++ b/source/common/scripting/vm/vmframe.cpp @@ -694,7 +694,6 @@ void ThrowAbortException(EVMAbortException reason, const char *moreinfo, ...) va_list ap; va_start(ap, moreinfo); throw CVMAbortException(reason, moreinfo, ap); - va_end(ap); } void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException reason, const char *moreinfo, ...) @@ -706,7 +705,6 @@ void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException err.stacktrace.AppendFormat("Called from %s at %s, line %d\n", sfunc->PrintableName.GetChars(), sfunc->SourceFileName.GetChars(), sfunc->PCToLine(line)); throw err; - va_end(ap); } DEFINE_ACTION_FUNCTION(DObject, ThrowAbortException) diff --git a/source/common/statusbar/base_sbar.cpp b/source/common/statusbar/base_sbar.cpp index 1dcc27484..53d4c03b4 100644 --- a/source/common/statusbar/base_sbar.cpp +++ b/source/common/statusbar/base_sbar.cpp @@ -618,8 +618,6 @@ void DStatusBarCore::DrawRotated(FGameTexture* tex, double x, double y, int flag { double texwidth = tex->GetDisplayWidth() * scaleX; double texheight = tex->GetDisplayHeight() * scaleY; - double texleftoffs = tex->GetDisplayLeftOffset() * scaleY; - double textopoffs = tex->GetDisplayTopOffset() * scaleY; // resolve auto-alignment before making any adjustments to the position values. if (!(flags & DI_SCREEN_MANUAL_ALIGN)) diff --git a/source/common/textures/formats/jpegtexture.cpp b/source/common/textures/formats/jpegtexture.cpp index e07f4425d..89ce068e2 100644 --- a/source/common/textures/formats/jpegtexture.cpp +++ b/source/common/textures/formats/jpegtexture.cpp @@ -296,7 +296,7 @@ TArray FJPEGTexture::CreatePalettedPixels(int conversion) while (cinfo.output_scanline < cinfo.output_height) { - int num_scanlines = jpeg_read_scanlines(&cinfo, &buff, 1); + jpeg_read_scanlines(&cinfo, &buff, 1); uint8_t *in = buff; uint8_t *out = Pixels.Data() + y; switch (cinfo.out_color_space) diff --git a/source/common/textures/formats/pcxtexture.cpp b/source/common/textures/formats/pcxtexture.cpp index 89d05e427..32183155a 100644 --- a/source/common/textures/formats/pcxtexture.cpp +++ b/source/common/textures/formats/pcxtexture.cpp @@ -383,7 +383,7 @@ TArray FPCXTexture::CreatePalettedPixels(int conversion) else if (bitcount == 8) { lump.Seek(-769, FileReader::SeekEnd); - uint8_t c = lump.ReadUInt8(); + lump.ReadUInt8(); //if (c !=0x0c) memcpy(PaletteMap, GrayMap, 256); // Fallback for files without palette //else for(int i=0;i<256;i++) diff --git a/source/common/textures/image.cpp b/source/common/textures/image.cpp index 73d6f5227..df48a79f1 100644 --- a/source/common/textures/image.cpp +++ b/source/common/textures/image.cpp @@ -85,7 +85,6 @@ PalettedPixels FImageSource::GetCachedPalettedPixels(int conversion) FString name; fileSystem.GetFileShortName(name, SourceLump); - std::pair *info = nullptr; auto imageID = ImageID; // Do we have this image in the cache? @@ -201,7 +200,6 @@ FBitmap FImageSource::GetCachedBitmap(const PalEntry *remap, int conversion, int int trans = -1; fileSystem.GetFileShortName(name, SourceLump); - std::pair *info = nullptr; auto imageID = ImageID; if (remap != nullptr) diff --git a/source/common/textures/multipatchtexturebuilder.cpp b/source/common/textures/multipatchtexturebuilder.cpp index 6a49d87ae..95b586227 100644 --- a/source/common/textures/multipatchtexturebuilder.cpp +++ b/source/common/textures/multipatchtexturebuilder.cpp @@ -853,7 +853,6 @@ void FMultipatchTextureBuilder::ResolveAllPatches() ResolvePatches(bi); } // Now try to resolve the images. We only can do this at the end when all multipatch textures are set up. - int i = 0; // reverse the list so that the Delete operation in the loop below deletes at the end. // For normal sized lists this is of no real concern, but Total Chaos has over 250000 textures where this becomes a performance issue. diff --git a/source/common/textures/texturemanager.cpp b/source/common/textures/texturemanager.cpp index 65e267b84..2f1d02fa7 100644 --- a/source/common/textures/texturemanager.cpp +++ b/source/common/textures/texturemanager.cpp @@ -717,7 +717,7 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build sc.String[8]=0; tlist.Clear(); - int amount = ListTextures(sc.String, tlist); + ListTextures(sc.String, tlist); FName texname = sc.String; sc.MustGetString(); @@ -919,7 +919,6 @@ void FTextureManager::LoadTextureX(int wadnum, FMultipatchTextureBuilder &build) void FTextureManager::AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &build) { int firsttexture = Textures.Size(); - int lumpcount = fileSystem.GetNumEntries(); bool iwad = wadnum >= fileSystem.GetIwadNum() && wadnum <= fileSystem.GetMaxIwadNum(); FirstTextureForFile.Push(firsttexture); diff --git a/source/common/thirdparty/strnatcmp.c b/source/common/thirdparty/strnatcmp.c index 58fa5571a..8caadfbd7 100644 --- a/source/common/thirdparty/strnatcmp.c +++ b/source/common/thirdparty/strnatcmp.c @@ -85,8 +85,6 @@ compare_right(nat_char const *a, nat_char const *b) } else if (!*a && !*b) return bias; } - - return 0; } @@ -107,8 +105,6 @@ compare_left(nat_char const *a, nat_char const *b) else if (*a > *b) return +1; } - - return 0; } diff --git a/source/common/utility/palette.cpp b/source/common/utility/palette.cpp index 28115a521..5f4ee767a 100644 --- a/source/common/utility/palette.cpp +++ b/source/common/utility/palette.cpp @@ -903,7 +903,6 @@ int ReadPalette(int lumpnum, uint8_t* buffer) fr.Seek(33, FileReader::SeekSet); fr.Read(&len, 4); fr.Read(&id, 4); - bool succeeded = false; while (id != MAKE_ID('I', 'D', 'A', 'T') && id != MAKE_ID('I', 'E', 'N', 'D')) { len = BigLong((unsigned int)len); diff --git a/source/common/utility/utf8.cpp b/source/common/utility/utf8.cpp index b0b225ae5..f8e7119d4 100644 --- a/source/common/utility/utf8.cpp +++ b/source/common/utility/utf8.cpp @@ -428,7 +428,6 @@ int getAlternative(int code) case 0x457: return 0xef; case 0x458: return 'j'; } - return code; } //========================================================================== diff --git a/source/common/utility/zstrformat.cpp b/source/common/utility/zstrformat.cpp index bf61ce282..0d8bcfbc2 100644 --- a/source/common/utility/zstrformat.cpp +++ b/source/common/utility/zstrformat.cpp @@ -318,9 +318,9 @@ namespace StringFormat */ const char *decimal_point = ".";/* locale specific decimal point */ int signflag; /* true if float is negative */ - int expt; /* integer value of exponent */ + int expt = 0; /* integer value of exponent */ char expchar = 'e'; /* exponent character: [eEpP\0] */ - char *dtoaend; /* pointer to end of converted digits */ + char* dtoaend = nullptr; /* pointer to end of converted digits */ int expsize = 0; /* character count for expstr */ int ndig = 0; /* actual number of digits returned by dtoa */ char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 8f3f2e0f2..fd387ed11 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -680,15 +680,12 @@ void DrawOverheadMap(int pl_x, int pl_y, int pl_angle, double const smoothratio) int y = follow_y; follow_a = am_rotate ? pl_angle : 0; AutomapControl(); - int width = screen->GetWidth(); if (automapMode == am_full) { twod->ClearScreen(); renderDrawMapView(x, y, gZoom, follow_a); } - int32_t tmpydim = (width * 5) / 8; - drawredlines(x, y, gZoom, follow_a); drawwhitelines(x, y, gZoom, follow_a); if (!gi->DrawAutomapPlayer(x, y, gZoom, follow_a, smoothratio)) diff --git a/source/core/defparser.cpp b/source/core/defparser.cpp index f15603dfb..8bd685214 100644 --- a/source/core/defparser.cpp +++ b/source/core/defparser.cpp @@ -318,7 +318,7 @@ void parseCopyTile(FScanner& sc, FScriptPosition& pos) FScanner::SavedPos blockend; int tile = -1, source = -1; int havetile = 0, xoffset = -1024, yoffset = -1024; - int flags = 0, tsiz = 0, temppal = -1, tempsource = -1; + int flags = 0, temppal = -1, tempsource = -1; if (!sc.GetNumber(tile, true)) return; @@ -1953,7 +1953,7 @@ void parseModel(FScanner& sc, FScriptPosition& pos) FString modelfn; double scale = 1.0, mzadd = 0.0, myoffset = 0.0; - int32_t shadeoffs = 0, pal = 0, flags = 0; + int32_t shadeoffs = 0, flags = 0; FixedBitArray<1024> usedframes; usedframes.Zero(); diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index 509e6f6a7..ae57adbe1 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -697,7 +697,6 @@ CCMD(mapinfo) int lump = fileSystem.FindFile(map->fileName); if (lump >= 0) { - int rfnum = fileSystem.GetFileContainer(lump); Printf("map %s \"%s\"\n{\n", map->labelName.GetChars(), map->DisplayName()); Printf("\tlevelnum = %d\n\tCluster = %d\n", map->levelNumber, map->cluster); if (map->Author.IsNotEmpty()) @@ -1049,9 +1048,6 @@ void FMapInfoParser::ParseCutsceneInfo() FString map; FString pic; FString name; - bool remove = false; - char key = 0; - int flags = 0; ParseOpenBrace(); @@ -1107,9 +1103,6 @@ void FMapInfoParser::ParseGameInfo() FString map; FString pic; FString name; - bool remove = false; - char key = 0; - int flags = 0; ParseOpenBrace(); @@ -1302,10 +1295,6 @@ void G_ParseMapInfo () int lump, lastlump = 0; MapRecord gamedefaults; - // first parse the internal one which sets up the needed basics and patches the legacy definitions of each game. - FMapInfoParser parse; - MapRecord defaultinfo; - // Parse internal RMAPINFOs. while ((lump = fileSystem.FindLumpFullName("engine/rmapinfo.txt", &lastlump, false)) != -1) { diff --git a/source/core/gameconfigfile.cpp b/source/core/gameconfigfile.cpp index 9be33eecf..5e9e9a324 100644 --- a/source/core/gameconfigfile.cpp +++ b/source/core/gameconfigfile.cpp @@ -326,7 +326,6 @@ void FGameConfigFile::DoGameSetup (const char *gamename) strncpy (subsection, "ConsoleAliases", sublen); if (SetSection (section)) { - const char *name = NULL; while (NextInSection (key, value)) { FStringf cmd("alias %s \"%s\"", key, value); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 94137dac7..68ee8ce14 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1029,7 +1029,6 @@ int RunGame() palindexmap[0] = 255; for (int i = 1; i <= 255; i++) palindexmap[i] = i; GPalette.Init(MAXPALOOKUPS + 2, palindexmap); // one slot for each translation, plus a separate one for the base palettes and the internal one - int v = ColorMatcher.Pick(0, 0, 0); gi->loadPalette(); StartScreen->Progress(); InitTextures(); @@ -1396,7 +1395,6 @@ CVAR(Int, crosshair, 0, CVAR_ARCHIVE) void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, PalEntry color) { - int type = -1; if (automapMode == am_off && cl_crosshair) { if (deftile < MAXTILES && crosshair == 0) diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index a12050e03..5031d779d 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -134,7 +134,6 @@ inline void copyfloorpal(spritetype* spr, const sectortype* sect) inline void spriteSetSlope(spritetype* spr, int heinum) { - int cstat = spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK; if (spr->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) { spr->xoffset = heinum & 255; diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index 063ae0f00..cc4c7bd5d 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -413,14 +413,13 @@ static void BuildEpisodeMenu() double y = ld->mYpos; // Volume definitions should be sorted by intended menu order. - auto font = PickSmallFont(); for (auto &vol : volumes) { if (vol.name.IsNotEmpty() && !(vol.flags & VF_HIDEFROMSP)) { - int isShareware = ((g_gameType & GAMEFLAG_DUKE) && (g_gameType & GAMEFLAG_SHAREWARE) && (vol.flags & VF_SHAREWARELOCK)); + bool isShareware = ((g_gameType & GAMEFLAG_DUKE) && (g_gameType & GAMEFLAG_SHAREWARE) && (vol.flags & VF_SHAREWARELOCK)); auto it = CreateCustomListMenuItemText(ld->mXpos, y, ld->mLinespacing, vol.name[0], - vol.name, ld->mFont, CR_UNTRANSLATED, isShareware, NAME_Skillmenu, vol.index); // font colors are not used, so hijack one for the shareware flag. + vol.name, ld->mFont, CR_UNTRANSLATED, int(isShareware), NAME_Skillmenu, vol.index); // font colors are not used, so hijack one for the shareware flag. y += ld->mLinespacing; ld->mItems.Push(it); diff --git a/source/core/palette.cpp b/source/core/palette.cpp index 43f5df8c5..676c164a4 100644 --- a/source/core/palette.cpp +++ b/source/core/palette.cpp @@ -251,7 +251,6 @@ void LookupTableInfo::postLoadLookups() { int numpalettes = GPalette.NumTranslations(Translation_BasePalettes); if (numpalettes == 0) return; - auto basepalette = GPalette.GetTranslation(Translation_BasePalettes, 0); for (int i = 0; i < numpalettes; i++) { diff --git a/source/core/rendering/hw_entrypoint.cpp b/source/core/rendering/hw_entrypoint.cpp index e07bd2c75..27bffd990 100644 --- a/source/core/rendering/hw_entrypoint.cpp +++ b/source/core/rendering/hw_entrypoint.cpp @@ -246,7 +246,7 @@ void WriteSavePic(FileWriter* file, int width, int height) savefile = file; savewidth = width; saveheight = height; - bool didit = gi->GenerateSavePic(); + /*bool didit =*/ gi->GenerateSavePic(); writingsavepic = false; xdim = oldx; ydim = oldy; diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 848e6fa08..e225515e4 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -487,7 +487,6 @@ void HWDrawInfo::CreateScene(bool portal) void HWDrawInfo::RenderScene(FRenderState &state) { - const auto &vp = Viewpoint; RenderAll.Clock(); state.SetDepthMask(true); @@ -675,7 +674,6 @@ void HWDrawInfo::DrawScene(int drawmode, bool portal) { static int recursion = 0; static int ssao_portals_available = 0; - const auto& vp = Viewpoint; bool applySSAO = false; if (drawmode == DM_MAINVIEW) diff --git a/source/core/rendering/scene/hw_portal.cpp b/source/core/rendering/scene/hw_portal.cpp index 30f522958..4151780b4 100644 --- a/source/core/rendering/scene/hw_portal.cpp +++ b/source/core/rendering/scene/hw_portal.cpp @@ -317,8 +317,6 @@ void HWPortal::RemoveStencil(HWDrawInfo *di, FRenderState &state, bool usestenci bool needdepth = NeedDepthBuffer(); // Restore the old view - auto &vp = di->Viewpoint; - //if (vp.camera != nullptr) vp.camera->renderflags = (vp.camera->renderflags & ~RF_MAYBEINVISIBLE) | savedvisibility; if (usestencil) { diff --git a/source/core/rendering/scene/hw_skyportal.cpp b/source/core/rendering/scene/hw_skyportal.cpp index 457b97fe1..7dba7139a 100644 --- a/source/core/rendering/scene/hw_skyportal.cpp +++ b/source/core/rendering/scene/hw_skyportal.cpp @@ -37,8 +37,6 @@ void HWSkyPortal::DrawContents(HWDrawInfo *di, FRenderState &state) { int indexed = hw_int_useindexedcolortextures; hw_int_useindexedcolortextures = false; // this code does not work with indexed textures. - bool drawBoth = false; - auto &vp = di->Viewpoint; if (di->isSoftwareLighting()) { @@ -64,7 +62,6 @@ void HWSkyPortal::DrawContents(HWDrawInfo *di, FRenderState &state) else if (!origin->cloudy) { auto tex = origin->texture; - float texw = tex->GetDisplayWidth(); float texh = tex->GetDisplayHeight(); auto& modelMatrix = state.mModelMatrix; auto& textureMatrix = state.mTextureMatrix; diff --git a/source/core/rendering/scene/hw_sprites.cpp b/source/core/rendering/scene/hw_sprites.cpp index d9223194e..ee9882455 100644 --- a/source/core/rendering/scene/hw_sprites.cpp +++ b/source/core/rendering/scene/hw_sprites.cpp @@ -56,7 +56,6 @@ void HWSprite::DrawSprite(HWDrawInfo* di, FRenderState& state, bool translucent) { bool additivefog = false; bool foglayer = false; - auto& vp = di->Viewpoint; if (translucent) { diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index c6c9bf282..a201ddb57 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -1052,8 +1052,6 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec PlanesAtPoint(backsector, wal->x, wal->y, &bch1, &bfh1); PlanesAtPoint(backsector, p2wall->x, p2wall->y, &bch2, &bfh2); - float zalign = 0.f; - SkyTop(di, wal, frontsector, backsector, v1, v2, fch1, fch2); SkyBottom(di, wal, frontsector, backsector, v1, v2, ffh1, ffh2); diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index e29d47dd0..c29e1f739 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -157,7 +157,7 @@ void G_AddExternalSearchPaths(TArray &searchpaths) FString path; for (int i = 0; entry.subpaths[i]; i++) { - path.Format("%s%s", buf, entry.subpaths[i]); + path.Format("%s%s", buf.GetChars(), entry.subpaths[i]); AddSearchPath(searchpaths, path); } } diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 4248d2091..4045f2a8b 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -295,7 +295,7 @@ bool SectorGeometry::MakeVertices(unsigned int secnum, int plane, const FVector2 { for (auto& pt : polygon[a]) { - float planez; + float planez = 0; PlanesAtPoint(sectorp, (pt.first * 16), (pt.second * -16), plane ? &planez : nullptr, !plane ? &planez : nullptr); FVector3 point = { pt.first, pt.second, planez }; points[p++] = point; @@ -523,7 +523,7 @@ nexti:; { auto& pt = entry.vertices[i]; - float planez; + float planez = 0; PlanesAtPoint(sectorp, (pt.X * 16), (pt.Y * -16), plane ? &planez : nullptr, !plane ? &planez : nullptr); entry.vertices[i].Z = planez; entry.texcoords[i] = uvcalc.GetUV(int(pt.X * 16.), int(pt.Y * -16.), pt.Z); diff --git a/source/core/statusbar2.cpp b/source/core/statusbar2.cpp index 038dc6aaf..db94857c1 100644 --- a/source/core/statusbar2.cpp +++ b/source/core/statusbar2.cpp @@ -109,7 +109,6 @@ void setViewport(int viewSize) reserved.top = xs_CRoundToInt((reserved.top * hud_scalefactor * ydim) / 200); reserved.statusbar = xs_CRoundToInt((reserved.statusbar * hud_scalefactor * ydim) / 200); - int xdimcorrect = min(Scale(ydim, 4, 3), xdim); if (viewSize > Hud_Stbar) { x0 = 0; diff --git a/source/core/textures/hightile.cpp b/source/core/textures/hightile.cpp index 5ccef8957..ca16a9d5d 100644 --- a/source/core/textures/hightile.cpp +++ b/source/core/textures/hightile.cpp @@ -411,7 +411,6 @@ bool PreBindTexture(FRenderState* state, FGameTexture*& tex, EUpscaleFlags& flag bool foggy = state && (state->GetFogColor() & 0xffffff); if (PickTexture(tex, translation, pick, hw_int_useindexedcolortextures && !foggy)) { - int TextureType = (pick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR; int lookuppal = pick.translation & 0x7fffffff; if (pick.translation & 0x80000000) diff --git a/source/games/blood/src/_polymost.cpp b/source/games/blood/src/_polymost.cpp index 8e8cff67d..ca354a7d6 100644 --- a/source/games/blood/src/_polymost.cpp +++ b/source/games/blood/src/_polymost.cpp @@ -124,8 +124,6 @@ void processSpritesOnOtherSideOfPortal(int x, int y, int interpolation) void render3DViewPolymost(int nSectnum, int cX, int cY, int cZ, binangle cA, fixedhoriz cH) { - int yxAspect = yxaspect; - int viewingRange = viewingrange; videoSetCorrectedAspect(); int v1 = xs_CRoundToInt(double(viewingrange) * tan(r_fov * (pi::pi() / 360.))); @@ -252,7 +250,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int { renderPrepareMirror(x, y, z, a, horiz, nWall, &cx, &cy, &ca); } - int32_t didmirror = renderDrawRoomsQ16(cx, cy, z, ca, horiz, mirrorsector, true); + renderDrawRoomsQ16(cx, cy, z, ca, horiz, mirrorsector, true); viewProcessSprites(pm_tsprite, pm_spritesortcnt, cx, cy, z, FixedToInt(ca), smooth); renderDrawMasks(); if (GetWallType(nWall) != kWallStack) @@ -267,7 +265,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int { r_rorphase = 1; int nSector = mirror[i].link; - int bakCstat; + int bakCstat = 0; if (viewPlayer >= 0) { bakCstat = gPlayer[viewPlayer].pSprite->cstat; @@ -299,7 +297,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int { r_rorphase = 1; int nSector = mirror[i].link; - int bakCstat; + int bakCstat = 0; if (viewPlayer >= 0) { bakCstat = gPlayer[viewPlayer].pSprite->cstat; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index fa949f7f2..bf99b99c7 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2437,7 +2437,6 @@ static void actInitDudes() BloodStatIterator it(kStatDude); while (auto act = it.Next()) { - spritetype* pSprite = &act->s(); if (act->hasX() && act->x().key > 0) // Drop Key actDropObject(act, kItemKeyBase + (act->x().key - 1)); DeleteSprite(act); @@ -2852,7 +2851,6 @@ static DBloodActor* actDropKey(DBloodActor* actor, int nType) if (act2 && gGameOptions.nGameType == 1) { act2->addX(); - auto pSprite2 = &act2->s(); act2->x().respawn = 3; act2->hit.florhit = 0; act2->hit.ceilhit = 0; @@ -3334,7 +3332,6 @@ static void burningCultistDeath(DBloodActor* actor, int nSeq) static void modernCustomDudeDeath(DBloodActor* actor, int nSeq, int damageType) { - auto pSprite = &actor->s(); auto pXSprite = &actor->x(); playGenDudeSound(actor, kGenDudeSndDeathNormal); @@ -3363,8 +3360,6 @@ static void modernCustomDudeDeath(DBloodActor* actor, int nSeq, int damageType) static void modernCustomDudeBurningDeath(DBloodActor* actor, int nSeq) { - auto pSprite = &actor->s(); - playGenDudeSound(actor, kGenDudeSndDeathExplode); int dudeToGib = (actCheckRespawn(actor)) ? -1 : nDudeToGibClient1; @@ -3436,7 +3431,6 @@ static void zombieButcherDeath(DBloodActor* actor, int nSeq) static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum) { - auto pSprite = &actor->s(); if (Chance(0x4000) && nSeq == 3) sfxPlay3DSound(actor, sound1 + 2, -1, 0); else sfxPlay3DSound(actor, sound1 + Random(2), -1, 0); seqSpawn(seqnum, actor, -1); @@ -3450,11 +3444,9 @@ static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum) void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damageType, int damage) { - spritetype* pKillerSprite = &killerActor->s(); auto pSprite = &actor->s(); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax&& actor->hasX()); int nType = pSprite->type - kDudeBase; - XSPRITE* pXSprite = &actor->x(); if (actKillDudeStage1(actor, damageType)) return; @@ -4406,7 +4398,6 @@ static void checkHit(DBloodActor* actor) static void checkFloorHit(DBloodActor* actor) { auto pSprite = &actor->s(); - auto pXSprite = actor->hasX() ? &actor->x() : nullptr; Collision coll(actor->hit.florhit); switch (coll.type) @@ -4626,7 +4617,6 @@ static Collision MoveThing(DBloodActor* actor) { auto pSprite = &actor->s(); assert(actor->hasX()); - XSPRITE* pXSprite = &actor->x(); assert(pSprite->type >= kThingBase && pSprite->type < kThingMax); const THINGINFO* pThingInfo = &thingInfo[pSprite->type - kThingBase]; int nSector = pSprite->sectnum; @@ -5330,7 +5320,6 @@ void MoveDude(DBloodActor* actor) int MoveMissile(DBloodActor* actor) { auto pSprite = &actor->s(); - auto pXSprite = &actor->x(); auto Owner = actor->GetOwner(); int cliptype = -1; int bakCstat = 0; @@ -5358,8 +5347,6 @@ int MoveMissile(DBloodActor* actor) RotatePoint(&vx, &vy, (nTargetAngle + 1536) & 2047, 0, 0); actor->xvel = vx; actor->yvel = vy; - int dx = pTarget->x - pSprite->x; - int dy = pTarget->y - pSprite->y; int dz = pTarget->z - pSprite->z; int deltaz = dz / 10; @@ -7336,7 +7323,6 @@ void actPostProcess(void) void MakeSplash(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); pSprite->flags &= ~2; pSprite->z -= 4 << 8; diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 365269fe2..d0fa727da 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -1527,7 +1527,6 @@ void RecoilDude(DBloodActor* actor) void aiThinkTarget(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index 46587edc9..b071ce97b 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -64,7 +64,6 @@ AISTATE batDodgeDownLeft = { kAiStateMove, 6, -1, 90, NULL, batMoveDodgeDown, 0, void batBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); @@ -135,7 +134,6 @@ static void batThinkTarget(DBloodActor* actor) static void batThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); batThinkTarget(actor); } @@ -158,7 +156,6 @@ static void batThinkGoto(DBloodActor* actor) static void batThinkPonder(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -266,7 +263,6 @@ static void batMoveDodgeDown(DBloodActor* actor) static void batThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index a49ac0c81..c5f51bb13 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -65,7 +65,6 @@ AISTATE beast138FEC = { kAiStateOther, 9, -1, 120, NULL, aiMoveTurn, NULL, &beas void SlashSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); @@ -84,7 +83,6 @@ void SlashSeqCallback(int, DBloodActor* actor) void StompSeqCallback(int, DBloodActor* actor1) { uint8_t sectmap[(kMaxSectors + 7) >> 3]; - XSPRITE* pXSprite = &actor1->x(); spritetype* pSprite = &actor1->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -176,7 +174,6 @@ void StompSeqCallback(int, DBloodActor* actor1) static void MorphToBeast(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); actHealDude(actor, dudeInfo[51].startHealth, dudeInfo[51].startHealth); pSprite->type = kDudeBeast; @@ -185,7 +182,6 @@ static void MorphToBeast(DBloodActor* actor) static void beastThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -219,7 +215,6 @@ static void beastThinkGoto(DBloodActor* actor) static void beastThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -398,7 +393,6 @@ static void beastThinkSwimGoto(DBloodActor* actor) static void beastThinkSwimChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 6508d102c..6308e5318 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -63,7 +63,6 @@ AISTATE eelDodgeDownLeft = { kAiStateMove, 0, -1, 90, NULL, eelMoveDodgeDown, NU void eelBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); /* @@ -149,7 +148,6 @@ static void eelThinkTarget(DBloodActor* actor) static void eelThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); eelThinkTarget(actor); } @@ -172,7 +170,6 @@ static void eelThinkGoto(DBloodActor* actor) static void eelThinkPonder(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -279,7 +276,6 @@ static void eelMoveDodgeDown(DBloodActor* actor) static void eelThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aiburn.cpp b/source/games/blood/src/aiburn.cpp index 5c9be4644..2fe1bb08d 100644 --- a/source/games/blood/src/aiburn.cpp +++ b/source/games/blood/src/aiburn.cpp @@ -78,7 +78,6 @@ void BurnSeqCallback(int, DBloodActor*) static void burnThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -128,7 +127,6 @@ static void burnThinkGoto(DBloodActor* actor) static void burnThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index d86a6ab85..a077a0ee7 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -85,7 +85,6 @@ void SeqAttackCallback(int, DBloodActor* actor) static void calebThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -119,7 +118,6 @@ static void calebThinkGoto(DBloodActor* actor) static void calebThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -263,7 +261,6 @@ static void calebThinkSwimGoto(DBloodActor* actor) static void calebThinkSwimChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 614336486..4020a77c7 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -58,7 +58,6 @@ AISTATE cerberus1398AC = { kAiStateOther, 7, -1, 120, NULL, aiMoveTurn, NULL, &c void cerberusBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -77,7 +76,6 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor) void cerberusBurnSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); int height = pDudeInfo->eyeHeight * pSprite->yrepeat; @@ -155,7 +153,6 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor) void cerberusBurnSeqCallback2(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); @@ -238,7 +235,6 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor) static void cerberusThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -336,7 +332,6 @@ static void cerberusThinkGoto(DBloodActor* actor) static void cerberusThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { switch (pSprite->type) { diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 0f64d2ab3..4354b4ee3 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -75,7 +75,6 @@ AISTATE cultistSwimRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &culti void TommySeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -89,7 +88,6 @@ void TommySeqCallback(int, DBloodActor* actor) void TeslaSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (Chance(dword_138BB0[gGameOptions.nDifficulty])) { @@ -106,7 +104,6 @@ void TeslaSeqCallback(int, DBloodActor* actor) void ShotSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -129,7 +126,6 @@ void ShotSeqCallback(int, DBloodActor* actor) void cultThrowSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) @@ -155,8 +151,6 @@ void cultThrowSeqCallback(int, DBloodActor* actor) void sub_68170(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); - spritetype* pSprite = &actor->s(); int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) nMissile = kThingArmedTNTBundle; @@ -167,7 +161,6 @@ void sub_68170(int, DBloodActor* actor) void sub_68230(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int nMissile = kThingArmedTNTStick; if (gGameOptions.nDifficulty > 2) diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index ea9743555..ac617cbe1 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -72,14 +72,12 @@ AISTATE statueFBreakSEQ = { kAiStateOther, 5, -1, 0, entryFStatue, NULL, playSta AISTATE statueSBreakSEQ = { kAiStateOther, 5, -1, 0, entrySStatue, NULL, playStatueBreakSnd, &gargoyleSMorph2 }; static void playStatueBreakSnd(DBloodActor* actor) { - auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); + aiPlay3DSound(actor, 313, AI_SFX_PRIORITY_1, -1); } void SlashFSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); @@ -101,8 +99,6 @@ void SlashFSeqCallback(int, DBloodActor* actor) void ThrowFSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); - spritetype* pSprite = &actor->s(); actFireThing(actor, 0, 0, actor->dudeSlope - 7500, kThingBone, 0xeeeee); } @@ -114,8 +110,6 @@ void BlastSSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); int height = (pSprite->yrepeat * getDudeInfo(pSprite->type)->eyeHeight) << 2; - int dx = pXSprite->targetX - pSprite->x; - int dy = pXSprite->targetY - pSprite->y; int x = pSprite->x; int y = pSprite->y; int z = height; @@ -353,7 +347,6 @@ static void gargMoveDodgeDown(DBloodActor* actor) static void gargThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 340126472..9a2fac78b 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -63,7 +63,6 @@ AISTATE ghostDodgeDownLeft = { kAiStateMove, 0, -1, 90, NULL, ghostMoveDodgeDown void ghostSlashSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); @@ -97,8 +96,6 @@ void ghostBlastSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); int height = (pSprite->yrepeat * getDudeInfo(pSprite->type)->eyeHeight) << 2; - int dx = pXSprite->targetX - pSprite->x; - int dy = pXSprite->targetY - pSprite->y; int x = pSprite->x; int y = pSprite->y; int z = height; @@ -243,7 +240,6 @@ static void ghostThinkTarget(DBloodActor* actor) static void ghostThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index 78349562f..49fb98fe4 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -60,7 +60,6 @@ AISTATE gillBeast13A170 = { kAiStateOther, 10, -1, 120, NULL, NULL, aiMoveTurn, void GillBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); @@ -77,7 +76,6 @@ void GillBiteSeqCallback(int, DBloodActor* actor) static void gillThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -111,7 +109,6 @@ static void gillThinkGoto(DBloodActor* actor) static void gillThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -252,7 +249,6 @@ static void gillThinkSwimGoto(DBloodActor* actor) static void gillThinkSwimChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aihand.cpp b/source/games/blood/src/aihand.cpp index bc8f372d9..ccae00ce1 100644 --- a/source/games/blood/src/aihand.cpp +++ b/source/games/blood/src/aihand.cpp @@ -44,8 +44,6 @@ AISTATE handJump = { kAiStateChase, 7, nJumpClient, 120, NULL, NULL, NULL, &hand void HandJumpSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); - spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; spritetype* pTarget = &actor->GetTarget()->s(); if (IsPlayerSprite(pTarget)) @@ -62,7 +60,6 @@ void HandJumpSeqCallback(int, DBloodActor* actor) static void handThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -85,7 +82,6 @@ static void handThinkGoto(DBloodActor* actor) static void handThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aihound.cpp b/source/games/blood/src/aihound.cpp index a1e4fa351..c0bf64978 100644 --- a/source/games/blood/src/aihound.cpp +++ b/source/games/blood/src/aihound.cpp @@ -45,7 +45,6 @@ AISTATE houndBurn = { kAiStateChase, 7, nHoundBurnClient, 60, NULL, NULL, NULL, void houndBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -75,7 +74,6 @@ void houndBurnSeqCallback(int, DBloodActor* actor) static void houndThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -103,7 +101,6 @@ static void houndThinkGoto(DBloodActor* actor) static void houndThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index 722c1b30f..494666e29 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -63,7 +63,6 @@ void sub_6FF54(int, DBloodActor* actor) void podAttack(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -133,7 +132,6 @@ void sub_70284(int, DBloodActor* actor) static void aiPodSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -171,7 +169,6 @@ static void aiPodMove(DBloodActor* actor) static void aiPodChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { switch (pSprite->type) { diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index bff2dd4a5..af907c6c4 100644 --- a/source/games/blood/src/airat.cpp +++ b/source/games/blood/src/airat.cpp @@ -44,7 +44,6 @@ AISTATE ratBite = { kAiStateChase, 6, nRatBiteClient, 120, NULL, NULL, NULL, &ra void ratBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -58,7 +57,6 @@ void ratBiteSeqCallback(int, DBloodActor* actor) static void ratThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -81,7 +79,6 @@ static void ratThinkGoto(DBloodActor* actor) static void ratThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index 8eee77648..dc9ba2235 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -63,7 +63,6 @@ static char spidBlindEffect(DBloodActor* dudeactor, int nBlind, int max) void SpidBiteSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -75,7 +74,6 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) auto const target = actor->GetTarget(); spritetype* pTarget = &target->s(); - XSPRITE* pXTarget = &target->x(); if (IsPlayerSprite(pTarget)) { int hit = HitScan(actor, pSprite->z, dx, dy, 0, CLIPMASK1, 0); @@ -115,7 +113,6 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) void SpidJumpSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); int dx = bcos(pSprite->ang); int dy = bsin(pSprite->ang); @@ -176,7 +173,6 @@ void SpidBirthSeqCallback(int, DBloodActor* actor) static void spidThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -199,7 +195,6 @@ static void spidThinkGoto(DBloodActor* actor) static void spidThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 82b00280b..4124162b2 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -48,8 +48,6 @@ AISTATE tcherno13AA28 = { kAiStateChase, 8, -1, 60, NULL, aiMoveTurn, NULL, &tch void sub_71A90(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); - spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); if (target->x().burnTime == 0) @@ -61,7 +59,6 @@ void sub_71A90(int, DBloodActor* actor) void sub_71BD4(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); int height = pSprite->yrepeat * pDudeInfo->eyeHeight; @@ -131,7 +128,6 @@ void sub_71BD4(int, DBloodActor* actor) void sub_720AC(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -207,7 +203,6 @@ void sub_720AC(int, DBloodActor* actor) static void sub_72580(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -293,7 +288,6 @@ static void sub_72850(DBloodActor* actor) static void sub_72934(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index bd82283b6..d40631029 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -119,8 +119,6 @@ short gCustomDudeDebrisPics[6] = { static void forcePunch(DBloodActor* actor) { - auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); if (actor->genDudeExtra.forcePunch && seqGetStatus(actor) == -1) punchCallback(0, actor); } @@ -139,7 +137,6 @@ static void forcePunch(DBloodActor* actor) static bool genDudeAdjustSlope(DBloodActor* actor, int dist, int weaponType, int by = 64) { spritetype* pSprite = &actor->s(); - XSPRITE* pXSprite = &actor->x(); if (actor->GetTarget() != nullptr) { int fStart = 0; @@ -198,7 +195,6 @@ void genDudeUpdate(DBloodActor* actor) void punchCallback(int, DBloodActor* actor) { - auto const pXSprite = &actor->x(); auto const pSprite = &actor->s(); auto const target = actor->GetTarget(); if (target != nullptr) @@ -311,7 +307,6 @@ void ThrowCallback2(int, DBloodActor* actor) static void ThrowThing(DBloodActor* actor, bool impact) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (actor->GetTarget() == nullptr) @@ -611,7 +606,6 @@ static void unicultThinkChase(DBloodActor* actor) return; } - XSPRITE* pXLeech = &actLeech->x(); int ldist = aiFightGetTargetDist(targetactor, pDudeInfo, actLeech); if (ldist > 3 || !cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pLeech->x, pLeech->y, pLeech->z, pLeech->sectnum) || actLeech->GetTarget() == nullptr) @@ -1081,8 +1075,6 @@ static void unicultThinkChase(DBloodActor* actor) int checkAttackState(DBloodActor* actor) { - auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); if (dudeIsPlayingSeq(actor, 14) || spriteIsUnderwater(actor,false)) { if ( !dudeIsPlayingSeq(actor, 14) || spriteIsUnderwater(actor,false)) @@ -1266,7 +1258,6 @@ void aiGenDudeNewState(DBloodActor* actor, AISTATE* pAIState) return; } - auto const pSprite = &actor->s(); auto const pXSprite = &actor->x(); // redirect dudes which cannot walk to non-walk states @@ -1328,7 +1319,6 @@ void aiGenDudeNewState(DBloodActor* actor, AISTATE* pAIState) bool playGenDudeSound(DBloodActor* actor, int mode) { - auto const pSprite = &actor->s(); auto const pXSprite = &actor->x(); if (mode < kGenDudeSndTargetSpot || mode >= kGenDudeSndMax) return false; const GENDUDESND* sndInfo = &gCustomDudeSnd[mode]; bool gotSnd = false; @@ -1422,7 +1412,6 @@ DBloodActor* leechIsDropped(DBloodActor* actor) void removeDudeStuff(DBloodActor* actor) { - auto pSprite = &actor->s(); BloodStatIterator it(kStatThing); while (auto actor2 = it.Next()) { @@ -2173,8 +2162,6 @@ void updateTargetOfLeech(DBloodActor* actor) { if (!actor->hasX()) return; - auto const pSprite = &actor->s(); - auto actLeech = leechIsDropped(actor); if (actLeech == NULL || !actLeech->hasX()) actor->genDudeExtra.pLifeLeech = nullptr; else @@ -2207,7 +2194,6 @@ void updateTargetOfSlaves(DBloodActor* actor) if (!actor->hasX()) return; auto const pSprite = &actor->s(); - auto const pXSprite = &actor->x(); GENDUDEEXTRA* pExtra = &actor->genDudeExtra; auto slave = pExtra->slave; diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index afa083cc4..5ceada1a7 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -109,7 +109,6 @@ static void zombaThinkGoto(DBloodActor* actor) static void zombaThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -161,7 +160,6 @@ static void zombaThinkChase(DBloodActor* actor) static void zombaThinkPonder(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { @@ -214,7 +212,6 @@ static void zombaThinkPonder(DBloodActor* actor) static void myThinkTarget(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index a1f00ebeb..04927116a 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -48,7 +48,6 @@ AISTATE zombieFTeslaRecoil = { kAiStateRecoil, 4, -1, 0, NULL, NULL, NULL, &zomb void zombfHackSeqCallback(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); if (pSprite->type != kDudeZombieButcher) return; @@ -89,7 +88,6 @@ void ThrowSeqCallback(int, DBloodActor* actor) static void zombfThinkSearch(DBloodActor* actor) { auto pXSprite = &actor->x(); - auto pSprite = &actor->s(); aiChooseDirection(actor, pXSprite->goalAng); aiThinkTarget(actor); } @@ -112,7 +110,6 @@ static void zombfThinkGoto(DBloodActor* actor) static void zombfThinkChase(DBloodActor* actor) { - auto pXSprite = &actor->x(); auto pSprite = &actor->s(); if (actor->GetTarget() == nullptr) { diff --git a/source/games/blood/src/barf.cpp b/source/games/blood/src/barf.cpp index 0dc520940..9e87f3a77 100644 --- a/source/games/blood/src/barf.cpp +++ b/source/games/blood/src/barf.cpp @@ -139,7 +139,6 @@ void AddCmdDefine(char *text, int value) static void SplitPath(const char *pzPath, char *pzDirectory, char *pzFile, char *pzType) { int const nLength = (int)strlen(pzPath); - const char *pDirectory = pzPath+nLength; const char *pDot = NULL; for (int i = nLength-1; i >= 0; i--) { diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index c0a7cd77c..09383f10b 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -71,7 +71,6 @@ void Remove(DBloodActor* actor, int) // 1 void FlareBurst(DBloodActor* actor, int) // 2 { if (!actor) return; - spritetype *pSprite = &actor->s(); int nAngle = getangle(actor->xvel, actor->yvel); int nRadius = 0x55555; for (int i = 0; i < 8; i++) diff --git a/source/games/blood/src/eventq.cpp b/source/games/blood/src/eventq.cpp index 26f94c3df..9ca660eed 100644 --- a/source/games/blood/src/eventq.cpp +++ b/source/games/blood/src/eventq.cpp @@ -491,7 +491,6 @@ void evSend(DBloodActor* actor, int nIndex, int nType, int rxId, COMMAND_ID comm if (actor && actor->hasX() && !(actor->s().flags & 32)) { - XSPRITE* pXSprite = &actor->x(); if (actor->x().rxID > 0) trMessageSprite(actor, event); } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index e782b5803..214283eac 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -812,7 +812,6 @@ void nnExtInitModernStuff() BloodStatIterator it2(kStatModernCondition); while (auto iactor = it2.Next()) { - spritetype* pSprite = &iactor->s(); XSPRITE* pXSprite = &iactor->x(); if (pXSprite->busyTime <= 0 || pXSprite->isTriggered) continue; @@ -1045,7 +1044,7 @@ DBloodActor* randomSpawnDude(DBloodActor* sourceactor, DBloodActor* origin, int static void windGenDoVerticalWind(int factor, int nSector) { - int val, maxZ, zdiff; bool maxZfound = false; + int val, maxZ = 0, zdiff; bool maxZfound = false; // find maxz marker first BloodSectIterator it(nSector); @@ -1261,8 +1260,6 @@ void nnExtProcessSuperSprites() if ((!pXSightSpr->Interrutable && pXSightSpr->state != pXSightSpr->restState) || pXSightSpr->locked == 1 || pXSightSpr->isTriggered) continue; // don't process locked or triggered sprites - int index = pSightSpr->index; - // sprite is drawn for one of players if ((pXSightSpr->unused3 & kTriggerSpriteScreen) && (gSightSpritesList[i]->s().cstat2 & CSTAT2_SPRITE_MAPPED)) { @@ -1460,7 +1457,7 @@ void sfxPlayVectorSound(DBloodActor* actor, int vectorId) int getSpriteMassBySize(DBloodActor* actor) { auto pSprite = &actor->s(); - int mass = 0; int seqId = -1; int clipDist = pSprite->clipdist; Seq* pSeq = NULL; + int mass = 0; int seqId = -1; int clipDist = pSprite->clipdist; if (!actor->hasX()) { I_Error("getSpriteMassBySize: pSprite->extra < 0"); @@ -4093,7 +4090,6 @@ bool condCheckSector(DBloodActor* aCond, int cmpOp, bool PUSH) { auto pXCond = &aCond->x(); - int var = -1; int cond = pXCond->data1 - kCondSectorBase; int arg1 = pXCond->data2; int arg2 = pXCond->data3; //int arg3 = pXCond->data4; @@ -4983,7 +4979,6 @@ DBloodActor* aiFightGetTargetInRange(DBloodActor* actor, int minDist, int maxDis { if (!aiFightDudeCanSeeTarget(actor, pDudeInfo, targactor)) continue; - auto pTarget = &targactor->s(); auto pXTarget = &targactor->x(); int dist = aiFightGetTargetDist(actor, pDudeInfo, targactor); @@ -5083,7 +5078,6 @@ bool aiFightMatesHaveSameTarget(DBloodActor* leaderactor, DBloodActor* targetact bool aiFightDudeCanSeeTarget(DBloodActor* dudeactor, DUDEINFO* pDudeInfo, DBloodActor* targetactor) { auto pDude = &dudeactor->s(); - auto pXDude = &dudeactor->x(); auto pTarget = &targetactor->s(); int dx = pTarget->x - pDude->x; int dy = pTarget->y - pDude->y; @@ -5232,7 +5226,6 @@ bool aiFightGetDudesForBattle(DBloodActor* actor) void aiFightAlarmDudesInSight(DBloodActor* actor, int max) { auto pSprite = &actor->s(); - auto pSXprite = &actor->x(); DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); @@ -6146,7 +6139,6 @@ void seqTxSendCmdAll(DBloodActor* source, DBloodActor* actor, COMMAND_ID cmd, bo void useRandomTx(DBloodActor* sourceactor, COMMAND_ID cmd, bool setState) { - spritetype* pSource = &sourceactor->s(); auto pXSource = &sourceactor->x(); int tx = 0; int maxRetries = kMaxRandomizeRetries; @@ -6181,7 +6173,6 @@ void useRandomTx(DBloodActor* sourceactor, COMMAND_ID cmd, bool setState) void useSequentialTx(DBloodActor* sourceactor, COMMAND_ID cmd, bool setState) { - spritetype* pSource = &sourceactor->s(); auto pXSource = &sourceactor->x(); bool range = txIsRanged(sourceactor); int cnt = 3; int tx = 0; @@ -6895,7 +6886,6 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) else { auto burnactor = actor->GetBurnSource(); - spritetype* pBurnSource = &burnactor->s(); if (burnactor->hasX()) { if (pXSource->data2 == 1 && pXSprite->rxID == burnactor->x().rxID) @@ -6990,7 +6980,6 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) auto matetarget = mateactor->GetTarget(); if (matetarget != nullptr && matetarget->hasX()) { - auto pMateTarget = &matetarget->s(); // force mate stop attack dude, if he does if (matetarget == actor) { @@ -7035,9 +7024,6 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) auto newtargactor = aiFightGetTargetInRange(actor, 0, mDist, pXSource->data1, pXSource->data2); if (newtargactor != nullptr) { - auto pNewTarg = &newtargactor->s(); - auto pXNewTarg = &newtargactor->x(); - // Make prev target not aim in dude if (targetactor) { @@ -7117,8 +7103,6 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) DBloodActor* pMateTargetActor = aiFightGetMateTargets(actor); if (pMateTargetActor != nullptr && pMateTargetActor->hasX()) { - auto pMateTarget = &pMateTargetActor->s(); - XSPRITE* pXMateTarget = &pMateTargetActor->x(); if (aiFightDudeCanSeeTarget(actor, pDudeInfo, pMateTargetActor)) { @@ -7796,7 +7780,6 @@ DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker) bool aiPatrolMarkerReached(DBloodActor* actor) { spritetype* pSprite = &actor->s(); - XSPRITE* pXSprite = &actor->x(); assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); const DUDEINFO_EXTRA* pExtra = &gDudeInfoExtra[pSprite->type - kDudeBase]; @@ -7934,7 +7917,6 @@ void aiPatrolSetMarker(DBloodActor* actor) int next; int breakChance = 0; - auto pCur = &targetactor->s(); auto pXCur = &targetactor->x(); if (actor->prevmarker) { @@ -8172,7 +8154,6 @@ void aiPatrolAlarmLite(DBloodActor* actor, DBloodActor* targetactor) spritetype* pSprite = &actor->s(); XSPRITE* pXSprite = &actor->x(); spritetype* pTarget = &targetactor->s(); - XSPRITE* pXTarget = &targetactor->x(); if (pXSprite->health <= 0) return; @@ -8224,7 +8205,6 @@ void aiPatrolAlarmFull(DBloodActor* actor, DBloodActor* targetactor, bool chain) spritetype* pSprite = &actor->s(); XSPRITE* pXSprite = &actor->x(); spritetype* pTarget = &targetactor->s(); - XSPRITE* pXTarget = &targetactor->x(); if (pXSprite->health <= 0) return; diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 4fc9ec143..a0be1b166 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -869,7 +869,7 @@ bool findDroppedLeech(PLAYER *a1, DBloodActor *a2) char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor) { spritetype* pItem = &itemactor->s(); - spritetype *pSprite = pPlayer->pSprite; XSPRITE *pXSprite = pPlayer->pXSprite; + spritetype *pSprite = pPlayer->pSprite; char buffer[80]; int pickupSnd = 775; int nType = pItem->type - kItemBase; switch (pItem->type) { @@ -985,8 +985,6 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor) { pPlayer->hasFlag &= ~1; pPlayer->ctfFlagState[0] = nullptr; - spritetype* pOwner = &itemactor->GetOwner()->s(); - XSPRITE* pXOwner = &itemactor->GetOwner()->x(); trTriggerSprite(itemactor->GetOwner(), kCmdOn); sprintf(buffer, "%s returned Blue Flag", PlayerName(pPlayer->nPlayer)); sndStartSample(8003, 255, 2, 0); @@ -1011,8 +1009,6 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor) { pPlayer->hasFlag &= ~2; pPlayer->ctfFlagState[1] = nullptr; - spritetype* pOwner = &itemactor->GetOwner()->s(); - XSPRITE* pXOwner = &itemactor->GetOwner()->x(); trTriggerSprite(itemactor->GetOwner(), kCmdOn); sprintf(buffer, "%s returned Red Flag", PlayerName(pPlayer->nPlayer)); sndStartSample(8002, 255, 2, 0); @@ -1905,7 +1901,6 @@ void flagDropped(PLAYER *pPlayer, int a2) auto playeractor = pPlayer->actor; DBloodActor* actor; char buffer[80]; - spritetype *pSprite = NULL; switch (a2) { case kItemFlagA: @@ -2157,7 +2152,6 @@ void playerLandingSound(PLAYER *pPlayer) void PlayerSurvive(int, DBloodActor* actor) { - XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); char buffer[80]; actHealDude(actor, 1, 2); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index ea9cf09a2..087788671 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1139,7 +1139,6 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) auto actor = GetCrushedSpriteExtents(nSector,&top,&bottom); if (actor && a2 > pXSector->busy) { - spritetype *pSprite = &actor->s(); assert(actor->hasX()); XSPRITE *pXSprite = &actor->x(); if (pXSector->onCeilZ > pXSector->offCeilZ || pXSector->onFloorZ < pXSector->offFloorZ) @@ -1173,7 +1172,6 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) } else if (actor && a2 < pXSector->busy) { - spritetype* pSprite = &actor->s(); assert(actor->hasX()); XSPRITE* pXSprite = &actor->x(); if (pXSector->offCeilZ > pXSector->onCeilZ || pXSector->offFloorZ < pXSector->onFloorZ) @@ -1623,7 +1621,7 @@ void OperateSector(unsigned int nSector, XSECTOR *pXSector, EVENT event) void InitPath(unsigned int nSector, XSECTOR *pXSector) { DBloodActor* actor = nullptr; - spritetype *pSprite; + spritetype *pSprite = nullptr; XSPRITE *pXSprite; assert(nSector < (unsigned int)numsectors); int nId = pXSector->data; diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index c85a38ce0..6b28f129a 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -542,8 +542,6 @@ void render3DViewPolymost(int nSectnum, int cX, int cY, int cZ, binangle cA, fix void viewDrawScreen(bool sceneonly) { - int nPalette = 0; - if (testgotpic(2342, true)) { FireProcess(); @@ -591,8 +589,6 @@ void viewDrawScreen(bool sceneonly) SetupView(cX, cY, cZ, cA, cH, nSectnum, zDelta, shakeX, shakeY, rotscrnang); binangle tilt = interpolatedangle(buildang(gScreenTiltO), buildang(gScreenTilt), gInterpolate); - uint8_t v14 = 0; - uint8_t v10 = 0; bool bDelirium = powerupCheck(gView, kPwUpDeliriumShroom) > 0; static bool bDeliriumOld = false; //int tiltcs, tiltdim; @@ -759,17 +755,12 @@ FString GameInterface::GetCoordString() bool GameInterface::DrawAutomapPlayer(int x, int y, int z, int a, double const smoothratio) { - // [MR]: Confirm that this is correct as math doesn't match the variable names. - int nCos = z * -bsin(a); - int nSin = z * -bcos(a); - for (int i = connecthead; i >= 0; i = connectpoint2[i]) { PLAYER* pPlayer = &gPlayer[i]; spritetype* pSprite = pPlayer->pSprite; int x1 = pSprite->x - x; int y1 = pSprite->y - y; - int pa = (pSprite->ang - a) & 2047; if (i == gView->nPlayer || gGameOptions.nGameType == 1) { int nTile = pSprite->picnum; diff --git a/source/games/duke/src/_polymost.cpp b/source/games/duke/src/_polymost.cpp index e5b7f8202..cf7bcf8d2 100644 --- a/source/games/duke/src/_polymost.cpp +++ b/source/games/duke/src/_polymost.cpp @@ -2,7 +2,7 @@ BEGIN_DUKE_NS void SE40_Draw(int tag, spritetype *spr, int x, int y, int z, binangle a, fixedhoriz h, int smoothratio) { - int i, j = 0, k = 0; + int i, k = 0; int ok = 0, fofmode = 0; int offx, offy; spritetype* floor1, *floor2 = nullptr; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 037f0d10a..e4b354f89 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1047,7 +1047,6 @@ void movewaterdrip(DDukeActor *actor, int drip) { auto s = actor->s; int* t = &actor->temp_data[0]; - int sect = s->sectnum; if (t[1]) { @@ -2171,7 +2170,6 @@ bool money(DDukeActor* actor, int BLOODPOOL) { auto s = actor->s; auto sectp = s->sector(); - int* t = &actor->temp_data[0]; s->xvel = (krand() & 7) + bsin(actor->temp_data[0], -9); actor->temp_data[0] += (krand() & 63); @@ -2642,14 +2640,12 @@ void handle_se00(DDukeActor* actor, int LASERLINE) auto s = actor->s; int* t = &actor->temp_data[0]; sectortype *sect = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; int zchange = 0; auto Owner = actor->GetOwner(); - if (!Owner || Owner->s->lotag == (short)65535) + if (!Owner || Owner->s->lotag == -1) { deletesprite(actor); return; @@ -2833,7 +2829,6 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) int* t = &actor->temp_data[0]; auto sc = actor->getSector(); int st = s->lotag; - int sh = s->hitag; if (actor->GetOwner() == nullptr) { @@ -3037,8 +3032,6 @@ void handle_se30(DDukeActor *actor, int JIBS6) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; auto Owner = actor->GetOwner(); if (Owner == nullptr) @@ -3210,7 +3203,6 @@ void handle_se02(DDukeActor *actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; if (t[4] > 0 && t[0] == 0) @@ -3287,11 +3279,12 @@ void handle_se03(DDukeActor *actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; if (t[4] == 0) return; - int x, p = findplayer(actor, &x); + int x; + + findplayer(actor, &x); int palvals = actor->palvals; @@ -3339,7 +3332,6 @@ void handle_se04(DDukeActor *actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; int j; @@ -3408,8 +3400,6 @@ void handle_se05(DDukeActor* actor, int FIRELASER) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; int j, l, m; int x, p = findplayer(actor, &x); @@ -3589,10 +3579,9 @@ void handle_se10(DDukeActor* actor, const int* specialtags) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; - if ((sc->lotag & 0xff) == 27 || (sc->floorz > sc->ceilingz && (sc->lotag & 0xff) != 23) || sc->lotag == (short)32791) + if ((sc->lotag & 0xff) == 27 || (sc->floorz > sc->ceilingz && (sc->lotag & 0xff) != 23) || sc->lotag == 65536 - 32791) { int j = 1; @@ -3633,8 +3622,6 @@ void handle_se11(DDukeActor *actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; if (t[5] > 0) { t[5]--; @@ -3705,8 +3692,6 @@ void handle_se12(DDukeActor *actor, int planeonly) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; if (t[0] == 3 || t[3] == 1) //Lights going off { sc->floorpal = 0; @@ -3787,8 +3772,6 @@ void handle_se13(DDukeActor* actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; if (t[2]) { int j = (s->yvel << 5) | 1; @@ -3949,7 +3932,6 @@ void handle_se17(DDukeActor* actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; int q = t[0] * (s->yvel << 2); @@ -4064,8 +4046,6 @@ void handle_se18(DDukeActor *actor, bool morecheck) { int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = actor->s->lotag; - int sh = actor->s->hitag; if (t[0]) { @@ -4163,7 +4143,6 @@ void handle_se19(DDukeActor *actor, int BIGFORCE) { int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = actor->s->lotag; int sh = actor->s->hitag; int j, x, q; @@ -4261,8 +4240,6 @@ void handle_se20(DDukeActor* actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; if (t[0] == 0) return; if (t[0] == 1) s->xvel = 8; @@ -4335,8 +4312,6 @@ void handle_se21(DDukeActor* actor) auto s = actor->s; int* t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; int* lp; if (t[0] == 0) return; @@ -4445,8 +4420,6 @@ void handle_se27(DDukeActor* actor) { auto s = actor->s; int* t = &actor->temp_data[0]; - auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; int x, p; @@ -4737,7 +4710,6 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2) void handle_se128(DDukeActor *actor) { int* t = &actor->temp_data[0]; - auto sc = actor->getSector(); auto wal = &wall[t[2]]; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index ae8c529d3..5df4d3a66 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -650,7 +650,7 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p) { auto s = actor->s; int gutz, floorz; - int i=0, j; + int j; int sx, sy; uint8_t pal; @@ -1126,8 +1126,6 @@ static void movetripbomb(DDukeActor *actor) s->ang = l; - int k = 0; - if (lTripBombControl & TRIPBOMB_TRIPWIRE) { // we're on a trip wire @@ -1243,8 +1241,6 @@ static void movefireext(DDukeActor* actor) int j = fi.ifhitbyweapon(actor); if (j == -1) return; - int* t = &actor->temp_data[0]; - for (int k = 0; k < 16; k++) { auto spawned = EGS(actor->s->sectnum, actor->s->x, actor->s->y, actor->s->z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->s->zvel >> 2), actor, 5); @@ -1316,7 +1312,7 @@ static void movesidebolt(DDukeActor* actor) int x; auto sectp = s->sector(); - auto p = findplayer(actor, &x); + findplayer(actor, &x); if (x > 20480) return; CLEAR_THE_BOLT2: @@ -1359,7 +1355,7 @@ static void movebolt(DDukeActor *actor) int x; auto sectp = s->sector(); - auto p = findplayer(actor, &x); + findplayer(actor, &x); if (x > 20480) return; if (t[3] == 0) @@ -1757,7 +1753,6 @@ static void weaponcommon_d(DDukeActor* proj) if (!S_CheckActorSoundPlaying(proj, WIERDSHOT_FLY)) S_PlayActorSound(WIERDSHOT_FLY, proj); - int p = -1; int k, ll; vec3_t oldpos = s->pos; @@ -2732,7 +2727,6 @@ static void flamethrowerflame(DDukeActor *actor) int day = s->y; int daz = s->z; int xvel = s->xvel; - int zvel = s->zvel; getglobalz(actor); @@ -3215,7 +3209,6 @@ void moveactors_d(void) static void fireflyflyingeffect(DDukeActor *actor) { - auto t = &actor->temp_data[0]; int x, p = findplayer(actor, &x); execute(actor, p, x); @@ -3449,7 +3442,6 @@ void handle_se06_d(DDukeActor* actor) auto t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; int k = sc->extra; @@ -3502,9 +3494,6 @@ void handle_se06_d(DDukeActor* actor) static void handle_se28(DDukeActor* actor) { auto s = actor->s; - auto sc = actor->getSector(); - int st = s->lotag; - int sh = s->hitag; int* t = &actor->temp_data[0]; if (t[5] > 0) @@ -3516,7 +3505,7 @@ static void handle_se28(DDukeActor* actor) if (t[0] == 0) { int x; - int p = findplayer(actor, &x); + findplayer(actor, &x); if (x > 15500) return; t[0] = 1; diff --git a/source/games/duke/src/actors_lava.cpp b/source/games/duke/src/actors_lava.cpp index 81b713de2..5ac1655fb 100644 --- a/source/games/duke/src/actors_lava.cpp +++ b/source/games/duke/src/actors_lava.cpp @@ -491,6 +491,10 @@ void moveminecart(void) auto wal = &wall[j]; switch (minecartdir[i]) { + default: // make case of bad parameters well defined. + x = wal->x; + y = wal->y; + break; case 10: x = wal->x; y = wal->y + speed; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 9def10751..e8f5672a9 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -473,7 +473,7 @@ void guts_r(DDukeActor* actor, int gtype, int n, int p) { auto s = actor->s; int gutz, floorz; - int i=0, j; + int j; int sx, sy; uint8_t pal; @@ -937,7 +937,7 @@ static void movebolt(DDukeActor* actor) int x; auto sectp = s->sector(); - auto p = findplayer(actor, &x); + findplayer(actor, &x); if (x > 20480) return; if (t[3] == 0) @@ -1570,7 +1570,7 @@ void moveweapons_r(void) void movetransports_r(void) { - uint8_t warpdir, warpspriteto; + uint8_t warpdir = 0, warpspriteto; int k, p, sectlotag; int ll2 = 0, ll, onfloorz; Collision coll; @@ -2750,7 +2750,6 @@ DETONATEB: static int henstand(DDukeActor *actor) { auto s = actor->s; - auto t = &actor->temp_data[0]; if (s->picnum == HENSTAND || s->picnum == HENSTAND + 1) { @@ -2864,8 +2863,7 @@ void moveactors_r(void) } auto sectp = s->sector(); - auto t = &act->temp_data[0]; - + switch(s->picnum) { case RESPAWNMARKERRED: @@ -3356,7 +3354,6 @@ void handle_se06_r(DDukeActor *actor) auto t = &actor->temp_data[0]; auto sc = actor->getSector(); - int st = s->lotag; int sh = s->hitag; int k = sc->extra; @@ -3471,7 +3468,6 @@ void moveeffectors_r(void) //STATNUM 3 { auto sc = act->getSector(); int st = act->s->lotag; - int sh = act->s->hitag; auto t = &act->temp_data[0]; @@ -3654,7 +3650,6 @@ void moveeffectors_r(void) //STATNUM 3 it.Reset(STAT_EFFECTOR); while (auto act = it.Next()) { - auto s = act->s; if (act->s->lotag != SE_29_WAVES) continue; auto sc = act->getSector(); if (sc->wallnum != 4) continue; diff --git a/source/games/duke/src/bowling.cpp b/source/games/duke/src/bowling.cpp index 21c6e8e3f..13902e245 100644 --- a/source/games/duke/src/bowling.cpp +++ b/source/games/duke/src/bowling.cpp @@ -113,6 +113,7 @@ int checkpins(int sect) { switch (i) { + default: case 0: x = 64; y = 48; @@ -201,6 +202,7 @@ void resetpins(int sect) { switch (i) { + default: case 0: x = 64; y = 48; @@ -262,6 +264,7 @@ void resetlanepics(void) { switch (i) { + default: case 0: x = 64; y = 48; diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index a7c967af9..2f131f971 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -215,8 +215,6 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4]) void drawoverlays(double smoothratio) { - uint8_t fader = 0, fadeg = 0, fadeb = 0, fadef = 0, tintr = 0, tintg = 0, tintb = 0, tintf = 0, dotint = 0; - struct player_struct* pp; int cposx, cposy, cang; @@ -334,8 +332,6 @@ void cameratext(DDukeActor *cam) } else { - int flipbits = (PlayClock << 1) & 48; - for (int x = -64; x < 394; x += 64) for (int y = 0; y < 200; y += 64) drawitem(TILE_STATIC, x, y, !!(PlayClock & 8), !!(PlayClock & 16)); diff --git a/source/games/duke/src/gamedef.cpp b/source/games/duke/src/gamedef.cpp index 2c8388965..4fbfbb9ec 100644 --- a/source/games/duke/src/gamedef.cpp +++ b/source/games/duke/src/gamedef.cpp @@ -507,7 +507,6 @@ static int getlabeloffset(LABELS* pLabel, const char* psz) { // find the label psz in the table pLabel. // returns the offset in the array for the label, or -1 - int l = -1; int i; for (i = 0; pLabel[i].lId >= 0; i++) @@ -1191,6 +1190,7 @@ int ConCompiler::parsecommand() popscriptvalue(); parsing_actor = scriptpos(); + j = 0; if (tw == concmd_useractor) { transnum(LABEL_DEFINE); diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 05cd8cce3..0a2c86bc2 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -855,7 +855,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_GOTWEAPON: - if (bSet) ps[iPlayer].gotweapon[lParm2, lValue] = true; + if (bSet) ps[iPlayer].gotweapon[lParm2] = !!lValue; else SetGameVarID(lVar2, ps[iPlayer].gotweapon[lParm2], sActor, sPlayer); break; @@ -3686,8 +3686,6 @@ void LoadActor(DDukeActor *actor, int p, int x) auto addr = gs.tileinfo[actor->s->picnum].loadeventscriptptr; if (addr == 0) return; - int *insptr = &ScriptCode[addr + 1]; - s.killit_flag = 0; if (actor->s->sectnum < 0 || actor->s->sectnum >= MAXSECTORS) diff --git a/source/games/duke/src/gamevar.cpp b/source/games/duke/src/gamevar.cpp index 29b432626..8563819d3 100644 --- a/source/games/duke/src/gamevar.cpp +++ b/source/games/duke/src/gamevar.cpp @@ -96,8 +96,6 @@ int AddGameVar(const char* pszLabel, intptr_t lValue, unsigned dwFlags) int i; int j; - int b = 0; - if (dwFlags & (GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_PFUNC)) dwFlags |= GAMEVAR_FLAG_SYSTEM; // force system if PLONG diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index e36034490..630e5f92f 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -921,10 +921,10 @@ void displayweapon_d(int snum, double smoothratio) looking_arc += rand() & 3; } gun_pos -= 16; - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, /*isWorldTour() ? FREEZEFIREWIDE :*/ FREEZE + 2, -32, o|pin, pal); - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 235 - gun_pos, FREEZE + 3 + cat_frames[*kb % 6], -32, o | pin, pal); + hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, pic + 2, -32, o|pin, pal); + hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 235 - gun_pos, pic + 3 + cat_frames[*kb % 6], -32, o | pin, pal); } - else hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, /*isWorldTour() ? FREEZEWIDE :*/ FREEZE, shade, o | pin, pal); + else hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, pic, shade, o | pin, pal); }; //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index eddc14f45..68a986f3b 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -318,7 +318,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa { auto s = actor->s; int sect = s->sectnum; - int zvel; + int zvel = 0; int hitsect, hitwall; int hitx, hity, hitz; DDukeActor* hitact; @@ -1925,7 +1925,6 @@ static void underwater(int snum, ESyncBits actions, int psect, int fz, int cz) { auto p = &ps[snum]; auto pact = p->GetActor(); - int psectlotag = sector[psect].lotag; // under water p->jumping_counter = 0; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 526aeee1e..5ad5fc275 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -43,7 +43,7 @@ BEGIN_DUKE_NS void incur_damage_r(struct player_struct* p) { - int damage = 0, unk = 0, shield_damage = 0; + int damage = 0, shield_damage = 0; int gut = 0; p->GetActor()->s->extra -= p->extra_extra8 >> 8; @@ -463,7 +463,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, { auto s = actor->s; int sect = s->sectnum; - int vel, zvel; + int vel = 0, zvel; int scount; if (isRRRA()) @@ -755,7 +755,7 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, { auto s = actor->s; int sect = s->sectnum; - int vel, zvel; + int vel = 0, zvel; int scount; if (s->extra >= 0) s->shade = -96; @@ -2283,7 +2283,6 @@ static void underwater(int snum, ESyncBits actions, int psect, int fz, int cz) { auto p = &ps[snum]; auto pact = p->GetActor(); - int psectlotag = sector[psect].lotag; p->jumping_counter = 0; @@ -2359,7 +2358,6 @@ void onMotorcycleMove(int snum, int psect, int j) auto p = &ps[snum]; auto pact = p->GetActor(); auto s = pact->s; - int psectlotag = sector[psect].lotag; int angleDelta = abs(p->angle.ang.asbuild() - getangle(wall[wall[j].point2].x - wall[j].x, wall[wall[j].point2].y - wall[j].y)); int damageAmount; @@ -3275,11 +3273,6 @@ static void processweapon(int snum, ESyncBits actions, int psect) auto s = pact->s; int shrunk = (s->yrepeat < 8); - if (actions & SB_FIRE) - { - int a = 0; - } - if (p->detonate_count > 0) { if (ud.god) @@ -3798,8 +3791,6 @@ HORIZONLY: if (clip.type == kHitWall) { - int var60 = wall[clip.index].lotag; - if (p->OnMotorcycle) { onMotorcycleMove(snum, psect, clip.index); @@ -4026,7 +4017,6 @@ HORIZONLY: void processmove_r(int snum, ESyncBits actions, int psect, int fz, int cz, int shrunk, int truefdist) { int psectlotag = sector[psect].lotag; - auto p = &ps[snum]; if (psectlotag == ST_2_UNDERWATER) { underwater(snum, actions, psect, fz, cz); diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index e1fa46c67..2318b508e 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -311,7 +311,6 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect) auto p = &ps[snum]; auto pact = p->GetActor(); int i, k; - int psectlotag = sector[psect].lotag; // already firing... if (aplWeaponWorksLike[p->curr_weapon][snum] == HANDBOMB_WEAPON) diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index 961dae7eb..b9c7a256f 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -424,7 +424,7 @@ void prelevel_r(int g) int endwall; int lotaglist; short lotags[65]; - int speed; + int speed = 0; int dist; int sound; sound = 0; @@ -469,6 +469,7 @@ void prelevel_r(int g) case 41: { DukeSectIterator it(i); + dist = 0; while (auto act = it.Next()) { auto spr = act->s; @@ -500,6 +501,7 @@ void prelevel_r(int g) int ii; int childsectnum = -1; dist = 0; + speed = 0; DukeSectIterator it(i); while (auto act = it.Next()) { diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 600609f34..0175398ca 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -256,7 +256,6 @@ void displayrooms(int snum, double smoothratio) binangle cang, rotscrnang; fixedhoriz choriz; struct player_struct* p; - int tiltcs = 0; // JBF 20030807 p = &ps[snum]; pm_smoothratio = (int)smoothratio; diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index b6059f66a..538079a3a 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -703,7 +703,7 @@ static void handle_st29(int sn, DDukeActor* actor) static void handle_st20(int sn, DDukeActor* actor) { sectortype* sptr = §or[sn]; - int j; + int j = 0; REDODOOR: if (sptr->lotag & 0x8000) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index c639ab1ab..6bca6ec07 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -476,7 +476,7 @@ bool checkhitswitch_d(int snum, int ww, DDukeActor *act) } } - if (lotag == (short)65535) + if (lotag == -1) { setnextmap(false); return 1; diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 01801a954..bdf8111da 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -679,7 +679,7 @@ bool checkhitswitch_r(int snum, int ww, DDukeActor* act) } } - if (lotag == (short)65535) + if (lotag == -1) { setnextmap(false); } @@ -1085,7 +1085,6 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw case RRTILE3643 + 3: { int sect; - int unk = 0; int startwall, endwall; sect = wal->nextWall()->nextsector; DukeSectIterator it(sect); @@ -2448,7 +2447,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) void checksectors_r(int snum) { - int i = -1, oldz; + int oldz; struct player_struct* p; int hitscanwall; int neartagsector, neartagwall; diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 5ccdd790e..914900274 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -218,13 +218,11 @@ int S_DefineSound(unsigned index, const char *filename, int minpitch, int maxpit { auto& S_sfx = soundEngine->GetSounds(); index++; - unsigned oldindex = S_sfx.Size(); if (index >= S_sfx.Size()) { S_sfx.Resize(index + 1); } auto sfx = &S_sfx[index]; - bool alreadydefined = !sfx->bTentative; sfx->UserData.Resize(kMaxUserData); auto sndinf = sfx->UserData.Data(); sndinf[kFlags] = type & ~SF_ONEINST_INTERNAL; @@ -275,7 +273,7 @@ static int GetPositionInfo(DDukeActor* actor, int soundNum, int sectNum, // However, ultimately rolloff would also just reposition the sound source so this can remain as it is. auto sp = actor->s; - int orgsndist = 0, sndang = 0, sndist = 0, explosion = 0; + int orgsndist = 0, sndist = 0; auto const* snd = soundEngine->GetUserData(soundNum + 1); int userflags = snd ? snd[kFlags] : 0; int dist_adjust = snd ? snd[kVolAdjust] : 0; @@ -765,7 +763,6 @@ void S_WorldTourMappingsForOldSounds() // It's really ironic that despite their low quality they often sound a lot better than the new ones. if (!isWorldTour()) return; auto &s_sfx = soundEngine->GetSounds(); - int maxorig = s_sfx.Size(); for(unsigned i = 1; i < s_sfx.Size(); i++) { auto fname = s_sfx[i].name; diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index b3aeea4e3..0fa9705f2 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -235,7 +235,6 @@ int initspriteforspawn(DDukeActor* actj, int pn, const std::initializer_lists; - auto sect = sp->sectnum; if (gs.actorinfo[sp->picnum].scriptaddress) { @@ -430,7 +429,6 @@ void initfootprint(DDukeActor* actj, DDukeActor* acti) void initshell(DDukeActor* actj, DDukeActor* acti, bool isshell) { auto sp = acti->s; - int sect = sp->sectnum; auto t = acti->temp_data; if (actj) { @@ -537,7 +535,6 @@ void initcrane(DDukeActor* actj, DDukeActor* acti, int CRANEPOLE) void initwaterdrip(DDukeActor* actj, DDukeActor* actor) { auto sp = actor->s; - int sect = sp->sectnum; auto t = actor->temp_data; if (actj && (actj->s->statnum == 10 || actj->s->statnum == 1)) { @@ -573,8 +570,6 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor) int initreactor(DDukeActor* actj, DDukeActor* actor, bool isrecon) { auto sp = actor->s; - int sect = sp->sectnum; - auto t = actor->temp_data; if (isrecon) { if (sp->lotag > ud.player_skill) @@ -1205,7 +1200,6 @@ void ceilingglass(DDukeActor* actor, int sectnum, int n) { int j, xv, yv, z, x1, y1; int a, s, startwall, endwall; - auto sp = actor->s; startwall = sector[sectnum].wallptr; endwall = startwall + sector[sectnum].wallnum; diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index c3650d708..65ec7d604 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -53,7 +53,6 @@ int spawn_d(int j, int pn) auto sp = act->s; auto spj = j < 0 ? nullptr : actj->s; auto t = act->temp_data; - int sect = sp->sectnum; auto sectp = sp->sector(); diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index ec8016c4e..29f4c5b36 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -48,7 +48,6 @@ int spawn_r(int j, int pn) auto sp = act->s; auto spj = j < 0? nullptr : actj->s; auto t = act->temp_data; - int sect = sp->sectnum; auto sectp = sp->sector(); switch(sp->picnum) diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 13cf53524..ecb6e0b49 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -865,7 +865,6 @@ void AIBullet::Draw(RunListEvent* ev) short nSeq = SeqOffsets[BulletList[nBullet].nSeq]; - short nSprite2 = ev->nParam; ev->pTSprite->statnum = 1000; if (BulletList[nBullet].nType == 15) diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 3e086e245..09e963e5f 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -615,7 +615,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, DExhumedActor& w, void SerializeState(FSerializer& arc) { - int loaded = 0; if (arc.BeginObject("state")) { if (arc.isReading() && (currentLevel->gameflags & LEVEL_EX_COUNTDOWN)) diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index dd43498cf..a8856a6e3 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -277,7 +277,6 @@ void AIFish::Damage(RunListEvent* ev) return; } auto pSprite = &pActor->s(); - short nAction = pActor->nAction; pActor->nHealth -= dmgAdjust(ev->nDamage); if (pActor->nHealth <= 0) diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 42119c6c4..adde5ebad 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -346,8 +346,6 @@ void AIGrenade::RadialDamage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - auto pGrenadeSprite = &pActor->s(); - if (pActor != ev->pOtherActor && !pActor->nFrame) { if (runlist_CheckRadialDamage(pActor) > 280) diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index 6ad3da237..ce07520fb 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -370,8 +370,6 @@ void StartRegenerate(DExhumedActor* pActor) { spritetype *pSprite = &pActor->s(); - DExhumedActor* pCurr = nullptr; - auto pos = Regenerates.Find(pActor); if (pos >= Regenerates.Size()) { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 3b7d24ab6..27c5a9dbd 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -238,7 +238,7 @@ void AILavaDude::Tick(RunListEvent* ev) short nFlag = FrameFlag[SeqBase[nSeq] + var_38]; - int var_1C; + int var_1C = 0; if (nAction) { diff --git a/source/games/exhumed/src/map.cpp b/source/games/exhumed/src/map.cpp index 55b7abd4e..ba4af5491 100644 --- a/source/games/exhumed/src/map.cpp +++ b/source/games/exhumed/src/map.cpp @@ -73,17 +73,12 @@ template void GetSpriteExtents(T const* const pSprite, int* top, int bool GameInterface::DrawAutomapPlayer(int x, int y, int z, int a, double const smoothratio) { - // [MR]: Confirm that this is correct as math doesn't match the variable names. - int nCos = z * -bsin(a); - int nSin = z * -bcos(a); - for (int i = connecthead; i >= 0; i = connectpoint2[i]) { auto pPlayerActor = PlayerList[i].Actor(); spritetype* pSprite = &pPlayerActor->s(); int x1 = pSprite->x - x; int y1 = pSprite->y - y; - int pa = (pSprite->ang - a) & 2047; if (i == nLocalPlayer)// || gGameOptions.nGameType == 1) { int nTile = pSprite->picnum; diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index efb40fc72..b4f56d80c 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -420,7 +420,6 @@ void AIMummy::RadialDamage(RunListEvent* ev) { auto pActor = ev->pObjActor; if (!pActor) return; - auto pSprite = &pActor->s(); if (pActor->nHealth <= 0) return; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index e4d29a135..e93c2c964 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2089,7 +2089,6 @@ void AIObject::Damage(RunListEvent* ev) if (!pActor) return; auto pSprite = &pActor->s(); short nStat = pSprite->statnum; - short bx = pActor->nIndex; if (nStat >= 150 || pActor->nHealth <= 0) { return; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index bcde8b458..8fad221f5 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1174,7 +1174,6 @@ sectdone: int var_5C = SectFlag[nViewSect] & kSectUnderwater; - uint16_t buttons = sPlayerInput[nPlayer].buttons; auto actions = sPlayerInput[nPlayer].actions; // loc_1AEF5: diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index b1b3aee80..be2574585 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -1732,8 +1732,6 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor) void runlist_RadialDamageEnemy(DExhumedActor* pActor, short nDamage, short nRadius) { - auto pSprite = &pActor->s(); - if (!nRadius) { return; } diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 939fcc0bf..d5b1c780d 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -121,10 +121,8 @@ void AIScorp::Damage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; auto pSprite = &pActor->s(); - bool bVal = false; DExhumedActor* pTarget = nullptr; @@ -423,8 +421,6 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) short nAction = pActor->nAction; auto pSprite = &pActor->s(); - bool bVal = false; - if (mode == 0) { PlotCourseToSprite(pActor, pTarget); diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index b89a7ca2a..5f7302519 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -188,7 +188,7 @@ void BuildSnake(short nPlayer, short zVal) // GrabTimeSlot(3); - DExhumedActor* sprt; + DExhumedActor* sprt = nullptr; for (int i = 0; i < kSnakeSprites; i++) { @@ -268,7 +268,6 @@ DExhumedActor* FindSnakeEnemy(short nSnake) { short nPlayer = SnakeList[nSnake].nSnakePlayer; auto pPlayerActor = PlayerList[nPlayer].Actor(); - auto pPlayerSprite = &pPlayerActor->s(); auto pActor = SnakeList[nSnake].pSprites[0]; // CHECKME auto pSprite = &pActor->s(); diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index e8b951c9e..32599a050 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -500,8 +500,6 @@ void GameInterface::UpdateSounds() if (nFreeze) return; - int nLocalSectFlags = SectFlag[PlayerList[nLocalPlayer].nPlayerViewSect]; - vec3_t pos; short ang; if (nSnakeCam > -1) diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index da94add74..ec1ec173c 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -205,9 +205,7 @@ void DrawView(double smoothRatio, bool sceneonly) int playerZ; int nSector; binangle nAngle, rotscrnang; - fixedhoriz pan; - - fixed_t dang = IntToFixed(1024); + fixedhoriz pan = {}; zbob = bsin(2 * bobangle, -3); diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index fd4ac5164..7b62a0c33 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -145,7 +145,6 @@ void AIWasp::Damage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; auto pSprite = &pActor->s(); - short nAction = pActor->nAction; if (!ev->nDamage) { return; diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index e127d1695..087b184b4 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -259,7 +259,7 @@ int CanHitPlayer(DSWActor* actor) SPRITEp sp = &actor->s(); hitdata_t hitinfo; int xvect,yvect,zvect; - short ang,ret=false; + short ang; // if actor can still see the player int zhs, zhh; @@ -469,8 +469,8 @@ int DoActorOperate(DSWActor* actor) { SPRITEp sp = &actor->s(); USERp u = actor->u(); - short nearsector, nearwall, nearsprite; - int nearhitdist; + short nearsector = 0, nearwall = 0, nearsprite = 0; + int nearhitdist = 0; int z[2]; unsigned int i; @@ -751,7 +751,6 @@ int InitActorDecide(DSWActor* actor) int DoActorDecide(DSWActor* actor) { USER* u = actor->u(); - SPRITEp sp = &actor->s(); ANIMATORp actor_action; // See what to do next diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index 3a74e3afc..9745acd83 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -559,8 +559,6 @@ int SetupCoolie(DSWActor* actor) int NewCoolg(DSWActor*); int SpawnCoolg(DSWActor* actor) { - USER* u = actor->u(); - // Don't do a ghost every time if (RandomRange(1000) > 700 || Skill < MinEnemySkill - 1) { @@ -638,7 +636,6 @@ int DoCoolieMove(DSWActor* actor) int InitCoolieCharge(DSWActor* actor) { - USER* u = actor->u(); SPRITEp sp = &actor->s(); if (RANDOM_P2(1024) > 950) diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 76f21d2af..c2ecd25ec 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1037,8 +1037,6 @@ FString GameInterface::GetCoordString() void PrintSpriteInfo(PLAYERp pp) { const int Y_STEP = 7; - int x = windowxy1.x+2; - int y = windowxy1.y+2; SPRITEp sp; USERp u; diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index d5f3bcd19..8bf80586f 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -490,7 +490,6 @@ void TerminateLevel(void) } -using namespace ShadowWarrior; static bool DidOrderSound; static int zero = 0; diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 69207b456..86ddcc9f9 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -838,7 +838,6 @@ int DoChemBomb(DSWActor* actor) if (!TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE)) PlaySound(DIGI_CHEMBOUNCE, sp, v3df_dontpan); - auto hitActor = u->coll.actor; hsp = &actor->s(); if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL)) @@ -1594,7 +1593,6 @@ int PlayerInitFlashBomb(PLAYERp pp) int InitFlashBomb(DSWActor* actor) { - USER* u = actor->u(); SPRITEp sp = &actor->s(); int i; unsigned int stat; diff --git a/source/games/sw/src/miscactr.cpp b/source/games/sw/src/miscactr.cpp index fcb82a3bb..ce764a0f6 100644 --- a/source/games/sw/src/miscactr.cpp +++ b/source/games/sw/src/miscactr.cpp @@ -502,7 +502,6 @@ int WashGirlUzi(DSWActor* actor) int WashGirlPain(DSWActor* actor) { USER* u = actor->u(); - int SpriteNum = u->SpriteNum; NullWashGirl(actor); if ((u->WaitTics -= ACTORMOVETICS) <= 0) diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index 0e0cc8ecd..d02d57d85 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -2136,7 +2136,6 @@ int DoNinjaSpecial(DSWActor* actor) int CheckFire(DSWActor* actor) { - USER* u = actor->u(); if (!CanSeePlayer(actor)) InitActorDuck(actor); return 0; @@ -2144,11 +2143,7 @@ int CheckFire(DSWActor* actor) int DoNinjaCeiling(DSWActor* actor) { - USER* u = actor->u(); - SPRITEp sp = &actor->s(); - DoActorSectorDamage(actor); - return 0; } diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 0ddb1935f..87438c4b6 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2452,7 +2452,6 @@ void DriveCrush(PLAYERp pp, int *x, int *y) while (auto actor = it.Next()) { sp = &actor->s(); - auto u = actor->u(); if (testpointinquad(sp->x, sp->y, x, y)) { @@ -3730,7 +3729,7 @@ DSWActor* FindNearSprite(DSWActor* actor, short stat) bool PlayerOnLadder(PLAYERp pp) { - short sec, wal, spr; + short sec, wal = 0, spr; int dist, nx, ny; unsigned i; SPRITEp lsp; @@ -6595,8 +6594,6 @@ void MoveSkipSavePos(void) void PlayerTimers(PLAYERp pp) { - SPRITEp sp = &pp->Actor()->s(); - InventoryTimer(pp); } diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index 1bb967363..6d02ddea1 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -335,7 +335,7 @@ void PM_WriteSavePic(FileWriter* file, int width, int height) screen->SetViewportRects(&bounds); twodpsp.Clear(); - bool didit = gi->GenerateSavePic(); + /*bool didit =*/ gi->GenerateSavePic(); float Brightness = 8.f / (r_scenebrightness + 8.f); screen->PostProcessScene(false, 0, Brightness, []() {