Added ifdef guards to raymath-related types

This commit is contained in:
Vesper 2024-05-01 16:10:48 +01:00
parent 8d743b61aa
commit f520a7cff6
2 changed files with 13 additions and 10 deletions

View File

@ -11,9 +11,8 @@
* *
********************************************************************************************/ ********************************************************************************************/
#include "raylib.h"
#include "raymath.h" #include "raymath.h"
#include "raylib.h"
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Program main entry point // Program main entry point

View File

@ -158,11 +158,13 @@
// this defines are very useful for internal check and avoid type (re)definitions // this defines are very useful for internal check and avoid type (re)definitions
#define RL_COLOR_TYPE #define RL_COLOR_TYPE
#define RL_RECTANGLE_TYPE #define RL_RECTANGLE_TYPE
#ifndef RAYMATH_H
#define RL_VECTOR2_TYPE #define RL_VECTOR2_TYPE
#define RL_VECTOR3_TYPE #define RL_VECTOR3_TYPE
#define RL_VECTOR4_TYPE #define RL_VECTOR4_TYPE
#define RL_QUATERNION_TYPE #define RL_QUATERNION_TYPE
#define RL_MATRIX_TYPE #define RL_MATRIX_TYPE
#endif // RAYMATH_H
// Some Basic Colors // Some Basic Colors
// NOTE: Custom raylib color palette for amazing visuals on WHITE background // NOTE: Custom raylib color palette for amazing visuals on WHITE background
@ -205,6 +207,7 @@
#define RL_BOOL_TYPE #define RL_BOOL_TYPE
#endif #endif
#ifndef RAYMATH_H
// Vector2, 2 components // Vector2, 2 components
typedef struct Vector2 { typedef struct Vector2 {
float x; // Vector x component float x; // Vector x component
@ -236,6 +239,7 @@ typedef struct Matrix {
float m2, m6, m10, m14; // Matrix third row (4 components) float m2, m6, m10, m14; // Matrix third row (4 components)
float m3, m7, m11, m15; // Matrix fourth row (4 components) float m3, m7, m11, m15; // Matrix fourth row (4 components)
} Matrix; } Matrix;
#endif // RAYMATH_H
// Color, 4 components, R8G8B8A8 (32bit) // Color, 4 components, R8G8B8A8 (32bit)
typedef struct Color { typedef struct Color {