use SDL stdlib where possible

This commit is contained in:
2024-09-25 19:42:34 -03:00
parent ccad21ab90
commit 0fe1023667
9 changed files with 37 additions and 39 deletions

View File

@ -17,10 +17,7 @@
#include <glad/glad.h>
#endif
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <tgmath.h>
#include <limits.h>
@ -380,7 +377,7 @@ static void clean_up(void) {
/* if you're gonna remove this, it's also being done in rendering.c */
for (size_t i = 0; i < arrlenu(ctx.render_queue_2d); ++i) {
if (ctx.render_queue_2d[i].type == PRIMITIVE_2D_TEXT) {
free(ctx.render_queue_2d[i].text.text);
SDL_free(ctx.render_queue_2d[i].text.text);
}
}
arrfree(ctx.render_queue_2d);
@ -408,7 +405,7 @@ int enter_loop(int argc, char **argv) {
return EXIT_FAILURE;
for (int i = 1; i < (argc - 1); ++i) {
if (strcmp(argv[i], "--data-dir") == 0) {
if (SDL_strcmp(argv[i], "--data-dir") == 0) {
if (!PHYSFS_mount(argv[i+1], NULL, true)) {
CRY_PHYSFS("Data dir mount override failed.");
return EXIT_FAILURE;