From 49854c08dda0b2c7c3c1601e22bdf82c305139b3 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 13 Jun 2015 22:42:20 +0000 Subject: [PATCH] Change FSPACX/FSPACY macros to inline functions --- common/main/gamefont.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/main/gamefont.h b/common/main/gamefont.h index 7d287f173..e5c424da7 100644 --- a/common/main/gamefont.h +++ b/common/main/gamefont.h @@ -55,12 +55,30 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. extern float FNTScaleX, FNTScaleY; // add (scaled) spacing to given font coordinate -#define FSPACX(x) ((float)((x)*(FNTScaleX*(GAME_FONT->ft_w/7)))) -#define FSPACY(y) ((float)((y)*(FNTScaleY*(GAME_FONT->ft_h/5)))) #define LINE_SPACING ((float)(FNTScaleY*(grd_curcanv->cv_font->ft_h+(GAME_FONT->ft_h/5)))) extern array Gamefonts; +static inline float FSPACX() +{ + return FNTScaleX * (GAME_FONT->ft_w / 7); +} + +static inline float FSPACX(const int &x) +{ + return FSPACX() * x; +} + +static inline float FSPACY() +{ + return FNTScaleY * (GAME_FONT->ft_h / 5); +} + +static inline float FSPACY(const int &y) +{ + return FSPACY() * y; +} + void gamefont_init(); void gamefont_close(); void gamefont_choose_game_font(int scrx,int scry);