aboutsummaryrefslogtreecommitdiff
path: root/src/gfx/inc
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-02-08 15:39:56 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-30 08:20:21 +0200
commit98f0d3e026f978d556cc91cfaa815d92a0b182c8 (patch)
treebd9f39354da8fcbed0453bf45152c39e803abbf6 /src/gfx/inc
parent56286a0a962119ddebf26df58d4a7c5d2f6a3fc7 (diff)
downloadjancity-98f0d3e026f978d556cc91cfaa815d92a0b182c8.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/gfx/inc')
-rw-r--r--src/gfx/inc/gfx.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gfx/inc/gfx.h b/src/gfx/inc/gfx.h
index 0c30911..7ea6df6 100644
--- a/src/gfx/inc/gfx.h
+++ b/src/gfx/inc/gfx.h
@@ -19,15 +19,16 @@ void quad_sort(struct quad *q);
void rect_sort(struct rect *r);
void stp_4line_sort(struct stp_4line *l);
int sprite_from_fp(struct sprite *s, FILE *f);
-struct sprite *sprite_get(void);
-struct quad *quad_get(void);
-struct rect *rect_get(bool semitrans);
-struct stp_4line *stp_4line_get(void);
int quad_from_sprite(const struct sprite *s, struct quad *q);
bool gfx_inside_drawenv(short x, short y, short w, short h);
void gfx_deinit(void);
void sprite_free(struct sprite *src);
+#define sprite_get_or_ret(x, ret) common_get_or_ret(sprite, x, ret)
+#define stp_4line_get_or_ret(x, ret) common_get_or_ret(stp_4line, x, ret)
+#define rect_get_or_ret(x, ret) common_get_or_ret(rect, x, ret)
+#define quad_get_or_ret(x, ret) common_get_or_ret(quad, x, ret)
+
extern int screen_w, screen_h;
#ifdef __cplusplus