Switch to using wapp_mem_arena_init_default

This commit is contained in:
Abdelrahman Said 2024-08-23 21:58:55 +01:00
parent ed43a0f286
commit 5eeb7d6819

View File

@ -1,6 +1,5 @@
#include "img.h" #include "img.h"
#include "mem_arena.h" #include "mem_arena.h"
#include "mem_utils.h"
#include "misc_utils.h" #include "misc_utils.h"
#include "obj.h" #include "obj.h"
#include "render.h" #include "render.h"
@ -10,7 +9,7 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#define SIZE 1200 #define IMAGE_DIMENSION 1200
#define RESOURCE(NAME) "resources/" NAME #define RESOURCE(NAME) "resources/" NAME
enum { enum {
@ -22,14 +21,14 @@ enum {
int main(void) { int main(void) {
Arena *arena = NULL; Arena *arena = NULL;
if (!wapp_mem_arena_init(&arena, GB(10), WAPP_MEM_ALLOC_RESERVE, false)) { if (!wapp_mem_arena_init_default(&arena, GB(10))) {
return TINY_EXIT_ARENA_INIT_FAILED; return TINY_EXIT_ARENA_INIT_FAILED;
} }
Colour bg = {.r = 42, .g = 45, .b = 52, .a = 255}; Colour bg = {.r = 42, .g = 45, .b = 52, .a = 255};
Colour teal = {.r = 14, .g = 156, .b = 208, .a = 255}; Colour teal = {.r = 14, .g = 156, .b = 208, .a = 255};
Render render; Render render;
if (!init_render(arena, &render, SIZE, SIZE)) { if (!init_render(arena, &render, IMAGE_DIMENSION, IMAGE_DIMENSION)) {
return TINY_EXIT_RENDER_INIT_FAILED; return TINY_EXIT_RENDER_INIT_FAILED;
} }