From c5783982e17be893b61984cac703385308e9ab26 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 16 Jan 2023 22:54:26 +0100 Subject: [PATCH] Added a more aggressive inlining macro. Not sure if it makes any difference now, but it's nice to have the option. --- common.h | 2 ++ world.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common.h b/common.h index 8470319..b80236f 100644 --- a/common.h +++ b/common.h @@ -11,6 +11,8 @@ #include "memory.h" #include "qmath.h" +#define INLINE __attribute__((always_inline)) inline + extern VECTOR cam_pos; extern SVECTOR cam_rot; diff --git a/world.c b/world.c index 397b2cd..57bb5f7 100644 --- a/world.c +++ b/world.c @@ -38,7 +38,7 @@ void world_load(const u_long *data, world_t *world) bytes += sizeof(ps1bsp_face_t) * world->header->numFaces; } -static inline void drawface_triangle_fan(const ps1bsp_face_t *face, SVECTOR *vecs) +static INLINE void drawface_triangle_fan(const ps1bsp_face_t *face, SVECTOR *vecs) { int p; @@ -84,7 +84,7 @@ static inline void drawface_triangle_fan(const ps1bsp_face_t *face, SVECTOR *vec } } -static inline void drawface_triangle_strip(const ps1bsp_face_t *face, SVECTOR *vecs) +static INLINE void drawface_triangle_strip(const ps1bsp_face_t *face, SVECTOR *vecs) { int p; @@ -146,7 +146,7 @@ static inline void drawface_triangle_strip(const ps1bsp_face_t *face, SVECTOR *v } } -static inline void drawface_quad_strip(const ps1bsp_face_t *face, SVECTOR *vecs) +static INLINE void drawface_quad_strip(const ps1bsp_face_t *face, SVECTOR *vecs) { int p; @@ -236,7 +236,7 @@ void world_draw(const world_t *world) } if (face->numFaceVertices == 3) - drawface_triangle_fan(face, vecs); + drawface_triangle_strip(face, vecs); else drawface_quad_strip(face, vecs); }