gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit ffe934a8435f65493b47585de49edec75a15b373 parent eb2a7e2a5769653b6188b3d104012b74812ff681 Author: Toxa <untoxa@mail.ru> Date: Fri, 27 May 2022 12:26:52 +0300 only export _tile_pals[] arrays when -use-structs is set (ZGB specific feature) Diffstat:
| M | gbdk-support/png2asset/png2asset.cpp | 44 | +++++++++++++++++++++++--------------------- |
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/gbdk-support/png2asset/png2asset.cpp b/gbdk-support/png2asset/png2asset.cpp @@ -997,12 +997,15 @@ int main(int argc, char* argv[]) fprintf(file, "%s_map_attributes\n", data_name.c_str()); else fprintf(file, "0\n"); - - fprintf(file, "#define %s_TILE_PALS ", data_name.c_str()); - if(use_map_attributes) - fprintf(file, "0\n"); - else - fprintf(file, "%s_tile_pals\n", data_name.c_str()); + + if(use_structs) + { + fprintf(file, "#define %s_TILE_PALS ", data_name.c_str()); + if(use_map_attributes) + fprintf(file, "0\n"); + else + fprintf(file, "%s_tile_pals\n", data_name.c_str()); + } } else { @@ -1035,7 +1038,7 @@ int main(int argc, char* argv[]) fprintf(file, "extern const unsigned char %s_map_attributes[%d];\n", data_name.c_str(), (unsigned int)map_attributes.size()); } } - else if (includeTileData) + else if ((includeTileData) && (use_structs)) fprintf(file, "extern const unsigned char* %s_tile_pals[%d];\n", data_name.c_str(), (unsigned int)tiles.size()); } else @@ -1157,22 +1160,21 @@ int main(int argc, char* argv[]) else { if (includeTileData) { - //Export tiles pals (if any) - if(!use_map_attributes) - { - fprintf(file, "\n"); - fprintf(file, "const uint8_t %s_tile_pals[%d] = {\n\t", data_name.c_str(), (unsigned int)tiles.size()- source_tileset_size); - for(vector< Tile >::iterator it = tiles.begin()+ source_tileset_size; it != tiles.end(); ++ it) - { - if(it != tiles.begin()) - fprintf(file, ", "); - fprintf(file, "%d", it->pal); - } - fprintf(file, "\n};\n"); - } - if(use_structs) { + //Export tiles pals (if any) + if(!use_map_attributes) + { + fprintf(file, "\n"); + fprintf(file, "const uint8_t %s_tile_pals[%d] = {\n\t", data_name.c_str(), (unsigned int)tiles.size()- source_tileset_size); + for(vector< Tile >::iterator it = tiles.begin()+ source_tileset_size; it != tiles.end(); ++ it) + { + if(it != tiles.begin()) + fprintf(file, ", "); + fprintf(file, "%d", it->pal); + } + fprintf(file, "\n};\n"); + } //Export Tiles Info fprintf(file, "\n"); fprintf(file, "#include \"TilesInfo.h\"\n");
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.