1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-31 17:57:56 +00:00

Change static const to static constexpr wherever possible

Since we require C++11, most of these consts can be constexpr.

Two `static const ld` remain non-compile-time-evaluable because
they depend on the runtime `log` function. One `static const cld`
remains non-compile-time because `std::complex<T>` doesn't become
constexpr until C++14.
This commit is contained in:
Arthur O'Dwyer
2023-08-23 09:44:37 -08:00
parent b70b339f52
commit 62629f3e70
48 changed files with 453 additions and 458 deletions

View File

@@ -46,7 +46,7 @@ EX ld minstep = .001;
EX ld reflect_val = 0;
static const int NO_LIMIT = 999999;
static constexpr int NO_LIMIT = 999999;
EX ld hard_limit = NO_LIMIT;
@@ -186,11 +186,11 @@ struct raycaster : glhr::GLprogram {
#ifdef GLES_ONLY
bool m_via_texture = false;
bool wall_via_texture = false;
static const bool can_via_texture = false; /* textures are not precise enough ): */
static constexpr bool can_via_texture = false; /* textures are not precise enough ): */
#else
bool m_via_texture = true;
bool wall_via_texture = true;
static const bool can_via_texture = true;
static constexpr bool can_via_texture = true;
#endif