Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fnky
Created February 9, 2017 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnky/2d155a0c5b2ea38a550828d06da0762f to your computer and use it in GitHub Desktop.
Save fnky/2d155a0c5b2ea38a550828d06da0762f to your computer and use it in GitHub Desktop.
#include "angelscript.h"
#include "extdll.h"
#include "util.h"
#include "CASDocumentation.h"
#include "CString.h"
#include "ASEngine.h"
static const unsigned int CONST_FTRACE_SIMPLEBOX = FTRACE_SIMPLEBOX;
void RegisterSCScriptEngine( CASDocumentation* pDocumentation )
{
const char* pszObjectName = "CEngine";
pDocumentation->RegisterObjectType( "Engine global variables",
pszObjectName, 0, asOBJ_REF | asOBJ_NOCOUNT );
pDocumentation->RegisterObjectProperty( "Current time", pszObjectName,
"const float time",
asOFFSET( globalvars_t, time ) );
pDocumentation->RegisterObjectProperty( "Time between frames", pszObjectName,
"const float frametime",
asOFFSET( globalvars_t, frametime ) );
pDocumentation->RegisterObjectProperty( "Name of the current map", pszObjectName,
"const string_t mapname",
asOFFSET( globalvars_t, mapname ) );
pDocumentation->RegisterObjectProperty( "Start location in the map", pszObjectName,
"string_t startspot",
asOFFSET( globalvars_t, startspot ) );
pDocumentation->RegisterObjectProperty( "Flag telling whether this is deathmatch", pszObjectName,
"float deathmatch",
asOFFSET( globalvars_t, deathmatch ) );
pDocumentation->RegisterObjectProperty( "Flag telling whether this is coop", pszObjectName,
"float coop",
asOFFSET( globalvars_t, coop ) );
pDocumentation->RegisterObjectProperty( "Flag telling whether this is teamplay", pszObjectName,
"float teamplay",
asOFFSET( globalvars_t, teamplay ) );
pDocumentation->RegisterObjectProperty( "Server flags", pszObjectName,
"float serverflags",
asOFFSET( globalvars_t, serverflags ) );
pDocumentation->RegisterObjectProperty( "Found secrets", pszObjectName,
"float found_secrets",
asOFFSET( globalvars_t, found_secrets ) );
pDocumentation->RegisterObjectProperty( "Forward vector", pszObjectName,
"Vector v_forward",
asOFFSET( globalvars_t, v_forward ) );
pDocumentation->RegisterObjectProperty( "Up vector", pszObjectName,
"Vector v_up",
asOFFSET( globalvars_t, v_up ) );
pDocumentation->RegisterObjectProperty( "Right vector", pszObjectName,
"Vector v_right",
asOFFSET( globalvars_t, v_right ) );
pDocumentation->RegisterObjectProperty( "Trace all is solid flag", pszObjectName,
"float trace_allsolid",
asOFFSET( globalvars_t, trace_allsolid ) );
pDocumentation->RegisterObjectProperty( "Trace start is solid flag", pszObjectName,
"float trace_startsolid",
asOFFSET( globalvars_t, trace_startsolid ) );
pDocumentation->RegisterObjectProperty( "Trace fraction", pszObjectName,
"float trace_fraction",
asOFFSET( globalvars_t, trace_fraction ) );
pDocumentation->RegisterObjectProperty( "Trace end position", pszObjectName,
"Vector trace_endpos",
asOFFSET( globalvars_t, trace_endpos ) );
pDocumentation->RegisterObjectProperty( "Trace plane normal", pszObjectName,
"Vector trace_plane_normal",
asOFFSET( globalvars_t, trace_plane_normal ) );
pDocumentation->RegisterObjectProperty( "Trace plane distance", pszObjectName,
"float trace_plane_dist",
asOFFSET( globalvars_t, trace_plane_dist ) );
pDocumentation->RegisterObjectProperty( "Trace entity", pszObjectName,
"edict_t@ trace_ent",
asOFFSET( globalvars_t, trace_ent ) );
pDocumentation->RegisterObjectProperty( "Trace is in open flag", pszObjectName,
"float trace_inopen",
asOFFSET( globalvars_t, trace_inopen ) );
pDocumentation->RegisterObjectProperty( "Trace is in water flag", pszObjectName,
"float trace_inwater",
asOFFSET( globalvars_t, trace_inwater ) );
pDocumentation->RegisterObjectProperty( "Trace hit group", pszObjectName,
"int trace_hitgroup",
asOFFSET( globalvars_t, trace_hitgroup ) );
pDocumentation->RegisterObjectProperty( "Trace flags", pszObjectName,
"int trace_flags",
asOFFSET( globalvars_t, trace_flags ) );
pDocumentation->RegisterObjectProperty( "Message entity", pszObjectName,
"int msg_entity",
asOFFSET( globalvars_t, msg_entity ) );
pDocumentation->RegisterObjectProperty( "CD audio track", pszObjectName,
"int cdAudioTrack",
asOFFSET( globalvars_t, cdAudioTrack ) );
pDocumentation->RegisterObjectProperty( "Maximum connected clients", pszObjectName,
"const int maxClients",
asOFFSET( globalvars_t, maxClients ) );
pDocumentation->RegisterObjectProperty( "Maximum entities", pszObjectName,
"const int maxEntities",
asOFFSET( globalvars_t, maxEntities ) );
pDocumentation->RegisterGlobalProperty( "Engine global variables instance", "CEngine g_Engine", gpGlobals );
pDocumentation->RegisterGlobalProperty( "Goes into g_Engine.trace_flags<br/>Traceline with a simple box",
"const uint FTRACE_SIMPLEBOX", const_cast<size_t*>( &CONST_FTRACE_SIMPLEBOX ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment