Rangi
4a6ea35299
Avoid overflow in counting tiles for unrealistically large images
2026-07-13 17:47:38 -04:00
Rangi
21eaa2d2cc
Fix a > to >=, and avoid underflow in some sanity checks
2026-07-13 13:14:06 -04:00
Rangi
4857ad1e00
Fix crash on image without any colors (all transparent)
2026-07-11 13:18:40 -04:00
Rangi
3b33c942ae
Fix a crash and a limitation in RGBGFX unoptimized output
...
- If both banks 0 and 1 were completely filled, then
`assume(bank == 0)` would false and potentially crash.
- If the input image had fully-background tiles, they would be
incorrectly counted towards `nbTiles` and could cause the
"Image contains N tiles, exceeding the limit" check to fail.
2026-07-11 12:32:31 -04:00
Rangi
be4c1161bd
Fix RGBGFX crash when trimming more tiles than exist after deduplication
2026-07-10 17:35:32 -04:00
Rangi
118f1f7543
Correct option letter in error message
2026-07-10 16:59:30 -04:00
Rangi
eaa35ed26d
Remove dead return after no-return fatal call
2026-07-10 14:36:46 -04:00
Rangi
7b39bcd412
Refactor expression for clarity
...
`tileData[realY + 1 % options.bitDepth]` relied on order of
operations and the fact that `1 % 1 == 0` but `1 % 2 == 1` for
correct indexing. However, it was not obvious at first glance,
and confusable with the more common `(base + offset) % size`
pattern. (And would need changing anyway if we ever support 4bpp.)
2026-07-10 14:30:25 -04:00
Rangi
255cd7f7f6
Fix a typo in a comment
2026-07-10 14:29:32 -04:00
Rangi
39e7e064c9
Print correct color set limit value in error message
2026-07-09 21:29:02 -04:00
Rangi
7b97d7ce15
Fix RGBGFX crash on deduplicating transparent tiles
2026-07-09 21:24:59 -04:00
Rangi
c667bac93a
Use trailing return type for begin()/end()
2026-07-08 16:57:52 -04:00
Rangi
db96144d49
Use [[nodiscard]] instead of [[gnu::warn_unused_result]]
2026-07-08 16:44:15 -04:00
Rangi
276a1a7952
Use const_cast more precisely to remove const without changing type
2026-07-08 16:42:53 -04:00
Rangi
5aedf31b46
Prevent 32-bit multiplication overflow
...
Basically impossible to achieve, but just in case
2026-07-07 17:02:46 -04:00
Rangi
6e643406a2
Refactor warning diagnostic code to reduce repeated output logic
2026-07-04 23:02:16 -04:00
Rangi
2f604bfa9a
Fix error message when an rgbgfx output file cannot be created
2026-07-03 13:08:28 -04:00
vulcandth
998f636495
Fix rgbgfx -Z palette overgeneration on merged color sets ( #1912 )
...
- Fix logic for color set comparison (which affects sorting them)
- Prune color sets which are proper subsets of newly-encountered ones
(a comment implied we were already doing this, but we weren't)
- Add more verbose logging to debug this behavior
2026-06-07 09:55:05 -04:00
Rangi
996469ee28
Ensure CRLF line endings are preserved when necessary
...
Some test cases need CRLF line endings checked out even on Unix.
Also some source files had inadvertently contained CR bytes.
2026-05-25 22:00:45 -04:00
Rangi
dce14fd4b8
Use C++20 concepts to require constraints on template parameters ( #1977 )
2026-05-22 17:54:34 -04:00
Rangi
728bed39d5
Do not support GCC 9 ( #1978 )
...
This will let us use C++20 features that GCC 9's experimental
C++20 support did not yet cover, such as "concepts".
This reverts some commits:
- 6bcd79b997
- d5ce5329ea
- 728d14879b
2026-05-22 16:46:46 -04:00
Rangi
48fcd9a0ca
Use templates to reduce the redundant number-lexing functions ( #1963 )
2026-05-21 23:13:09 +02:00
ISSOtm
6bcd79b997
Revert "Derive operator!= from operator== ( #1660 )"
...
This reverts commit 993879a2ed .
2026-04-26 23:30:59 +02:00
Rangi42
12186fdccc
Keep more non-declaration initialization within the for loop clause
2026-04-19 22:01:56 +02:00
ISSOtm
d054f07703
Fix some truncation warnings
...
Amusingly, reported by MSVC only
2026-03-10 01:31:23 -04:00
Rangi
d053025070
Avoid writing "XXX" since it's a conventional "TODO/FIXME" comment
2026-01-22 13:01:10 -05:00
Rangi
a9ab248fed
Improve some RGBGFX error messages ( #1876 )
...
* Improve some RGBGFX error messages
* Fix assertion failure on ambiguous transparent/opaque pixels
2025-12-19 13:00:05 -05:00
Rangi
2666dcbc26
Remove exclamation marks and periods from error messages ( #1874 )
2025-12-10 11:50:33 -05:00
Rangi
33475e2c36
Factor out version-printing to usage.cpp ( #1870 )
2025-12-05 23:04:49 -05:00
Rangi
1eb4eb3339
Reuse the usage.name for printing version info
2025-11-18 22:32:45 -05:00
Rangi42
ca383c91ca
Revert "More accurate 8-bit <=> 5-bit RGB color conversion ( #1827 )"
...
This reverts commit 223b3d1921 .
2025-10-24 13:32:59 -04:00
Rangi
efb5a88edb
Show conventional colored "error:"/"FATAL:" for CLI option errors
2025-10-23 12:40:29 -04:00
Rangi
f065243cd2
Enable RGBGFX's CLI "at-files" for all programs ( #1848 )
2025-10-22 17:05:59 -04:00
Rangi
7462bccb72
Move struct Palette into its own file ( #1850 )
2025-10-20 16:59:24 -04:00
Rangi
1badba03d8
Clean up some #define callables
...
These are used where anonymous functions would not be sufficient
2025-10-13 13:14:49 -04:00
Rangi42
651877e094
Avoid reusing a static local variable (too fragile)
2025-10-08 21:19:23 -04:00
Rangi
23b9039716
Give clearer names to template parameters
2025-10-08 14:55:43 -04:00
Rangi42
837f552987
Fix bank increment never happening due to unsigned overflow
2025-10-07 16:20:24 -04:00
Rangi
cca3794dd0
Mention libpng in its internal warning and error messages
2025-10-06 17:03:51 -04:00
Rangi42
0297da4d4c
Add more tests for RGBASM coverage
2025-09-25 13:30:30 -04:00
Rangi42
0670c03bc2
Add CLI tests for RGBASM
2025-09-25 11:57:56 -04:00
Rangi
634fd853d1
Factor out a single parseNumber utility function ( #1839 )
2025-09-22 15:15:24 -04:00
Rangi42
c8d22d8744
Refactor some iterator template code in RGBGFX pal_packing.cpp
2025-09-21 10:59:59 -04:00
Rangi42
3ece61b103
Use fewer templates in RGBGFX pal_packing.cpp
2025-09-20 22:00:17 -04:00
Rangi42
a82fd17529
Simplify RGBGFX code by using fewer templates
2025-09-20 21:06:51 -04:00
Rangi42
e7f5ab3f55
Warn about rgbgfx -O without -o or any of -A -T -P -Q
2025-09-20 20:23:29 -04:00
Rangi42
d8aff148bb
Factor out RRANGE macro like RANGE
2025-09-19 16:53:44 -04:00
Rangi
223b3d1921
More accurate 8-bit <=> 5-bit RGB color conversion ( #1827 )
2025-09-08 15:13:25 -04:00
Rangi42
1dfc1d3231
Factor out isBinDigit and parseHexDigit utility functions
2025-09-04 13:23:10 -04:00
Rangi42
2110aaca20
Fix RGBLINK and RGBGFX warning/error message colors
2025-09-01 20:51:33 -04:00