Skip to content
Snippets Groups Projects
Commit ca87d53b authored by Superstarxalien's avatar Superstarxalien
Browse files

fix sprite marker bug

parent 1f1d7dbc
Branches
Tags
No related merge requests found
...@@ -665,6 +665,8 @@ int main(int argc, char *argv[]) { ...@@ -665,6 +665,8 @@ int main(int argc, char *argv[]) {
struct wadfile* wad; // WAD to be created. struct wadfile* wad; // WAD to be created.
FILE* wadf; // File pointer for writing the WAD. FILE* wadf; // File pointer for writing the WAD.
char iconlump[9];
if (argc != 2) { if (argc != 2) {
printf("kartmaker <folder>: Converts a structured folder into an SRB2Kart character WAD. (Try dragging the folder onto the EXE!)"); printf("kartmaker <folder>: Converts a structured folder into an SRB2Kart character WAD. (Try dragging the folder onto the EXE!)");
return 1; return 1;
...@@ -739,14 +741,25 @@ int main(int argc, char *argv[]) { ...@@ -739,14 +741,25 @@ int main(int argc, char *argv[]) {
// Add sprites into WAD // Add sprites into WAD
printf("Adding sprites to WAD...\n"); printf("Adding sprites to WAD...\n");
if (cJSON_GetObjectItem(metadata, "prefix"))
sprintf(iconlump, "ICOF%s", strupr(cJSON_GetObjectItem(metadata, "prefix")->valuestring));
else
sprintf(iconlump, "ICOF%s", defprefix);
iconlump[8] = '\0';
struct RGB_Sprite* sprite = rgb_sprites; struct RGB_Sprite* sprite = rgb_sprites;
while (sprite) { while (sprite) {
unsigned char* image; unsigned char* image;
size_t size; size_t size;
printf(" Lump %s...\n", sprite->lumpname); printf(" Lump %s...\n", sprite->lumpname);
image = imageInDoomFormat(sprite, &size); image = imageInDoomFormat(sprite, &size);
if (strcmp(sprite->lumpname, "ICOF") == 1)
if (strcmp(sprite->lumpname, iconlump) == 0)
{
add_lump(wad, find_last_lump(wad), "S_END", 0, NULL); add_lump(wad, find_last_lump(wad), "S_END", 0, NULL);
}
add_lump(wad, find_last_lump(wad), sprite->lumpname, size, image); add_lump(wad, find_last_lump(wad), sprite->lumpname, size, image);
free(image); free(image);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment