1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-03-07 13:59:44 +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

@@ -11,10 +11,10 @@ namespace hr {
EX namespace multi {
#if HDR
static const int MAXJOY = 8;
static const int MAXBUTTON = 64;
static const int MAXAXE = 16;
static const int MAXHAT = 4;
static constexpr int MAXJOY = 8;
static constexpr int MAXBUTTON = 64;
static constexpr int MAXAXE = 16;
static constexpr int MAXHAT = 4;
struct config {
char keyaction[512];
@@ -75,8 +75,8 @@ EX namespace multi {
EX double mdx[MAXPLAYER], mdy[MAXPLAYER]; // movement vector for the next move
static const int CMDS = 15;
static const int CMDS_PAN = 11;
static constexpr int CMDS = 15;
static constexpr int CMDS_PAN = 11;
vector<string> playercmds_shmup = {
"forward", "backward", "turn left", "turn right",