mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-11-30 03:30:43 +00:00
Implement a type-checking clamp macro
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
25b7b14943
commit
d2c2c6059c
@ -279,8 +279,8 @@ R_TranslatePlayerSkin(int playernum)
|
||||
|
||||
top = player->topcolor;
|
||||
bottom = player->bottomcolor;
|
||||
top = (top < 0) ? 0 : ((top > 13) ? 13 : top);
|
||||
bottom = (bottom < 0) ? 0 : ((bottom > 13) ? 13 : bottom);
|
||||
top = qclamp(top, 0, 13);
|
||||
bottom = qclamp(bottom, 0, 13);
|
||||
top *= 16;
|
||||
bottom *= 16;
|
||||
|
||||
|
@ -45,6 +45,9 @@ typedef int fixed16_t;
|
||||
(a_ < b_) ? a_ : b_; \
|
||||
})
|
||||
|
||||
/* clamp macro with type checking */
|
||||
#define qclamp(var,min,max) qmax(qmin(var,max),min)
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user