- started updating g_missile.c

- add G_Assert function (see g_missile.c for example usage)
This commit is contained in:
Walter Julius Hennecke 2013-12-19 22:37:50 +01:00
parent a0318c5983
commit d1edc454ee
9 changed files with 8707 additions and 8639 deletions

5505
Makefile

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

12
code/game/g_local.c Normal file
View file

@ -0,0 +1,12 @@
#include "g_local.h"
#include "g_logger.h"
qboolean _G_Assert(void* ptr, const char* varname, const char* function) {
if (ptr == NULL) {
G_LocLogger(LL_ERROR, "%s == NULL!\n", varname);
G_LocLogger(LL_TRACE, "%s - End\n", function);
return qtrue;
}
return qfalse;
}

View file

@ -2906,4 +2906,15 @@ typedef struct {
int numShaders;
} target_alert_Shaders_s;
/*
* @brief Checks if a pointer is NULL and returns result.
* If the pointer is NULL a message get's logged as error
* and the function returns qtrue else the function returns
* qfalse.
* @param ptr The pointer to check.
* @return Whether the pointer is NULL or not.
*/
qboolean _G_Assert(void* ptr, const char* varname, const char* function);
#define G_Assert(ptr) _G_Assert(ptr, #ptr, __FUNCTION__)
#endif //_G_LOCAL_H_

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff