#pragma once
#include<stdlib.h>
#include<stddef.h>
typedef char int_8;
typedef unsigned char uint_8;
typedef short int_16;
typedef unsigned short uint_16;
typedef int int_32;
typedef unsigned int uint_32;
#define MakePtr(type,size) (type*)malloc(size * sizeof(type))
#define ResizePtr(type,size) (type*)realloc(size * sizeof(type))
#define RelasePtr(ptr)\
{ \
free(ptr); \
ptr = NULL; \
}
#define BitSize(type) (8u * sizeof(type));
#define Max(a,b) ((a > b)? a:b)
#define Min(a,b) ((a < b)? a:b)
#define clamp(num,min_,max_)\
{ \
if(num < min_) \
num = min_; \
else \
if (num > max_) \
num = max_; \
}
#define lerp(num,target,value) \
{ \
num += value * (target - num);\
}
#define Rand(_min,_max) (rand() % (_max - _min + 1) + _min)
#define For(num,end) for(num = 0; num <= end; num++)
|