Nuclide
Software Development Kit for id Tech
global.h File Reference

Go to the source code of this file.

Macros

#define printf(...)   print(sprintf(__VA_ARGS__))
 
#define enumflags   enum
 Doxygen doesn't know what enumflags (aka bitfields) are, used as e.g. More...
 
#define NSLog(...)   if (autocvar_g_developer) _NSLog(sprintf(__VA_ARGS__))
 Logs an message, with timestamp. More...
 
#define NSError(...)   _NSError(__FUNC__, sprintf(__VA_ARGS__))
 Logs an error message, with timestamp. More...
 
#define NSWarning(...)   _NSWarning(__FUNC__, sprintf(__VA_ARGS__))
 Logs a warning message, with timestamp. More...
 
#define NSAssert(condition, ...)   if (autocvar_g_developer) _NSAssert(condition, __FUNC__, sprintf(__VA_ARGS__))
 Generates an assertion, if a given condition is false. More...
 
#define InitStart()   _InitStart(__FUNC__)
 
#define InitEnd()   _InitEnd()
 

Enumerations

enum  searchFlags_t {
  SEARCH_INSENSITIVE , SEARCH_FULLPACKAGE , SEARCH_ALLOWDUPES , SEARCH_FORCESEARCH ,
  SEARCH_MULTISEARCH , SEARCH_NAMESORT
}
 

Functions

void _NSLog (string msg)
 
void _NSError (string functionName, string msg)
 
void _NSWarning (string functionName, string msg)
 
void _NSAssert (bool condition, string function, string descr)
 
void InitPrint (string functionName)
 
void _InitStart (string functionName)
 
void _InitEnd (void)
 

Variables

var bool autocvar_g_developer = false
 
var bool autocvar_g_developerTimestamps = false
 
const vector g_vec_null = [0.0f, 0.0f, 0.0f]
 
var float g_initTime
 

Macro Definition Documentation

◆ enumflags

typedef enumflags   enum

Doxygen doesn't know what enumflags (aka bitfields) are, used as e.g.

For future use: SpawnFlags used in Source.

Monster flags, these are defined by the level designers.

AI will be enabled once seen (1) Won't talk (2) Collides against func_monsterclip (4) Reserved for entityDef (8) Only reacts to scripted sequences (16) Reserved for entityDef (32) Ignores players (64) AI waits for scripted_sequence to end (128) Reserved for entityDef (256) Corpse fades instead of staying (512) Will spawn in multiplayer NSGameRules (1024) Is falling (2048) Part of a horde (4096)

AI will be enable once seen (1) Won't talk (2) Fall to ground, instead of dropping instantly (4) Drops healthkit (8) Walks direct paths (16) Reserved for entityDef (32) Reserved for entityDef (64) AI waits for scripted_sequence to end (128) Long visibility and line of sight (256) Corpse fades instead of staying (512) Think outside the PVS (1024) Will spawn through npc_maker (2048) Alternative collision, avoiding players (4096) Don't drop weapons (8192) Ignore pushing players (16384)

◆ InitEnd

#define InitEnd ( )    _InitEnd()

◆ InitStart

#define InitStart ( )    _InitStart(__FUNC__)

◆ NSAssert

#define NSAssert (   condition,
  ... 
)    if (autocvar_g_developer) _NSAssert(condition, __FUNC__, sprintf(__VA_ARGS__))

Generates an assertion, if a given condition is false.

The console variable g_developer has to be 1 for them to be visible.

Parameters
conditionis the expression to be evaluated.
description(...)contains a formatted string containing an error description.

◆ NSError

#define NSError (   ...)    _NSError(__FUNC__, sprintf(__VA_ARGS__))

Logs an error message, with timestamp.

The console variable g_developer has to be 1 for them to be visible.

Parameters
description(...)contains a formatted string containing a description.

◆ NSLog

#define NSLog (   ...)    if (autocvar_g_developer) _NSLog(sprintf(__VA_ARGS__))

Logs an message, with timestamp.

The console variable g_developer has to be 1 for them to be visible.

Parameters
description(...)contains a formatted string containing a description.

◆ NSWarning

#define NSWarning (   ...)    _NSWarning(__FUNC__, sprintf(__VA_ARGS__))

Logs a warning message, with timestamp.

The console variable g_developer has to be 1 for them to be visible.

Parameters
description(...)contains a formatted string containing a description.

◆ printf

#define printf (   ...)    print(sprintf(__VA_ARGS__))

Enumeration Type Documentation

◆ searchFlags_t

Enumerator
SEARCH_INSENSITIVE 

Attempt to do a case-insensitive search (slower)

SEARCH_FULLPACKAGE 

Package names include the game directory as a prefix.

SEARCH_ALLOWDUPES 

Do not attempt to remove duplicate results (so you can search through multiple archives)

SEARCH_FORCESEARCH 

Search a given game directory even if it's not mounted.

SEARCH_MULTISEARCH 

When set, separating search queries with : will allow for multiple queries in one string.

SEARCH_NAMESORT 

Sort the results alphabetically (slower)

Function Documentation

◆ _InitEnd()

void _InitEnd ( void  )

◆ _InitStart()

void _InitStart ( string  functionName)

◆ _NSAssert()

void _NSAssert ( bool  condition,
string  function,
string  descr 
)

◆ _NSError()

void _NSError ( string  functionName,
string  msg 
)

◆ _NSLog()

void _NSLog ( string  msg)

◆ _NSWarning()

void _NSWarning ( string  functionName,
string  msg 
)

◆ InitPrint()

void InitPrint ( string  functionName)

Variable Documentation

◆ autocvar_g_developer

var bool autocvar_g_developer = false

◆ autocvar_g_developerTimestamps

var bool autocvar_g_developerTimestamps = false

◆ g_initTime

var float g_initTime

◆ g_vec_null

const vector g_vec_null = [0.0f, 0.0f, 0.0f]