Directly query client for video size.
Berkelium focus now properly tracked. The cursor blinks on google. yay. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4125 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5d9ba4b548
commit
586cedea8b
2 changed files with 733 additions and 724 deletions
|
@ -29,6 +29,9 @@ void() wrap_renderscene =
|
||||||
{
|
{
|
||||||
local int retval;
|
local int retval;
|
||||||
vector col;
|
vector col;
|
||||||
|
|
||||||
|
vidsize = getproperty(VF_SCREENVSIZE);
|
||||||
|
|
||||||
/*inactive? then show nothing*/
|
/*inactive? then show nothing*/
|
||||||
if (!autocvar_ca_show)
|
if (!autocvar_ca_show)
|
||||||
{
|
{
|
||||||
|
@ -95,8 +98,6 @@ void() wrap_renderscene =
|
||||||
setproperty(VF_DRAWENGINESBAR, 0);
|
setproperty(VF_DRAWENGINESBAR, 0);
|
||||||
setproperty(VF_DRAWCROSSHAIR, 0);
|
setproperty(VF_DRAWCROSSHAIR, 0);
|
||||||
|
|
||||||
vidsize = getproperty(VF_SIZE);
|
|
||||||
|
|
||||||
if (autocvar_ca_editormode == MODE_LIGHTEDIT)
|
if (autocvar_ca_editormode == MODE_LIGHTEDIT)
|
||||||
editor_lights_add();
|
editor_lights_add();
|
||||||
else if (autocvar_ca_editormode == MODE_SPLINEEDIT)
|
else if (autocvar_ca_editormode == MODE_SPLINEEDIT)
|
||||||
|
@ -153,23 +154,6 @@ void() wrap_renderscene =
|
||||||
else if (autocvar_ca_editormode == MODE_TERRAINEDIT)
|
else if (autocvar_ca_editormode == MODE_TERRAINEDIT)
|
||||||
editor_terrain_overlay(curmousepos);
|
editor_terrain_overlay(curmousepos);
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
vector t = unproject((vidsize*0.5) + '0 0 8192');
|
|
||||||
vector o = unproject(vidsize*0.5);
|
|
||||||
if (vlen(o - t) > 8192)
|
|
||||||
t = o + normalize(t)*8192;
|
|
||||||
traceline(o, t, TRUE, world);
|
|
||||||
|
|
||||||
float s = getsurfacenearpoint(trace_ent, trace_endpos);
|
|
||||||
string sname = getsurfacetexture(trace_ent, s);
|
|
||||||
if (sname != pointedshadername)
|
|
||||||
{
|
|
||||||
strunzone(pointedshadername);
|
|
||||||
pointedshadername = strzone(sname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
drawcharacter(curmousepos - '4 4', '+', '8 8', '1 1 1', 1);
|
drawcharacter(curmousepos - '4 4', '+', '8 8', '1 1 1', 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -312,11 +296,14 @@ void() CSQC_Input_Frame =
|
||||||
pointedshadername = strzone(pointedshadername);
|
pointedshadername = strzone(pointedshadername);
|
||||||
//print("sending input to ", pointedshadername, "\n");
|
//print("sending input to ", pointedshadername, "\n");
|
||||||
|
|
||||||
|
gecko_navigate(pointedshadername, "cmd:focus");
|
||||||
|
|
||||||
pointedent = trace_ent;
|
pointedent = trace_ent;
|
||||||
pointedsurface = s;
|
pointedsurface = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointedshadername != "")
|
if (pointedshadername != "")
|
||||||
{
|
{
|
||||||
input_buttons = input_buttons - (input_buttons & 1);
|
input_buttons = input_buttons - (input_buttons & 1);
|
||||||
|
@ -324,6 +311,7 @@ void() CSQC_Input_Frame =
|
||||||
makevectors(input_angles);
|
makevectors(input_angles);
|
||||||
if (v_forward * pointedsurfacenormal >= 0)
|
if (v_forward * pointedsurfacenormal >= 0)
|
||||||
{
|
{
|
||||||
|
gecko_navigate(pointedshadername, "cmd:unfocus");
|
||||||
strunzone(pointedshadername);
|
strunzone(pointedshadername);
|
||||||
pointedshadername = "";
|
pointedshadername = "";
|
||||||
// print("release (angle)!\n");
|
// print("release (angle)!\n");
|
||||||
|
@ -344,11 +332,11 @@ void() CSQC_Input_Frame =
|
||||||
vector xyz1, xyz2, xyz3;
|
vector xyz1, xyz2, xyz3;
|
||||||
vector st1, st2, st3;
|
vector st1, st2, st3;
|
||||||
xyz1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 0);
|
xyz1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 0);
|
||||||
xyz2 = getsurfacepointattribute(pointedent, pointedsurface, 2, 0);
|
xyz2 = getsurfacepointattribute(pointedent, pointedsurface, 1, 0);
|
||||||
xyz3 = getsurfacepointattribute(pointedent, pointedsurface, 1, 0);
|
xyz3 = getsurfacepointattribute(pointedent, pointedsurface, 2, 0);
|
||||||
st1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 4);
|
st1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 4);
|
||||||
st2 = getsurfacepointattribute(pointedent, pointedsurface, 2, 4);
|
st2 = getsurfacepointattribute(pointedent, pointedsurface, 1, 4);
|
||||||
st3 = getsurfacepointattribute(pointedent, pointedsurface, 1, 4);
|
st3 = getsurfacepointattribute(pointedent, pointedsurface, 2, 4);
|
||||||
|
|
||||||
float f1, f2, backoff;
|
float f1, f2, backoff;
|
||||||
vector dir1 = xyz2 - xyz1;
|
vector dir1 = xyz2 - xyz1;
|
||||||
|
@ -381,10 +369,22 @@ void() CSQC_Input_Frame =
|
||||||
res_x-= floor(res_x);
|
res_x-= floor(res_x);
|
||||||
res_y-= floor(res_y);
|
res_y-= floor(res_y);
|
||||||
gecko_mousemove(pointedshadername, res_x, res_y);
|
gecko_mousemove(pointedshadername, res_x, res_y);
|
||||||
|
|
||||||
|
// pointparticles(particleeffectnum("te_spike"), xyz1 + dir1*f1 + dir2*f2, trace_plane_normal, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
float(string txt, string info) CSQC_ConsoleLink =
|
||||||
|
{
|
||||||
|
print("Console link pressed. Text \"", txt, "\"\n");
|
||||||
|
print("Info: \"", info, "\"\n");
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
/*this is a fallback function, in case the main progs does not have one*/
|
/*this is a fallback function, in case the main progs does not have one*/
|
||||||
float (float event, float parama, float paramb) CSQC_InputEvent =
|
float (float event, float parama, float paramb) CSQC_InputEvent =
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,7 @@ float intermission;
|
||||||
vector v_forward, v_up, v_right;
|
vector v_forward, v_up, v_right;
|
||||||
vector view_angles;
|
vector view_angles;
|
||||||
float trace_allsolid, trace_startsolid, trace_fraction;
|
float trace_allsolid, trace_startsolid, trace_fraction;
|
||||||
shared vector trace_endpos;
|
vector trace_endpos, trace_plane_normal;
|
||||||
vector trace_plane_normal;
|
|
||||||
float trace_plane_dist;
|
float trace_plane_dist;
|
||||||
entity trace_ent;
|
entity trace_ent;
|
||||||
float trace_inopen;
|
float trace_inopen;
|
||||||
|
@ -81,8 +80,10 @@ void end_sys_fields;
|
||||||
.float hull;
|
.float hull;
|
||||||
.entity movechain;
|
.entity movechain;
|
||||||
.void() chainmoved;
|
.void() chainmoved;
|
||||||
|
.void(float old, float new) contentstransition;
|
||||||
.float dimension_solid;
|
.float dimension_solid;
|
||||||
.float dimension_hit;
|
.float dimension_hit;
|
||||||
|
.float hitcontentsmask;
|
||||||
.float scale;
|
.float scale;
|
||||||
.float fatness;
|
.float fatness;
|
||||||
.float alpha;
|
.float alpha;
|
||||||
|
@ -114,6 +115,7 @@ void end_sys_fields;
|
||||||
.float ideal_pitch;
|
.float ideal_pitch;
|
||||||
.float pitch_speed;
|
.float pitch_speed;
|
||||||
var float physics_mode = 2;
|
var float physics_mode = 2;
|
||||||
|
float gamespeed;
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#define MOVETYPE_NONE 0
|
#define MOVETYPE_NONE 0
|
||||||
|
@ -166,6 +168,7 @@ var float physics_mode = 2;
|
||||||
#define FL_ONGROUND 512
|
#define FL_ONGROUND 512
|
||||||
#define FL_PARTIALGROUND 1024
|
#define FL_PARTIALGROUND 1024
|
||||||
#define FL_WATERJUMP 2048
|
#define FL_WATERJUMP 2048
|
||||||
|
#define FL_JUMPRELEASED 4096
|
||||||
#define FL_FINDABLE_NONSOLID 16384
|
#define FL_FINDABLE_NONSOLID 16384
|
||||||
#define MOVE_NORMAL 0
|
#define MOVE_NORMAL 0
|
||||||
#define MOVE_NOMONSTERS 1
|
#define MOVE_NOMONSTERS 1
|
||||||
|
@ -228,6 +231,8 @@ var float physics_mode = 2;
|
||||||
#define VF_PERSPECTIVE 200
|
#define VF_PERSPECTIVE 200
|
||||||
#define VF_LPLAYER 202
|
#define VF_LPLAYER 202
|
||||||
#define VF_AFOV 203
|
#define VF_AFOV 203
|
||||||
|
#define VF_SCREENVSIZE 204
|
||||||
|
#define VF_SCREENPSIZE 205
|
||||||
#define RF_VIEWMODEL 1
|
#define RF_VIEWMODEL 1
|
||||||
#define RF_EXTERNALMODEL 2
|
#define RF_EXTERNALMODEL 2
|
||||||
#define RF_DEPTHHACK 4
|
#define RF_DEPTHHACK 4
|
||||||
|
@ -481,10 +486,8 @@ void(float buf, float fl) writefloat = #280;
|
||||||
#endif
|
#endif
|
||||||
float*(float skel) skel_mmap = #282;
|
float*(float skel) skel_mmap = #282;
|
||||||
void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283;
|
void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283;
|
||||||
void*(int size) memalloc = #384;
|
string(float modidx, float framenum) frametoname = #284;
|
||||||
void(void *ptr) memfree = #385;
|
string(float modidx, float skin) skintoname = #285;
|
||||||
void(void *dst, void *src, int size) memcpy = #386;
|
|
||||||
void(void *dst, int val, int size) memset = #387;
|
|
||||||
#ifdef CSQC
|
#ifdef CSQC
|
||||||
void() clearscene = #300;
|
void() clearscene = #300;
|
||||||
void(float mask) addentities = #301;
|
void(float mask) addentities = #301;
|
||||||
|
@ -563,6 +566,10 @@ __variant(float lno, float fld) dynamiclight_get = #372;
|
||||||
void(float lno, float fld, __variant value) dynamiclight_set = #373;
|
void(float lno, float fld, __variant value) dynamiclight_set = #373;
|
||||||
string(float efnum, float body) particleeffectquery = #374;
|
string(float efnum, float body) particleeffectquery = #374;
|
||||||
#endif
|
#endif
|
||||||
|
void*(int size) memalloc = #384;
|
||||||
|
void(void *ptr) memfree = #385;
|
||||||
|
void(void *dst, void *src, int size) memcpy = #386;
|
||||||
|
void(void *dst, int val, int size) memset = #387;
|
||||||
void(entity from, entity to) copyentity = #400;
|
void(entity from, entity to) copyentity = #400;
|
||||||
#ifdef SSQC
|
#ifdef SSQC
|
||||||
void(entity from, entity to) setcolors = #401;
|
void(entity from, entity to) setcolors = #401;
|
||||||
|
@ -698,4 +705,6 @@ void(float fh, entity e) writetofile = #606;
|
||||||
float(string s) isfunction = #607;
|
float(string s) isfunction = #607;
|
||||||
void(entity e, string s) parseentitydata = #608;
|
void(entity e, string s) parseentitydata = #608;
|
||||||
string(...) sprintf = #627;
|
string(...) sprintf = #627;
|
||||||
|
float(entity e, float s) getsurfacenumtriangles = #628;
|
||||||
|
vector(entity e, float s, float n) getsurfacetriangle = #629;
|
||||||
#pragma noref 0
|
#pragma noref 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue