94 Commits

Author SHA1 Message Date
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
26c48cc409 Add RGBGFX test for libpng warning with invalid bKGD chunk 2025-10-08 15:44:15 -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
Rangi
634fd853d1 Factor out a single parseNumber utility function (#1839) 2025-09-22 15:15:24 -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
Rangi
223b3d1921 More accurate 8-bit <=> 5-bit RGB color conversion (#1827) 2025-09-08 15:13:25 -04:00
Rangi
3d155d5695 Some refactoring and cleanup (#1806)
* Use clang-tidy `misc-include-cleaner` for IWYU `#include` cleanup

* Use `std::optional<size_t>` instead of `ssize_t`

* Rename some functions in linkdefs.hpp

* Fix header order
2025-08-20 16:09:04 -04:00
Rangi
7b405513d9 Make quote marks consistent in error/warning messages (#1791)
- "Double quotes" for strings (filenames, section names, CLI option arguments, etc)
- 'Single quotes' for characters and CLI option flags
- `Backticks` for keywords and identifiers (symbol names, charmap names, etc)

CLI option flags also have their leading dashes
2025-08-12 15:24:21 -04:00
Rangi42
30a8503dcd Format RGBFIX and RGBGFX warnings/errors the same way as RGBASM and RGBLINK 2025-08-11 15:16:00 -04:00
Rangi42
a3983b7b0f Support rgbgfx -c dmg to imply -c dmg=e4
Fixes #1776
2025-08-05 14:18:25 -04:00
Rangi
7e151f16c3 Factor out a single PNG-reading function to encapsulate the libpng API (#1765) 2025-07-23 15:53:33 -04:00
Rangi
ad81c74cda Support PNG-format palette spec files (#1764) 2025-07-21 11:33:16 -04:00
Rangi42
ddb2acb652 Reduce more nesting depth, and fix an error message 2025-07-12 08:17:26 -04:00
Rangi
3f4e8396aa Implement warning diagnostic flags for RGBGFX (#1738) 2025-07-10 09:58:40 -04:00
Rangi
5de05e2e4b Replace DefaultInitVec with std::vector (#1732) 2025-07-08 14:55:28 -04:00
Rangi42
185a3b29e6 Implement base palette ID 2025-07-06 12:57:20 +02:00
Rangi42
965288de38 Fix out-of-bounds image slices 2025-07-02 19:43:11 +02:00
Rangi
7054d81650 Implement grayscale DMG palette specs (#1709) 2025-06-30 14:53:05 -04:00
Rangi
122d91509f Clear some more TODO comments (#1677) 2025-05-02 21:06:34 -04:00
Rangi
7c6f778ae7 Take care of miscellaneous commented TODOs (#1676) 2025-05-02 16:44:12 -04:00
Eldred Habert
8cf6c5423a Implement --background-color (#1508)
Co-authored-by: Rangi42 <sylvie.oukaour+rangi42@gmail.com>
2025-05-01 23:39:52 -04:00
Rangi
2a5b9b5f98 Fix two RGBGFX bugs (#1671)
* Fix two RGBGFX bugs

* Fix clang-format idempotence

* Update src/gfx/rgba.cpp

Co-authored-by: Eldred Habert <me@eldred.fr>

---------

Co-authored-by: Eldred Habert <me@eldred.fr>
2025-04-24 15:39:14 +02:00
Rangi
632342b254 Use LCOV_EXCL comments to exclude some lines from test coverage (#1662) 2025-02-16 13:56:55 -05:00
Rangi
a59867cd78 Consistently use LF line endings in expected .out and .err output (#1635)
Test scripts compare files as text
2025-01-28 21:24:40 -05:00
Rangi42
cae31005f8 Always use braces with InsertBraces: true in .clang-format 2025-01-27 20:12:12 -05:00
Rangi42
25c9f8f383 Add more rules to .clang-format 2025-01-27 20:12:12 -05:00
Rangi42
01c9106b59 Include windows.h before other Win32 header files 2025-01-27 20:12:12 -05:00
Rangi
e561f63db3 Run internal tests in Cygwin (#1592) 2025-01-17 18:31:37 -05:00
Rangi42
4e2464a69d Replace some #define with constexpr 2025-01-04 03:53:59 -05:00
Rangi
06daf2a9b5 Include <signal.h> in rgbgfx_test.cpp (#1589) 2024-12-30 23:22:14 +01:00
Sylvie
b877c81c32 Use C++-style casts (#1576) 2024-12-09 21:56:54 -05:00
Rangi42
81c3521610 Add color_curve RGBGFX test 2024-11-27 21:06:18 +01:00
Sylvie
e0ee9dc3ad Add reverse_1bit RGBGFX test (#1555)
Fixes a bug to always use 2bpp `_data` in `TileData`
2024-11-24 19:30:49 -05:00
Sylvie
a7fdb2c3d3 Add more RGBGFX test coverage (#1553) 2024-10-27 11:32:21 -04:00
Sylvie
9783671399 Simplify some C++ abstractions (#1518)
* Remove namespaces
* Prefer `bool operator==`, not `friend auto operator==`
* Prefer not to use `using`
* Use a `constexpr` function instead of a template for `flipTable`
2024-09-26 00:07:27 -04:00
Eldred Habert
80d37f9988 Implement --input-tileset (#1464)
As discussed in https://github.com/gbdev/rgbds/issues/575#issuecomment-1991456862
2024-09-04 15:20:01 -04:00
Rangi42
c07371c9fc Revert "Show test issues as annotations in the GitHub Actions job summary"
This reverts commit 3a5ff35928.

Annotations were not actually appearing.
<https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions>
2024-08-27 14:07:35 -04:00
Rangi42
3a5ff35928 Show test issues as annotations in the GitHub Actions job summary 2024-08-27 01:02:53 -04:00
Sylvie
81ab133566 Enable more testing of RGBGFX output (#1473) 2024-08-22 19:19:39 +02:00
Rangi42
731715ff36 Refactor test.sh scripts for consistency 2024-08-18 21:38:45 -04:00
ISSOtm
68a6abd00e Fix ProtoPalette::compare
The function only stopped at the end of the *arrays*,
not of *their used portions*!
This could cause false negatives one way or the other.

This appears not to affect the palette packing, since the packing algorithm
deals with them efficiently; but it should speed up processing slightly,
and as the test changes show, it also improves the UX of palette packing
error messages!
2024-08-14 17:36:15 +02:00
ISSOtm
b20b2dd28c Pass CXX env var through when compiling RGBGFX test binaries 2024-08-08 20:45:36 +02:00
ISSOtm
2a85009b6b Be verbose about building the RGBGFX test binaries
People may not expect that to happen!
And CI would be easier to debug that way, too.
2024-08-08 20:45:36 +02:00
Sylvie
0cd79c33ef Fix RGBGFX reversal (#1425)
* Print all OoB tilemap IDs before aborting

* Rename `nbTileInstances` to `mapSize`

* Check that reversing doesn't overflow the tile array

---------

Co-authored-by: ISSOtm <me@eldred.fr>
2024-08-08 19:40:41 +02:00
ISSOtm
747427e801 Make test/gfx/at-file-ref consistent
The generated `result.pal` can change between platforms, it turns out
(due to "unstable sort" differences), and creates additional churn if
changing anything related to palette generation.

tl;dr this makes the test less flaky in the long run.
2024-08-08 12:23:12 +02:00
ISSOtm
0f1137c6ec Fix ineffective sorting of palettes pre-packing
We were sorting the *IDs*, not the proto-palettes...
2024-08-08 11:31:46 +02:00
ISSOtm
3d1f5386c2 Fix parsing of GPL files
Can you tell this was *not* tested whatsoever?
2024-08-02 22:36:33 -04:00
ISSOtm
1f8f28cac8 Fix parsing of textual colours
`n`'s input value was not honored, and its updating logic incorrect
2024-08-02 22:36:33 -04:00
ISSOtm
8e60d1f0b8 Fix textual palettes not accepting to be filled
A weird case of off-by-one error
2024-08-02 22:36:33 -04:00