Flexible and composable tile graphics converter supporting Super Nintendo, Game Boy, Game Boy Color, Game Boy Advance, Mega Drive, PC Engine and WonderSwan formats.
MIT License
152
stars
22
forks
source link
Errors when using no remap, json palettes and 2 BPP mode #27
In the code here: https://github.com/Optiroc/SuperFamiconv/blob/master/src/Palette.cpp#L93,
this check seems wrong when using 2 BPP or more that 1 palette. If the check fails, SuperFamiconv throws an exception and enters the catch block and tries to read the json palette as a binary palette with pretty random results.
In my case, I have a 16 colors palette in the original image that I expect SuperFamiconv to convert to 4 palettes with 4 colors each in 2 bpp mode. The check fails because 16 colors is greater than 4.
Using native binary palettes instead seems to work ok.
In the code here: https://github.com/Optiroc/SuperFamiconv/blob/master/src/Palette.cpp#L93, this check seems wrong when using 2 BPP or more that 1 palette. If the check fails, SuperFamiconv throws an exception and enters the catch block and tries to read the json palette as a binary palette with pretty random results.
In my case, I have a 16 colors palette in the original image that I expect SuperFamiconv to convert to 4 palettes with 4 colors each in 2 bpp mode. The check fails because 16 colors is greater than 4.
Using native binary palettes instead seems to work ok.