There is a LOT of enum-to-integer casting going on in this codebase. At first enums seemed like the right call for things like config options and palette names, but we are doing an unexpected amount of math on these values, to the point where they maybe should just be integers.
So, we could go through all the enums we have (that we do a lot of math on) and just turn them into constants:
enum class PaletteName {
autumn,
bliss,
...
}
// ... might become ...
const int PALETTE_AUTUMN = 0;
const int PALETTE_BLISS = 1;
...
The disadvantage here, of course, is that it's more error prone and it's way more annoying to define new variants. There is probably a more elegant way. But... boy, are these enum things getting irritating.
There is a LOT of enum-to-integer casting going on in this codebase. At first enums seemed like the right call for things like config options and palette names, but we are doing an unexpected amount of math on these values, to the point where they maybe should just be integers.
So, we could go through all the enums we have (that we do a lot of math on) and just turn them into constants:
The disadvantage here, of course, is that it's more error prone and it's way more annoying to define new variants. There is probably a more elegant way. But... boy, are these enum things getting irritating.