diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index cc6cb7bea..077ef0478 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -207,7 +207,7 @@ static int32_t engineLoadTables(void) int32_t i; for (i=0; i<=512; i++) - sintable[i] = int(sin(i * BAngRadian) * SINTABLEUNIT); + sintable[i] = int(sin(i * BAngRadian) * +SINTABLEUNIT); for (i=513; i<1024; i++) sintable[i] = sintable[1024-i]; for (i=1024; i<2048; i++) diff --git a/source/common/rendering/hwrenderer/data/hw_skydome.h b/source/common/rendering/hwrenderer/data/hw_skydome.h index 2e10869bb..71ad85a08 100644 --- a/source/common/rendering/hwrenderer/data/hw_skydome.h +++ b/source/common/rendering/hwrenderer/data/hw_skydome.h @@ -12,10 +12,7 @@ struct HWSkyPortal; struct HWDrawInfo; // 57 world units roughly represent one sky texel for the glTranslate call. -enum -{ - skyoffsetfactor = 57 -}; +const int skyoffsetfactor = 57; struct FSkyVertex { diff --git a/source/common/textures/multipatchtexturebuilder.cpp b/source/common/textures/multipatchtexturebuilder.cpp index 000af17e2..6a49d87ae 100644 --- a/source/common/textures/multipatchtexturebuilder.cpp +++ b/source/common/textures/multipatchtexturebuilder.cpp @@ -572,7 +572,7 @@ void FMultipatchTextureBuilder::ParsePatch(FScanner &sc, BuildInfo &info, TexPar else if (sc.Compare("alpha")) { sc.MustGetFloat(); - part.Alpha = clamp(int(sc.Float * BLENDUNIT), 0, BLENDUNIT); + part.Alpha = clamp(int(sc.Float * +BLENDUNIT), 0, BLENDUNIT); // bComplex is not set because it is only needed when the style is not OP_COPY. } else if (sc.Compare("style")) diff --git a/source/core/binaryangle.h b/source/core/binaryangle.h index 42b45e31a..c6a0322fc 100644 --- a/source/core/binaryangle.h +++ b/source/core/binaryangle.h @@ -131,13 +131,13 @@ public: binangle(const binangle &other) = default; // This class intentionally makes no allowances for implicit type conversions because those would render it ineffective. constexpr short asbuild() const { return value >> BAMBITS; } - constexpr double asbuildf() const { return value * (1. / BAMUNIT); } + constexpr double asbuildf() const { return value * (1. / +BAMUNIT); } constexpr fixed_t asq16() const { return value >> 5; } constexpr uint32_t asbam() const { return value; } constexpr double asrad() const { return value * (pi::pi() / 0x80000000u); } constexpr double asdeg() const { return AngleToFloat(value); } constexpr short signedbuild() const { return tosigned() >> BAMBITS; } - constexpr double signedbuildf() const { return tosigned() * (1. / BAMUNIT); } + constexpr double signedbuildf() const { return tosigned() * (1. / +BAMUNIT); } constexpr fixed_t signedq16() const { return tosigned() >> 5; } constexpr int32_t signedbam() const { return tosigned(); } constexpr double signedrad() const { return tosigned() * (pi::pi() / 0x80000000u); } diff --git a/source/core/console/c_notifybuffer.cpp b/source/core/console/c_notifybuffer.cpp index f971a1e05..e0854a8cd 100644 --- a/source/core/console/c_notifybuffer.cpp +++ b/source/core/console/c_notifybuffer.cpp @@ -65,7 +65,7 @@ CVAR(Bool, con_centernotify, false, CVAR_ARCHIVE) CVAR(Bool, con_pulsetext, false, CVAR_ARCHIVE) CVAR(Bool, con_notify_advanced, false, CVAR_ARCHIVE) -enum { NOTIFYFADETIME = 6 }; +const int NOTIFYFADETIME = 6; CUSTOM_CVAR(Int, con_notifylines, 4, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) { diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index 96ca7bd83..9ee63c2ee 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -209,10 +209,7 @@ void S_PauseSound(bool notmusic, bool notsfx); void S_ResumeSound(bool notsfx); void S_SetSoundPaused(int state); -enum -{ - MaxSmoothRatio = FRACUNIT -}; +const int MaxSmoothRatio = FRACUNIT; FString G_GetDemoPath(); diff --git a/source/core/nodebuilder/nodebuild_utility.cpp b/source/core/nodebuilder/nodebuild_utility.cpp index dbfe961a2..f7df707ae 100644 --- a/source/core/nodebuilder/nodebuild_utility.cpp +++ b/source/core/nodebuilder/nodebuild_utility.cpp @@ -386,8 +386,8 @@ FNodeBuilder::FVertexMap::FVertexMap (FNodeBuilder &builder, { MinX = minx; MinY = miny; - BlocksWide = int(((double(maxx) - minx + 1) + (BLOCK_SIZE - 1)) / BLOCK_SIZE); - BlocksTall = int(((double(maxy) - miny + 1) + (BLOCK_SIZE - 1)) / BLOCK_SIZE); + BlocksWide = int(((double(maxx) - minx + 1) + (BLOCK_SIZE - 1)) / +BLOCK_SIZE); + BlocksTall = int(((double(maxy) - miny + 1) + (BLOCK_SIZE - 1)) / +BLOCK_SIZE); MaxX = MinX + fixed64_t(BlocksWide) * BLOCK_SIZE - 1; MaxY = MinY + fixed64_t(BlocksTall) * BLOCK_SIZE - 1; VertexGrid = new TArray[BlocksWide * BlocksTall]; diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index 6fd360121..3b5d408ab 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -71,7 +71,7 @@ void displaymasks_r(int snum, int p, double smoothratio) { //int pin = 0; // to get the proper clock value with regards to interpolation we have add a smoothratio based offset to the value. - double interpclock = PlayClock + (TICSPERFRAME/65536.) * smoothratio; + double interpclock = PlayClock + (+TICSPERFRAME/65536.) * smoothratio; int pin = RS_STRETCH; hud_drawsprite((320 - (tileWidth(SCUBAMASK) >> 1) - 15), (200 - (tileHeight(SCUBAMASK) >> 1) + bsinf(interpclock, -10)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin); hud_drawsprite((320 - tileWidth(SCUBAMASK + 4)), (200 - tileHeight(SCUBAMASK + 4)), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin); diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index fc002db31..204adb1f0 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -655,7 +655,7 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool if (kbdLeft || kbdRight || p->moto_drink || hidInput->mouseturnx || hidInput->dyaw) { double const velScale = 6. / 19.; - auto const baseVel = !p->NotOnWater ? VEHICLETURN : VEHICLETURN * velScale; + auto const baseVel = !p->NotOnWater ? VEHICLETURN : +VEHICLETURN * velScale; if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->dyaw < 0) { diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index b2ca4f8f1..4797528f9 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -113,10 +113,11 @@ float S_ConvertPitch(int lpitch) enum { - MAXLEVLDIST = 19000, // The higher the number, the further away you can hear sound DECAY_CONST = 4000 }; +const int MAXLEVLDIST = 19000; // The higher the number, the further away you can hear sound + short SoundDist(int x, int y, int z, int basedist) { double tx, ty, tz;