ISSOtm
05e36767b0
Implement "palette map" output
2022-07-02 17:04:17 +02:00
ISSOtm
531092f5bd
Add corrupted PNGs to check error handling
...
This is not intended to test libpng as much as checking that
we behave correctly if libpng gives us an error
2022-07-02 17:04:17 +02:00
ISSOtm
4c51792f15
Allow testing RGBGFX with specific images as input
...
No such tests yet, but the infrastructure will be there.
2022-07-02 17:04:17 +02:00
ISSOtm
c4359c1058
Ignore -b and -N when reversing without tilemap
...
These offsets should only be applied to a tile ID read as input... but this ain't one!
2022-07-02 17:04:17 +02:00
ISSOtm
159efe1257
Transfer test programs as well for cross-testing
2022-07-02 17:04:17 +02:00
ISSOtm
3cfe7800c7
Make randtilegen and rgbgfx_test compile with MSVC
2022-07-02 17:04:17 +02:00
ISSOtm
01cf0c5f98
Print RGBGFX test names
2022-07-02 17:04:17 +02:00
ISSOtm
0dbcebfeb4
Have CMake build and install steps be verbose
2022-07-02 17:04:17 +02:00
ISSOtm
491b6746ab
Clean RGBGFX test programs with make clean
2022-07-02 17:04:17 +02:00
ISSOtm
cbf6fadcdb
Add RGBGFX tests
2022-07-02 17:04:17 +02:00
ISSOtm
a77b0b396a
Fix grayscale sorting not setting palette size
...
A black+white palette would turn into white+transparent, removing black pixels
from the palette (the third slot would be empty, and the 4th slot be set directly)
2022-07-02 17:04:17 +02:00
ISSOtm
568fb5e4c8
Only report "fusing" different colors once per pair
2022-07-02 17:04:17 +02:00
ISSOtm
82012f698e
Fix alpha channel checking in RGBGFX test driver
...
Compare CGB colors only, including ignoring RGB components if alpha says
the color is transparent
2022-07-02 17:04:17 +02:00
ISSOtm
57ac07b03e
Correctly handle fully-transparent tiles when outputting unoptimized tilemap
2022-07-02 17:04:17 +02:00
ISSOtm
c521233499
Fix ProtoPalette::compare
...
Some disjoint sets were mistakenly reported not as such
For example, {0} was considered to include {1}.
2022-07-02 17:04:17 +02:00
ISSOtm
bf869f6961
Fix memory leak in test driver program
...
Teeny tiny
2022-07-02 17:04:17 +02:00
ISSOtm
0f8cbb1faf
Generate all necessary files for RGBGFX tests
2022-07-02 17:04:17 +02:00
ISSOtm
fcce42d3d2
Avoid sorting proto-palettes breaking mappings
...
The sorting was performed without updating the mappings, which broke the world.
We can instead sort the IDs as they are inserted into the packing queue,
which should also be faster than moving the actual proto-pal objects around.
2022-07-02 17:04:17 +02:00
ISSOtm
f5d4126303
Report when an input "tile" contains too many colors
...
Which otherwise trips a later assertion in debug mode (phew!)
and crashes in release mode (oops)
2022-07-02 17:04:17 +02:00
ISSOtm
78e751f022
Fix reading interlaced PNGs
...
Either we let libpng handle the transform, or we don't.
But make up your mind!
2022-07-02 17:04:17 +02:00
ISSOtm
d569c6392c
Avoid initializing the PNG row
...
It gets overwritten right after, and uncovers an error in the interlaced read
2022-07-02 17:04:17 +02:00
ISSOtm
75b9d48990
Make randtilegen report the file names it fails to open
...
Which of the two is erroring out can be inferred from the file name,
anyway.
2022-07-02 17:04:17 +02:00
ISSOtm
3aabe9c799
Move randtilegen to test/gfx subdir
...
It's tool-specific, so categorize it where it belongs
2022-07-02 17:04:17 +02:00
ISSOtm
5be2b96b40
Remove incorrect check for reversed image width
...
That check was when the image width was in tiles, and another check right below
is the correct equivalent for the new pixel-unit argument
2022-07-02 17:04:17 +02:00
ISSOtm
7fdfbbbbba
Fix inverted condition in tile dedup warning
2022-07-02 17:04:17 +02:00
ISSOtm
7fdc6cbced
Fix erroneous tabs in rgbgfx usage text
...
Thanks @GreenAndEievui!
2022-07-02 17:04:17 +02:00
ISSOtm
56115653ef
Include cross-ref link to at-files where mentioned
2022-07-02 17:04:17 +02:00
ISSOtm
7927dfd2e3
Remove negative values in parseNumber checking
...
Including removal of a dead & useless check.
By the way, fuck integer promotion.
2022-07-02 17:04:17 +02:00
ISSOtm
b1aec91912
Assert that row size is not null
...
Silences some static analysis warning
2022-07-02 17:04:17 +02:00
ISSOtm
7defaad9d2
Remove placeholder palette output format from -p
...
This is now described in its own section
2022-07-02 17:04:17 +02:00
ISSOtm
dc9185e50b
Make output format descriptions more succinct and link to Pan Docs
2022-07-02 17:04:17 +02:00
ISSOtm
02d957278d
Document output formats
2022-07-02 17:04:17 +02:00
ISSOtm
6feb1fb73a
Retire -f
2022-07-02 17:04:17 +02:00
ISSOtm
dc67f152a9
Document accepted external palette formats
2022-07-02 17:04:17 +02:00
ISSOtm
913c3dd711
Accept both colons and semicolons in inline pal spec
2022-07-02 17:04:17 +02:00
ISSOtm
32242e0ff2
Switch from colon separators to semicolon
...
As documented, oops
2022-07-02 17:04:17 +02:00
ISSOtm
91071009a8
Implement some external palette specs
...
PSP, ACT, and ACO are complete
2022-07-02 17:04:17 +02:00
ISSOtm
1da884db15
Handle processing errors appropriately
...
Alter the return status accordingly, and print the error counts on exit
2022-07-02 17:04:17 +02:00
ISSOtm
ef473de75a
Explicitly error out if no input image is given
2022-07-02 17:04:17 +02:00
ISSOtm
6b0cab32a6
Implement inline palette spec parsing
2022-07-02 17:04:17 +02:00
ISSOtm
cc27169ecd
Implement preliminary version of "reverse" feature
...
Not hooked to all RGBGFX flags yet, but good enough for most use cases
(and as a base for future development, should I need to `reset --hard`.)
TODOs marked appropriately.
2022-07-02 17:04:17 +02:00
ISSOtm
843022772b
Clean up randtilegen
...
Apply review comments
2022-07-02 17:04:17 +02:00
ISSOtm
75f8b16f33
Implement "at-files" for RGBGFX
...
Useful for persisting flags outside of the build system
2022-07-02 17:04:17 +02:00
ISSOtm
188027bccc
Rename convert to process
...
More consistent with its "main" function's name
2022-07-02 17:04:17 +02:00
ISSOtm
79adcdb7ea
Ignore tested sub-projects
2022-07-02 17:04:17 +02:00
ISSOtm
8ed65078da
Import fixes to random image generator
2022-07-02 17:04:17 +02:00
ISSOtm
7311fc9ef8
Fix transparency handling
...
Ensure that the color count is properly used, and that
transparency is not counted as a color when packing palettes
2022-07-02 17:04:17 +02:00
ISSOtm
7d54145e56
Record "seed" when generating images as well
...
For reproducibility
2022-07-02 17:04:17 +02:00
ISSOtm
e753b62d1a
Add program by @aaaaaa123456789 to generate RGBGFX-able images
2022-07-02 17:04:17 +02:00
ISSOtm and Rangi
6ed220b4c1
Make some style corrections
...
Co-Authored-By: Rangi <[email protected] >
2022-07-02 17:04:17 +02:00
ISSOtm
e49fb457ea
Factor out row bitplanes extraction into a common function
2022-07-02 17:04:17 +02:00
ISSOtm
3c9d5b05d6
Implement transparency handling
...
Though none of this has been tested so far...
2022-07-02 17:04:17 +02:00
ISSOtm
e86eb9337a
Check the range of the CLI-specified palette size
2022-07-02 17:04:17 +02:00
ISSOtm
b0f8e04fb7
Do not do anything if option parsing goes wrong
2022-07-02 17:04:17 +02:00
ISSOtm
493b94919f
Fix -TAP being non-functional
2022-07-02 17:04:17 +02:00
ISSOtm
71e22f3bfe
Correct "is this palette empty?" function
...
This notably caused decantation to delete non-empty palettes, which crashes
2022-07-02 17:04:17 +02:00
ISSOtm
ac02382632
Clean up palette packing a bit
...
Rename a poorly-named attribute, and add a bunch of debug logging
2022-07-02 17:04:17 +02:00
ISSOtm
943d631701
Implement max palette count
2022-07-02 17:04:17 +02:00
ISSOtm
d2f9cc7e8c
Document accepted number formats
2022-07-02 17:04:17 +02:00
ISSOtm
76bb950be5
Parse bank capacities
2022-07-02 17:04:17 +02:00
ISSOtm
f29c5d81ec
Provide a per-option sane default when number parsing fails
2022-07-02 17:04:17 +02:00
ISSOtm
2307981878
Parse base tile IDs
2022-07-02 17:04:17 +02:00
ISSOtm
6bab2ea5c8
Add different verbosity levels
...
And also some ASCII art, perhaps?
2022-07-02 17:04:17 +02:00
ISSOtm
35e57a55c9
Handle base tile IDs in "optimized" output
2022-07-02 17:04:17 +02:00
ISSOtm
21e9a65f0b
Remove old C headers
2022-07-02 17:04:17 +02:00
ISSOtm
779c8c9368
Implement -m
...
Though none of the code involved has been tested in any capacity yet, lol
2022-07-02 17:04:17 +02:00
ISSOtm
e855b6f622
Include libstdc++-6.dll in 32-bit MinGW build
2022-07-02 17:04:17 +02:00
ISSOtm
3b1808cc8f
Fix Windows-breaking use of struct vs class
...
MSVC's (broken) ABI breaks otherwise.
What the f@!$#ck, Microsoft?
(Thank you based Clang for warning, by the way.)
2022-07-02 17:04:17 +02:00
ISSOtm
71cb2854e8
Use cinttypes instead of inttypes.h
...
Fixes build on some compilers for some reason I fail to understand
2022-07-02 17:04:17 +02:00
ISSOtm
2099a25ee0
Avoid using transform_reduce
...
Not available in libstdc++ 7, apparently
2022-07-02 17:04:17 +02:00
ISSOtm
b9de65c9a2
Set C++ compiler in CI as well
...
Duh
2022-07-02 17:04:17 +02:00
ISSOtm
c82cce6d95
Explicitly specify queue template param
...
GCC 7 fails to deduce the contained type
2022-07-02 17:04:17 +02:00
ISSOtm
97965c9766
Revamp number parsing and remove <charconv>
...
Support all intended formats and allow partial parsing
<charconv> is not available in GCC 7
2022-07-02 17:04:17 +02:00
ISSOtm
5efc49cb12
Change UseTab to ForIndentation
...
This fixes many whitespace issues
2022-07-02 17:04:17 +02:00
ISSOtm
c4361b965c
Remove <filesystem>
...
Should fix compilation with GCC before 9
2022-07-02 17:04:17 +02:00
ISSOtm
8d00a61602
Flesh out man page
...
Describe current options, and add some TODOs for functionality to be implemented
2022-07-02 17:04:17 +02:00
ISSOtm
20442c8a43
Add compatibility hack for unused colors in indexed PNGs
2022-07-02 17:04:17 +02:00
ISSOtm
b95c26c886
Fully implement decanting step
2022-07-02 17:04:17 +02:00
ISSOtm
a96aa1725f
Optimize AssignedProtos::empty() to stop early
...
Also allow counting an `AssignedProtos`'s number of proto-palettes
2022-07-02 17:04:17 +02:00
ISSOtm
3d79f76e41
Avoid calling skipEmpty() for AssignedProtos::end()
2022-07-02 17:04:17 +02:00
ISSOtm
fdfedc45a6
Allow computing the combined weight of any proto-palette set
2022-07-02 17:04:17 +02:00
ISSOtm
c98d92a4c4
Implement -C
2022-07-02 17:04:17 +02:00
ISSOtm
d438838db4
Correctly handle "multiple" overlap between proto-palettes
...
As explained by the comment
2022-07-02 17:04:17 +02:00
ISSOtm
d675523e49
Skip initializing the PNG pixel array
...
We are about to set all of the pixels anyway
2022-07-02 17:04:17 +02:00
ISSOtm
ad07c9deb9
Implement (stub) handling for all options
2022-07-02 17:04:17 +02:00
ISSOtm
bf9f99ebf5
Reorder Options members by usage order
2022-07-02 17:04:17 +02:00
ISSOtm
f0eca86c52
Update checkdiff to check for gfx/main.cpp
2022-07-02 17:04:17 +02:00
ISSOtm
e8d8ae4c78
Print all configuration on verbose startup
2022-07-02 17:04:17 +02:00
ISSOtm
0cc62824b9
Use MinGW C++ compiler as well
2022-07-02 17:04:17 +02:00
ISSOtm
2fb1eb9136
Print file paths in a platform-independent way
...
Conversion may be unspecified, but Windows better do the right thing (or else.)
2022-07-02 17:04:17 +02:00
ISSOtm
bde380f38b
Fix unchecked narrowing conversion of tile IDs
...
The conversion is OK because of the tile amount cap
2022-07-02 17:04:17 +02:00
ISSOtm
38e8024ffa
Add missing return type for unreachable_()
2022-07-02 17:04:17 +02:00
ISSOtm
3bd6078537
Tag AssignedProtos iterator as forward
...
That's what it actually is, oops
(Required for `minmax_element`)
2022-07-02 17:04:17 +02:00
ISSOtm
5409d0d15a
Add missing header for strcasecmp
2022-07-02 17:04:17 +02:00
ISSOtm
9262fefd07
Fix compiling with Clang
...
Force version.c to be compiled as C++ (bodge, will need a proper fix for `version.c`)
Remove user-defined `ProtoPalette` assignment operator (same as default, anyway)
2022-07-02 17:04:17 +02:00
ISSOtm
638d024040
Update subprojects and patch pokecrystal
2022-07-02 17:04:17 +02:00
ISSOtm
3fa1854332
Implement enough functionality to compile & match pokecrystal
2022-07-02 17:04:17 +02:00
ISSOtm
6e406b22bb
Implement more features and fix bugs
2022-07-02 17:04:17 +02:00
ISSOtm
d30e507270
Fix duplicated CGB color calculation in pal sorting
...
And also the inverted alpha channel condition causing the wrong colors
to be treated as transparent
2022-07-02 17:04:17 +02:00
ISSOtm
373a22660b
Switch clang-format to C++17
...
Be consistent with what we settled on in code
2022-07-02 17:04:17 +02:00