aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-06-27 21:42:29 +0200
committerNicholas Rodrigues Lordello <[email protected]>2026-06-27 21:42:29 +0200
commit02ac0ab99c1a7b727dc40b32138730401cb94d89 (patch)
tree7b72811c24701ef02e31a5c1b17221c6418cb488 /lib
parent1eac4cb95f7a7962238df1206174da891272dc17 (diff)
Collapse png.c Into Main
The `png` module was tiny and not worth being on its own. Instead build the STB image code into a `lib/stbi.c`. This was prompted because we wanted to lint with `clang-tidy` and it was pulling in STB code because it is a single header library.
Diffstat (limited to 'lib')
-rw-r--r--lib/stb/stbi.c4
-rw-r--r--lib/stb/stbi.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/stb/stbi.c b/lib/stb/stbi.c
new file mode 100644
index 0000000..5769e2b
--- /dev/null
+++ b/lib/stb/stbi.c
@@ -0,0 +1,4 @@
+#include <SDL3/SDL_stdinc.h>
+
+#define STB_IMAGE_IMPLEMENTATION
+#include "./stbi.h"
diff --git a/lib/stb/stbi.h b/lib/stb/stbi.h
new file mode 100644
index 0000000..82594c2
--- /dev/null
+++ b/lib/stb/stbi.h
@@ -0,0 +1,10 @@
+#define STBI_ONLY_PNG
+#define STBI_MAX_DIMENSIONS (160 * 205)
+#define STBI_NO_FAILURE_STRINGS
+#define STBI_NO_LINEAR
+#define STBI_NO_STDIO
+#define STBI_NO_THREAD_LOCALS
+#define STBI_MALLOC(sz) SDL_malloc(sz)
+#define STBI_REALLOC(p, sz) SDL_realloc(p, sz)
+#define STBI_FREE(p) SDL_free(p)
+#include "./stb_image.h"