mirror of
https://github.com/gbdev/rgbds.git
synced 2026-03-25 14:23:04 +00:00
Remove exclamation marks and periods from error messages (#1874)
This commit is contained in:
@@ -126,7 +126,7 @@ static uint16_t readNumber(char const *&str, char const *errPrefix, uint16_t err
|
||||
error("%s: expected number, but found nothing", errPrefix);
|
||||
return errVal;
|
||||
} else if (*number > UINT16_MAX) {
|
||||
error("%s: the number is too large!", errPrefix);
|
||||
error("%s: the number is too large", errPrefix);
|
||||
return errVal;
|
||||
} else {
|
||||
return *number;
|
||||
@@ -239,7 +239,7 @@ static void parseArg(int ch, char *arg) {
|
||||
case 'L':
|
||||
options.inputSlice.left = readNumber(argPtr, "Input slice left coordinate");
|
||||
if (options.inputSlice.left > INT16_MAX) {
|
||||
error("Input slice left coordinate is out of range!");
|
||||
error("Input slice left coordinate is out of range");
|
||||
break;
|
||||
}
|
||||
skipBlankSpace(argPtr);
|
||||
@@ -260,7 +260,7 @@ static void parseArg(int ch, char *arg) {
|
||||
options.inputSlice.width = readNumber(argPtr, "Input slice width");
|
||||
skipBlankSpace(argPtr);
|
||||
if (options.inputSlice.width == 0) {
|
||||
error("Input slice width may not be 0!");
|
||||
error("Input slice width may not be 0");
|
||||
}
|
||||
if (*argPtr != ',') {
|
||||
error("Missing comma after width in \"%s\"", arg);
|
||||
@@ -270,7 +270,7 @@ static void parseArg(int ch, char *arg) {
|
||||
skipBlankSpace(argPtr);
|
||||
options.inputSlice.height = readNumber(argPtr, "Input slice height");
|
||||
if (options.inputSlice.height == 0) {
|
||||
error("Input slice height may not be 0!");
|
||||
error("Input slice height may not be 0");
|
||||
}
|
||||
if (*argPtr != '\0') {
|
||||
error("Unexpected extra characters after slice spec in \"%s\"", arg);
|
||||
@@ -330,9 +330,9 @@ static void parseArg(int ch, char *arg) {
|
||||
error("Number of palettes ('-n') must be a valid number, not \"%s\"", arg);
|
||||
}
|
||||
if (number > 256) {
|
||||
error("Number of palettes ('-n') must not exceed 256!");
|
||||
error("Number of palettes ('-n') must not exceed 256");
|
||||
} else if (number == 0) {
|
||||
error("Number of palettes ('-n') may not be 0!");
|
||||
error("Number of palettes ('-n') may not be 0");
|
||||
} else {
|
||||
options.nbPalettes = number;
|
||||
}
|
||||
@@ -388,9 +388,9 @@ static void parseArg(int ch, char *arg) {
|
||||
error("Palette size ('-s') must be a valid number, not \"%s\"", arg);
|
||||
}
|
||||
if (options.nbColorsPerPal > 4) {
|
||||
error("Palette size ('-s') must not exceed 4!");
|
||||
error("Palette size ('-s') must not exceed 4");
|
||||
} else if (options.nbColorsPerPal == 0) {
|
||||
error("Palette size ('-s') may not be 0!");
|
||||
error("Palette size ('-s') may not be 0");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -608,7 +608,7 @@ static void verboseOutputConfig() {
|
||||
if (localOptions.reverse) {
|
||||
fprintf(stderr, "\tReverse image width: %" PRIu16 " tiles\n", options.reversedWidth);
|
||||
}
|
||||
fputs("Ready.\n", stderr);
|
||||
fputs("Ready for conversion\n", stderr);
|
||||
|
||||
style_Reset(stderr);
|
||||
}
|
||||
|
||||
@@ -132,15 +132,15 @@ struct Image {
|
||||
|
||||
// Validate input slice
|
||||
if (options.inputSlice.width == 0 && png.width % 8 != 0) {
|
||||
fatal("Image width (%" PRIu32 " pixels) is not a multiple of 8!", png.width);
|
||||
fatal("Image width (%" PRIu32 " pixels) is not a multiple of 8", png.width);
|
||||
}
|
||||
if (options.inputSlice.height == 0 && png.height % 8 != 0) {
|
||||
fatal("Image height (%" PRIu32 " pixels) is not a multiple of 8!", png.height);
|
||||
fatal("Image height (%" PRIu32 " pixels) is not a multiple of 8", png.height);
|
||||
}
|
||||
if (options.inputSlice.right() > png.width || options.inputSlice.bottom() > png.height) {
|
||||
error(
|
||||
"Image slice ((%" PRIu16 ", %" PRIu16 ") to (%" PRIu32 ", %" PRIu32
|
||||
")) is outside the image bounds (%" PRIu32 "x%" PRIu32 ")!",
|
||||
")) is outside the image bounds (%" PRIu32 "x%" PRIu32 ")",
|
||||
options.inputSlice.left,
|
||||
options.inputSlice.top,
|
||||
options.inputSlice.right(),
|
||||
@@ -319,7 +319,7 @@ static void generatePalSpec(Image const &image) {
|
||||
// Generate a palette spec from the first few colors in the embedded palette
|
||||
std::vector<Rgba> const &embPal = image.png.palette;
|
||||
if (embPal.empty()) {
|
||||
fatal("\"-c embedded\" was given, but the PNG does not have an embedded palette!");
|
||||
fatal("\"-c embedded\" was given, but the PNG does not have an embedded palette");
|
||||
}
|
||||
|
||||
// Ignore extraneous colors if they are unused
|
||||
@@ -821,7 +821,7 @@ static UniqueTiles dedupTiles(
|
||||
if (inputWithoutOutput && matchType == TileData::NOPE) {
|
||||
error(
|
||||
"Tile at (%" PRIu32 ", %" PRIu32
|
||||
") is not within the input tileset, and '-o' was not given!",
|
||||
") is not within the input tileset, and '-o' was not given",
|
||||
tile.x,
|
||||
tile.y
|
||||
);
|
||||
@@ -973,7 +973,7 @@ void process() {
|
||||
|
||||
if (tileColors.size() > options.maxOpaqueColors()) {
|
||||
fatal(
|
||||
"Tile at (%" PRIu32 ", %" PRIu32 ") has %zu colors, more than %" PRIu8 "!",
|
||||
"Tile at (%" PRIu32 ", %" PRIu32 ") has %zu colors, more than %" PRIu8,
|
||||
tile.x,
|
||||
tile.y,
|
||||
tileColors.size(),
|
||||
@@ -1001,7 +1001,7 @@ void process() {
|
||||
continue;
|
||||
}
|
||||
fatal(
|
||||
"Tile (%" PRIu32 ", %" PRIu32 ") contains the background color (#%08x)!",
|
||||
"Tile (%" PRIu32 ", %" PRIu32 ") contains the background color (#%08x)",
|
||||
tile.x,
|
||||
tile.y,
|
||||
options.bgColor->toCSS()
|
||||
|
||||
@@ -112,15 +112,15 @@ void reverse() {
|
||||
// Check for weird flag combinations
|
||||
|
||||
if (options.output.empty()) {
|
||||
fatal("Tile data must be provided when reversing an image!");
|
||||
fatal("Tile data must be provided when reversing an image");
|
||||
}
|
||||
|
||||
if (options.allowDedup && options.tilemap.empty()) {
|
||||
warnx("Tile deduplication is enabled, but no tilemap is provided?");
|
||||
warnx("Tile deduplication is enabled, but no tilemap is provided");
|
||||
}
|
||||
|
||||
if (options.useColorCurve) {
|
||||
warnx("The color curve is not yet supported in reverse mode...");
|
||||
warnx("The color curve is not yet supported in reverse mode");
|
||||
}
|
||||
|
||||
if (options.inputSlice.left != 0 || options.inputSlice.top != 0
|
||||
@@ -149,13 +149,13 @@ void reverse() {
|
||||
|
||||
// By default, assume tiles are not deduplicated, and add the (allegedly) trimmed tiles
|
||||
size_t const nbTiles = tiles.size() / tileSize;
|
||||
verbosePrint(VERB_INFO, "Read %zu tiles.\n", nbTiles);
|
||||
verbosePrint(VERB_INFO, "Read %zu tiles\n", nbTiles);
|
||||
size_t mapSize = nbTiles + options.trim; // Image size in tiles
|
||||
std::optional<std::vector<uint8_t>> tilemap;
|
||||
if (!options.tilemap.empty()) {
|
||||
tilemap = readInto(options.tilemap);
|
||||
mapSize = tilemap->size();
|
||||
verbosePrint(VERB_INFO, "Read %zu tilemap entries.\n", mapSize);
|
||||
verbosePrint(VERB_INFO, "Read %zu tilemap entries\n", mapSize);
|
||||
}
|
||||
|
||||
if (mapSize == 0) {
|
||||
@@ -224,7 +224,7 @@ void reverse() {
|
||||
break;
|
||||
} else if (nbRead != buf.size()) {
|
||||
fatal(
|
||||
"Palette data size (%zu) is not a multiple of %zu bytes!\n",
|
||||
"Palette data size (%zu) is not a multiple of %zu bytes\n",
|
||||
palettes.size() * buf.size() + nbRead,
|
||||
buf.size()
|
||||
);
|
||||
@@ -250,7 +250,7 @@ void reverse() {
|
||||
}
|
||||
|
||||
if (options.palSpecType == Options::EXPLICIT && palettes != options.palSpec) {
|
||||
warnx("Colors in the palette file do not match those specified with '-c'!");
|
||||
warnx("Colors in the palette file do not match those specified with '-c'");
|
||||
// This spacing aligns "...versus with `-c`" above the column of `-c` palettes
|
||||
fputs("Colors specified in the palette file: ...versus with '-c':\n", stderr);
|
||||
for (size_t i = 0; i < palettes.size() && i < options.palSpec.size(); ++i) {
|
||||
@@ -272,7 +272,7 @@ void reverse() {
|
||||
}
|
||||
} else if (options.palSpecType == Options::EMBEDDED) {
|
||||
warnx("An embedded palette was requested, but no palette file was specified; ignoring "
|
||||
"request.");
|
||||
"request");
|
||||
} else if (options.palSpecType == Options::EXPLICIT) {
|
||||
palettes = std::move(options.palSpec); // We won't be using it again.
|
||||
}
|
||||
@@ -299,7 +299,8 @@ void reverse() {
|
||||
|
||||
if (uint8_t palID = (attr & 0b111) - options.basePalID; palID > palettes.size()) {
|
||||
error(
|
||||
"Attribute map references palette #%u at (%zu, %zu), but there are only %zu!",
|
||||
"Attribute map references palette #%u at (%zu, %zu), but there are only %zu "
|
||||
"palettes",
|
||||
palID,
|
||||
tx,
|
||||
ty,
|
||||
|
||||
Reference in New Issue
Block a user