1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-09 11:52:23 +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

@@ -26,8 +26,8 @@ int TWIDTH;
EX ld race_advance = 0;
static const int LENGTH = 250;
static const int DROP = 1;
static constexpr int LENGTH = 250;
static constexpr int DROP = 1;
EX int ghosts_to_show = 5;
EX int ghosts_to_save = 10;
@@ -59,7 +59,7 @@ uchar angle_to_uchar(ld x) { return frac_to_uchar(x / TAU); }
ld uchar_to_frac(uchar x) { return x / 256.; }
transmatrix spin_uchar(uchar x) { return spin(uchar_to_frac(x) * TAU); }
static const ld distance_multiplier = 4;
static constexpr ld distance_multiplier = 4;
struct ghostmoment {
int step;