mirror of
https://github.com/gbdev/rgbds.git
synced 2026-12-03 07:18:40 +00:00
Factor out MAX_NB_PALETTES constant
This commit is contained in:
1 parent
2bbaef0541
commit
02e80336d4
2 files changed
+3
-2
No files matched your search
@@ -19,6 +19,7 @@ static constexpr uint32_t TILE_WIDTH = 8; // in pixels
|
||||
static constexpr uint32_t TILE_HEIGHT = 8; // in pixels
|
||||
|
||||
static constexpr size_t MAX_PAL_COLORS = 4;
|
||||
static constexpr size_t MAX_NB_PALETTES = 256;
|
||||
|
||||
// Forward declaration so `inputSlice`'s `bottom` method inside `Options` can refer to `options`.
|
||||
struct Options;
|
||||
|
||||
+2
-2
@@ -358,8 +358,8 @@ static void parseArg(int ch, char *arg) {
|
||||
case 'n':
|
||||
if (std::optional<uint64_t> number = parseWholeNumber(argPtr); !number) {
|
||||
error("Invalid argument for number of palettes");
|
||||
} else if (*number > 256) {
|
||||
error("Number of palettes must not exceed 256");
|
||||
} else if (*number > MAX_NB_PALETTES) {
|
||||
error("Number of palettes must not exceed %zu", MAX_NB_PALETTES);
|
||||
} else if (*number == 0) {
|
||||
error("Number of palettes may not be 0");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user