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/resource/src/resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resource') diff --git a/src/resource/src/resource.c b/src/resource/src/resource.c index dd59bac..ae0b528 100644 --- a/src/resource/src/resource.c +++ b/src/resource/src/resource.c @@ -61,9 +61,9 @@ int resource_render(const struct resource *const res, if (!in->alive) return 0; - struct sprite *const s = sprite_get(); + sprite_get_or_ret(s, -1); - if (!s || sprite_clone(&resource_sprites[res->type], s)) + if (sprite_clone(&resource_sprites[res->type], s)) return -1; if (res->type == RESOURCE_TYPE_GOLD) -- cgit v1.2.3