diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-02-08 15:39:56 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:20:21 +0200 |
| commit | 3d90015c627f05edd32260758581a0e11c269948 (patch) | |
| tree | cef420e393d030cebc4f0b4870b6107fe972acab /src/resource | |
| parent | df2ecf50e0679f7792f0d356de51d16b56049110 (diff) | |
| download | rts-3d90015c627f05edd32260758581a0e11c269948.tar.gz | |
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.
Diffstat (limited to 'src/resource')
| -rw-r--r-- | src/resource/src/resource.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) |
