Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Macros | Functions
engine_utils.h File Reference
#include "vector.h"
#include <SDL3/SDL.h>
#include <random>
+ Include dependency graph for engine_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 

Functions

void MsgBox (string &stitle, string &smsg, bool _berror=false)
 
int Random_Int (const int a, const int b)
 
float Random_Sign (void)
 
float Random_Float (const float a, const float b)
 
Vector Random_Vector (const float a, const float b)
 
Vector Random_Point (const Vector p1, const Vector p2)
 
Vector Random_Point (const Vector p, const float r)
 
SDL_Color Random_Color (const int a=0, const int b=255)
 
float FloatClamp (float _f, float fMin, float fMax)
 
int IntClamp (int _i, int iMin, int iMax)
 
Vector VectorClamp (Vector _v, Vector _vMin, Vector _vMax)
 
float fBlend (float _f1, float _f2, float _fc)
 

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 16 of file engine_utils.h.

◆ MIN

#define MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 17 of file engine_utils.h.

Function Documentation

◆ fBlend()

float fBlend ( float  _f1,
float  _f2,
float  _fc 
)

Definition at line 58 of file engine_utils.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ FloatClamp()

float FloatClamp ( float  _f,
float  fMin,
float  fMax 
)

Definition at line 27 of file engine_utils.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ IntClamp()

int IntClamp ( int  _i,
int  iMin,
int  iMax 
)

Definition at line 37 of file engine_utils.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ MsgBox()

void MsgBox ( string stitle,
string smsg,
bool  _berror = false 
)

Definition at line 18 of file engine_utils.cpp.

◆ Random_Color()

SDL_Color Random_Color ( const int  a = 0,
const int  b = 255 
)
inline

Definition at line 32 of file engine_utils.h.

References GetComponentTypeID_Static(), and Random_Int().

+ Here is the call graph for this function:

◆ Random_Float()

float Random_Float ( const float  a,
const float  b 
)
inline

Definition at line 27 of file engine_utils.h.

References GetComponentTypeID_Static(), and Random_Int().

Referenced by Random_Point(), Random_Point(), and Random_Vector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Random_Int()

int Random_Int ( const int  a,
const int  b 
)
inline

Definition at line 25 of file engine_utils.h.

References GetComponentTypeID_Static().

Referenced by Player::Create(), Random_Color(), Random_Float(), and Random_Sign().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Random_Point() [1/2]

Vector Random_Point ( const Vector  p,
const float  r 
)
inline

Definition at line 31 of file engine_utils.h.

References GetComponentTypeID_Static(), Random_Float(), and Random_Sign().

+ Here is the call graph for this function:

◆ Random_Point() [2/2]

Vector Random_Point ( const Vector  p1,
const Vector  p2 
)
inline

Definition at line 30 of file engine_utils.h.

References GetComponentTypeID_Static(), and Random_Float().

+ Here is the call graph for this function:

◆ Random_Sign()

float Random_Sign ( void  )
inline

Definition at line 26 of file engine_utils.h.

References Random_Int().

Referenced by Random_Point().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Random_Vector()

Vector Random_Vector ( const float  a,
const float  b 
)
inline

Definition at line 29 of file engine_utils.h.

References Random_Float().

+ Here is the call graph for this function:

◆ VectorClamp()

Vector VectorClamp ( Vector  _v,
Vector  _vMin,
Vector  _vMax 
)

Definition at line 47 of file engine_utils.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function: