20#define printf(...) print(sprintf(__VA_ARGS__))
31 print(sprintf(
"^9%f ^7%s\n",
time, msg));
33 print(sprintf(
"^7%s\n", msg));
40 print(sprintf(
"^9%f ^1%s^7: %s\n",
time, functionName, msg));
42 print(sprintf(
"^1%s^7: %s\n", functionName, msg));
49 print(sprintf(
"^9%f ^3%s^7: %s\n",
time, functionName, msg));
51 print(sprintf(
"^3%s^7: %s\n", functionName, msg));
55_NSAssert(
bool condition,
string function,
string descr)
58 print(strcat(
"^1Assertion failed in ", function,
", reason: ", descr,
"\n"));
69#define NSLog(...) if (autocvar_g_developer) _NSLog(sprintf(__VA_ARGS__))
75#define NSError(...) _NSError(__FUNC__, sprintf(__VA_ARGS__))
81#define NSWarning(...) _NSWarning(__FUNC__, sprintf(__VA_ARGS__))
89#define NSAssert(condition, ...) if (autocvar_g_developer) _NSAssert(condition, __FUNC__, sprintf(__VA_ARGS__))
112 string sideLeft =
"";
113 string sideRight =
"";
115 if (functionName == __NULL__) {
116 NSLog(
"---------------------------------------------------");
121 chars = chars - (
int)strlen(functionName) - 2
i;
122 charsLeft = chars / 2
i;
123 charExtra = chars % 2
i;
125 for (
int i = 0
i;
i < charsLeft;
i++)
126 sideLeft = strcat(sideLeft,
"-");
128 for (
int i = 0
i;
i < (charsLeft + charExtra);
i++) {
129 sideRight = strcat(sideRight,
"-");
132 NSLog(
"%s %s %s", sideLeft, functionName, sideRight);
139 error(
"Called InitStart() without InitEnd()ing the previous one!");
145#define InitStart() _InitStart(__FUNC__)
151 float endTime = gettime(1);
153 NSLog(
"---------------------------------------------------");
157#define InitEnd() _InitEnd()
float time
Definition: fteextensions.qc:509
get __int i
Definition: fteextensions.qc:3826
int(float fhandle, void *ptr, int size) fread
const vector g_vec_null
Definition: global.h:101
var float g_initTime
Definition: global.h:104
void _InitStart(string functionName)
Definition: global.h:136
void _NSWarning(string functionName, string msg)
Definition: global.h:46
void _NSLog(string msg)
Definition: global.h:28
void _NSError(string functionName, string msg)
Definition: global.h:37
searchFlags_t
Definition: global.h:92
@ SEARCH_MULTISEARCH
When set, separating search queries with : will allow for multiple queries in one string.
Definition: global.h:97
@ SEARCH_FORCESEARCH
Search a given game directory even if it's not mounted.
Definition: global.h:96
@ SEARCH_NAMESORT
Sort the results alphabetically (slower)
Definition: global.h:98
@ SEARCH_FULLPACKAGE
Package names include the game directory as a prefix.
Definition: global.h:94
@ SEARCH_INSENSITIVE
Attempt to do a case-insensitive search (slower)
Definition: global.h:93
@ SEARCH_ALLOWDUPES
Do not attempt to remove duplicate results (so you can search through multiple archives)
Definition: global.h:95
var bool autocvar_g_developer
Definition: global.h:17
void _NSAssert(bool condition, string function, string descr)
Definition: global.h:55
var bool autocvar_g_developerTimestamps
Definition: global.h:18
void InitPrint(string functionName)
Definition: global.h:107
#define NSLog(...)
Logs an message, with timestamp.
Definition: global.h:69
void _InitEnd(void)
Definition: global.h:149
#define enumflags
Doxygen doesn't know what enumflags (aka bitfields) are, used as e.g.
Definition: global.h:24