16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

Use the sq function to force constexpr expressions for numeric literals and enhance readability

This commit is contained in:
docentYT
2026-04-28 13:23:14 +02:00
parent 6be1b0886d
commit ca839652bf
15 changed files with 64 additions and 59 deletions

View File

@@ -29,9 +29,9 @@ class opengl33_renderer;
namespace scene {
int const EU07_CELLSIZE = 250;
int const EU07_SECTIONSIZE = 1000;
int const EU07_REGIONSIDESECTIONCOUNT = 500; // number of sections along a side of square region
int constexpr EU07_CELLSIZE = 250;
int constexpr EU07_SECTIONSIZE = 1000;
int constexpr EU07_REGIONSIDESECTIONCOUNT = 500; // number of sections along a side of square region
struct scratch_data {
@@ -428,7 +428,7 @@ public:
//private:
// types
using section_array = std::array<basic_section *, EU07_REGIONSIDESECTIONCOUNT * EU07_REGIONSIDESECTIONCOUNT>;
using section_array = std::array<basic_section *, sq(EU07_REGIONSIDESECTIONCOUNT)>;
struct region_scratchpad {