gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit e98e4b600284b8fc35547d8bcc2b546c9423ed7a parent 5ba43131351205e6d474817797b63f32420b1ce1 Author: Toxa <untoxa@mail.ru> Date: Wed, 18 Aug 2021 13:30:42 +0300 png2mtspr: include Feng Shui Diffstat:
| M | gbdk-support/png2mtspr/png2mtspr.cpp | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/gbdk-support/png2mtspr/png2mtspr.cpp b/gbdk-support/png2mtspr/png2mtspr.cpp @@ -300,18 +300,25 @@ int main(int argc, char *argv[]) } fprintf(file, "//AUTOGENERATED FILE FROM png2mtspr\n"); + fprintf(file, "#ifndef __%s_H_INCLUDE\n", data_name.c_str()); + fprintf(file, "#define __%s_H_INCLUDE\n", data_name.c_str()); + fprintf(file, "\n"); + fprintf(file, "#include <stdint.h>\n"); + fprintf(file, "#include <gb/metasprites.h>\n"); + fprintf(file, "\n"); fprintf(file, "#define %s_TILE_H %d\n", data_name.c_str(), tile_h); fprintf(file, "#define %s_WIDTH %d\n", data_name.c_str(), sprite_w); fprintf(file, "#define %s_HEIGHT %d\n", data_name.c_str(), sprite_h); fprintf(file, "#define %s_PIVOT_X %d\n", data_name.c_str(), pivot_x); fprintf(file, "#define %s_PIVOT_Y %d\n", data_name.c_str(), pivot_y); fprintf(file, "\n"); - fprintf(file, "extern const UINT8 %s_data[%d];\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); + fprintf(file, "extern const uint8_t %s_data[%d];\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); fprintf(file, "extern const metasprite_t* const %s_metasprites[%d];\n", data_name.c_str(), (int)sprites.size()); if(bank) { fprintf(file, "extern const void __bank_%s_metasprite;\n", data_name.c_str()); } + fprintf(file, "#endif"); fclose(file); @@ -323,7 +330,7 @@ int main(int argc, char *argv[]) } fprintf(file, "//AUTOGENERATED FILE FROM png2mtspr\n\n"); - fprintf(file, "#include <gb/gb.h>\n"); + fprintf(file, "#include <stdint.h>\n"); fprintf(file, "#include <gb/metasprites.h>\n"); fprintf(file, "\n"); @@ -332,7 +339,7 @@ int main(int argc, char *argv[]) fprintf(file, "const void __at(%d) __bank_%s_metasprite;\n\n", bank, data_name.c_str()); } - fprintf(file, "const UINT8 %s_data[%d] = {\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); + fprintf(file, "const uint8_t %s_data[%d] = {\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); for(vector< Tile >::iterator it = tiles.begin(); it != tiles.end(); ++ it) { for(Tile::iterator it2 = (*it).begin(); it2 != (*it).end(); ++ it2)
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.