2015-04-27 05:10:01 +00:00
|
|
|
//addons cannot use certain optimisations - the engine MUST be able to find+fix their string+function indexes.
|
|
|
|
#pragma optimise addon //disables any optimisations that would break addons.
|
|
|
|
|
|
|
|
//#define CAMQUAKE
|
|
|
|
|
2013-04-09 01:04:43 +00:00
|
|
|
//with addons, the engine only tracks one set of globals for most things.
|
|
|
|
//thus we use pointers in the addon to refer to that set of globals.
|
|
|
|
//this avoids having to make things shared, and having to pay for every transition.
|
|
|
|
|
|
|
|
vector *ptr_trace_endpos;
|
|
|
|
#define trace_endpos (*ptr_trace_endpos)
|
|
|
|
|
|
|
|
vector *ptr_trace_plane_normal;
|
|
|
|
#define trace_plane_normal (*ptr_trace_plane_normal)
|
|
|
|
|
2015-09-14 10:36:42 +00:00
|
|
|
entity *ptr_trace_ent;
|
|
|
|
#define trace_ent (*ptr_trace_ent)
|
|
|
|
|
2013-04-09 01:04:43 +00:00
|
|
|
entity *ptr_self;
|
|
|
|
#define self (*ptr_self)
|
|
|
|
|
|
|
|
void() csfixups =
|
|
|
|
{
|
|
|
|
ptr_trace_endpos = (vector*)externvalue(0, "&trace_endpos");
|
|
|
|
ptr_trace_plane_normal = (vector*)externvalue(0, "&trace_plane_normal");
|
2015-09-14 10:36:42 +00:00
|
|
|
ptr_trace_ent = (entity*)externvalue(0, "&trace_ent");
|
2013-04-09 01:04:43 +00:00
|
|
|
ptr_self = (entity*)externvalue(0, "&self");
|
|
|
|
};
|
|
|
|
|
2014-06-16 20:45:44 +00:00
|
|
|
|
|
|
|
vector mousenear;
|
|
|
|
vector mousefar;
|
2015-04-27 05:10:01 +00:00
|
|
|
float mousedown;
|
2015-09-14 10:36:42 +00:00
|
|
|
float shiftdown;
|
|
|
|
float ctrldown;
|
|
|
|
float altdown;
|
2015-04-27 05:10:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2015-09-14 10:36:42 +00:00
|
|
|
MODE_OPTIONS,
|
|
|
|
|
|
|
|
MODE_LIGHTEDIT,
|
|
|
|
MODE_SPLINEEDIT,
|
|
|
|
MODE_TERRAINEDIT,
|
|
|
|
MODE_BRUSHEDIT,
|
|
|
|
MODE_PARTICLEEDIT,
|
|
|
|
MODE_ENTSEDIT,
|
|
|
|
|
|
|
|
MODE_COUNT
|
2015-04-27 05:10:01 +00:00
|
|
|
};
|
|
|
|
|
2015-09-14 10:36:42 +00:00
|
|
|
var string editornames[MODE_COUNT] = {"OPTIONS","LIGHTS","SPLINES", "TERRAIN", "BRUSHES", "PARTICLES", "ENTITIES"};
|
|
|
|
|
|
|
|
var float(float vismode) ca_checksave;
|