git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 6e1716a175bec5b7114dc9b96f802cdc813a93bf
parent 168f6f72bdf21faa70b6b3f97bcea2a084b5b680
Author: Toxa <untoxa@mail.ru>
Date:   Mon, 26 Feb 2024 22:55:48 +0300

PNG2ASSET: round up to at least one palette when using -keep_palette_order

Diffstat:
Mgbdk-support/png2asset/image_data.cpp2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gbdk-support/png2asset/image_data.cpp b/gbdk-support/png2asset/image_data.cpp @@ -66,7 +66,7 @@ int ReadImageData_KeepPaletteOrder( PNG2AssetData* assetData, string input_file // Use source image palette since lodepng conversion to indexed (LCT_PALETTE) won't create a palette // So: state->info_png.color.palette/size instead of state->info_raw.palette/size - unsigned int palette_count = PaletteCountApplyMaxLimit((unsigned int)assetData->args->max_palettes, (unsigned int)(state.info_png.color.palettesize / assetData->image.colors_per_pal)); + unsigned int palette_count = PaletteCountApplyMaxLimit((unsigned int)assetData->args->max_palettes, (unsigned int)((state.info_png.color.palettesize + assetData->image.colors_per_pal - 1) / assetData->image.colors_per_pal)); assetData->image.total_color_count = palette_count * assetData->image.colors_per_pal; // Copy the palette data since the source buffer (state...) won't exist outside the scope of this function assetData->image.palette = new unsigned char[assetData->image.total_color_count * RGBA32_SZ];

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.