//misc macros and junk.
#pragma once

#define bound_max(var, val) if (var > (val)) var = (val);
#define bound_min(var, val) if (var < (val)) var = (val);

#define bound_min_inline(var, val) (((var) < (val)) ? (val) : (var))
#define bound_max_inline(var, val) (((var) > (val)) ? (val) : (var))

#define delca(arr) if (arr != NULL) {delete [] arr; arr = NULL;}
#define delc(var) if (var != NULL) {delete var; var = NULL;}

#define PI 3.14159265358979323846f
#define RAD2DEG 57.29577951308f