diff --git a/src/common/engine/renderstyle.h b/src/common/engine/renderstyle.h index 70ad5d561..272f23ba5 100644 --- a/src/common/engine/renderstyle.h +++ b/src/common/engine/renderstyle.h @@ -39,10 +39,7 @@ #undef OPAQUE #endif -enum -{ - OPAQUE = 65536, -}; +constexpr int OPAQUE = 65536; enum ETexMode { diff --git a/src/console/c_notifybuffer.cpp b/src/console/c_notifybuffer.cpp index feb58343d..d25b320e4 100644 --- a/src/console/c_notifybuffer.cpp +++ b/src/console/c_notifybuffer.cpp @@ -64,7 +64,7 @@ CUSTOM_CVAR(Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high r if (self < 0) self = 0; } -enum { NOTIFYFADETIME = 6 }; +constexpr int NOTIFYFADETIME = 6; CUSTOM_CVAR(Int, con_notifylines, 4, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) { diff --git a/src/doomdef.h b/src/doomdef.h index 83459ffe7..d84830b86 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -57,15 +57,15 @@ typedef enum #endif #endif +// State updates, number of tics / second. +constexpr int TICRATE = 35; + // Global constants that were defines. enum { // The maximum number of players, multiplayer/networking. MAXPLAYERS = 8, - // State updates, number of tics / second. - TICRATE = 35, - // Amount of damage done by a telefrag. TELEFRAG_DAMAGE = 1000000 }; diff --git a/src/gamedata/p_blockmap.h b/src/gamedata/p_blockmap.h index f528ae156..06c03deb3 100644 --- a/src/gamedata/p_blockmap.h +++ b/src/gamedata/p_blockmap.h @@ -43,10 +43,7 @@ struct FBlockmap // mapblocks are used to check movement // against lines and things - enum - { - MAPBLOCKUNITS = 128 - }; + static constexpr int MAPBLOCKUNITS = 128; inline int GetBlockX(double xpos) { diff --git a/src/rendering/swrenderer/things/r_playersprite.h b/src/rendering/swrenderer/things/r_playersprite.h index 494e693f2..046b4ab7c 100644 --- a/src/rendering/swrenderer/things/r_playersprite.h +++ b/src/rendering/swrenderer/things/r_playersprite.h @@ -92,8 +92,8 @@ namespace swrenderer private: void RenderSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac, int lightlevel, FDynamicColormap *basecolormap, bool foggy); - enum { BASEXCENTER = 160 }; - enum { BASEYCENTER = 100 }; + static constexpr int BASEXCENTER = 160; + static constexpr int BASEYCENTER = 100; TArray AcceleratedSprites; sector_t tempsec; diff --git a/src/utility/nodebuilder/nodebuild.h b/src/utility/nodebuilder/nodebuild.h index 0618f7247..f9f6b018a 100644 --- a/src/utility/nodebuilder/nodebuild.h +++ b/src/utility/nodebuilder/nodebuild.h @@ -173,8 +173,8 @@ class FNodeBuilder fixed64_t MinX, MinY, MaxX, MaxY; int BlocksWide, BlocksTall; - enum { BLOCK_SHIFT = 8 + FRACBITS }; - enum { BLOCK_SIZE = 1 << BLOCK_SHIFT }; + static constexpr int BLOCK_SHIFT = 8 + FRACBITS; + static constexpr int BLOCK_SIZE = 1 << BLOCK_SHIFT; int InsertVertex (FPrivVert &vert); inline int GetBlock (fixed64_t x, fixed64_t y)