mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-12 22:38:14 +00:00
Make MatrixToFloat and Vector3ToFloat reentrant
Besides making it thread-safe, it suppresses a GCC warning when making them static inline in an upcoming patch.
This commit is contained in:
18
src/raylib.h
18
src/raylib.h
@@ -338,6 +338,14 @@ typedef struct Matrix {
|
||||
float m3, m7, m11, m15;
|
||||
} Matrix;
|
||||
|
||||
typedef struct Float3 {
|
||||
float f[3];
|
||||
} Float3;
|
||||
|
||||
typedef struct Float16 {
|
||||
float f[16];
|
||||
} Float16;
|
||||
|
||||
// Color type, RGBA (32bit)
|
||||
typedef struct Color {
|
||||
unsigned char r;
|
||||
@@ -743,11 +751,17 @@ RLAPI Color GetColor(int hexValue); // Returns a C
|
||||
RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
|
||||
|
||||
// Math useful functions (available from raymath.h)
|
||||
RLAPI float *Vector3ToFloat(Vector3 vec); // Returns Vector3 as float array
|
||||
RLAPI float *MatrixToFloat(Matrix mat); // Returns Matrix as float array
|
||||
RLAPI Vector3 Vector3Zero(void); // Vector with components value 0.0f
|
||||
RLAPI Vector3 Vector3One(void); // Vector with components value 1.0f
|
||||
RLAPI Matrix MatrixIdentity(void); // Returns identity matrix
|
||||
#ifndef Vector3ToFloat
|
||||
#define Vector3ToFloat(vec) (Vector3ToFloat_(vec).f) // Returns Vector3 as float array
|
||||
RLAPI Float3 Vector3ToFloat_(Vector3 vec); // don't use, use above
|
||||
#endif
|
||||
#ifndef MatrixToFloat
|
||||
#define MatrixToFloat(mat) (MatrixToFloat_(mat).f) // Returns Matrix as float array
|
||||
RLAPI Float16 MatrixToFloat_(Matrix mat); // don't use, use above
|
||||
#endif
|
||||
|
||||
// Misc. functions
|
||||
RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags)
|
||||
|
Reference in New Issue
Block a user