Align gfx tool with SA2

This commit is contained in:
JaceCear committed 2025-11-15 23:04:10 +01:00
1 parent 770e5826ac
commit d39f2c8e6f
2 files changed
+5 -2

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
CC = gcc
CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK
# TODO: why does error-maybe-uninitialized appear on some peoples systems
CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -Wno-maybe-uninitialized -Wno-unknown-warning-option -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK
CFLAGS += $(shell pkg-config --cflags libpng)
LIBS = -lpng -lz
+3 -1
View File
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <string.h> // memcpy
#include "global.h"
#include "gfx.h"
@@ -415,7 +416,7 @@ void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int m
/* Split image into shapes */
struct OamShape* head = FindOamShapes(image->width, image->height);
#ifdef DEBUG
#if 0
/* Debug */
printf("OAM Shapes (%d, %d):\n", image->width, image->height);
struct OamShape* temp = head;
@@ -444,6 +445,7 @@ void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int m
curr = curr->next;
}
assert(scratchBuffer != NULL);
/* Copy the scratch buffer back into the original buffer */
memcpy(buffer, scratchBuffer, bufferSize);