From 98f0d3e026f978d556cc91cfaa815d92a0b182c8 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 8 Feb 2022 15:39:56 +0100 Subject: Replace x_get functions with macros The PS1 port relies on a heap for primitives since the GPU renders the scene asynchronously. However, SDL-based platforms render primitives synchronously, so structures can be allocated on the stack instead. --- src/terrain/src/terrain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/terrain') diff --git a/src/terrain/src/terrain.c b/src/terrain/src/terrain.c index a528c10..e3cfc4a 100644 --- a/src/terrain/src/terrain.c +++ b/src/terrain/src/terrain.c @@ -54,10 +54,7 @@ int terrain_render(const struct terrain_map *const map, for (struct m y = {.i = start_y, .p = remy}; y.i < ny + start_y; y.i++, y.p += TERRAIN_SZ) { - struct sprite *const s = sprite_get(); - - if (!s) - return -1; + sprite_get_or_ret(s, -1); switch (map->m[y.i][x.i]) { -- cgit v1.2.3