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:
Spoike 2012-10-13 01:00:53 +00:00
parent 5d9ba4b548
commit 586cedea8b
2 changed files with 733 additions and 724 deletions

View File

@ -29,6 +29,9 @@ void() wrap_renderscene =
{
local int retval;
vector col;
vidsize = getproperty(VF_SCREENVSIZE);
/*inactive? then show nothing*/
if (!autocvar_ca_show)
{
@ -95,8 +98,6 @@ void() wrap_renderscene =
setproperty(VF_DRAWENGINESBAR, 0);
setproperty(VF_DRAWCROSSHAIR, 0);
vidsize = getproperty(VF_SIZE);
if (autocvar_ca_editormode == MODE_LIGHTEDIT)
editor_lights_add();
else if (autocvar_ca_editormode == MODE_SPLINEEDIT)
@ -153,23 +154,6 @@ void() wrap_renderscene =
else if (autocvar_ca_editormode == MODE_TERRAINEDIT)
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);
};
@ -312,11 +296,14 @@ void() CSQC_Input_Frame =
pointedshadername = strzone(pointedshadername);
//print("sending input to ", pointedshadername, "\n");
gecko_navigate(pointedshadername, "cmd:focus");
pointedent = trace_ent;
pointedsurface = s;
}
}
}
if (pointedshadername != "")
{
input_buttons = input_buttons - (input_buttons & 1);
@ -324,6 +311,7 @@ void() CSQC_Input_Frame =
makevectors(input_angles);
if (v_forward * pointedsurfacenormal >= 0)
{
gecko_navigate(pointedshadername, "cmd:unfocus");
strunzone(pointedshadername);
pointedshadername = "";
// print("release (angle)!\n");
@ -344,11 +332,11 @@ void() CSQC_Input_Frame =
vector xyz1, xyz2, xyz3;
vector st1, st2, st3;
xyz1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 0);
xyz2 = getsurfacepointattribute(pointedent, pointedsurface, 2, 0);
xyz3 = getsurfacepointattribute(pointedent, pointedsurface, 1, 0);
xyz2 = getsurfacepointattribute(pointedent, pointedsurface, 1, 0);
xyz3 = getsurfacepointattribute(pointedent, pointedsurface, 2, 0);
st1 = getsurfacepointattribute(pointedent, pointedsurface, 0, 4);
st2 = getsurfacepointattribute(pointedent, pointedsurface, 2, 4);
st3 = getsurfacepointattribute(pointedent, pointedsurface, 1, 4);
st2 = getsurfacepointattribute(pointedent, pointedsurface, 1, 4);
st3 = getsurfacepointattribute(pointedent, pointedsurface, 2, 4);
float f1, f2, backoff;
vector dir1 = xyz2 - xyz1;
@ -381,10 +369,22 @@ void() CSQC_Input_Frame =
res_x-= floor(res_x);
res_y-= floor(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*/
float (float event, float parama, float paramb) CSQC_InputEvent =
{

View File

@ -29,8 +29,7 @@ float intermission;
vector v_forward, v_up, v_right;
vector view_angles;
float trace_allsolid, trace_startsolid, trace_fraction;
shared vector trace_endpos;
vector trace_plane_normal;
vector trace_endpos, trace_plane_normal;
float trace_plane_dist;
entity trace_ent;
float trace_inopen;
@ -81,8 +80,10 @@ void end_sys_fields;
.float hull;
.entity movechain;
.void() chainmoved;
.void(float old, float new) contentstransition;
.float dimension_solid;
.float dimension_hit;
.float hitcontentsmask;
.float scale;
.float fatness;
.float alpha;
@ -114,6 +115,7 @@ void end_sys_fields;
.float ideal_pitch;
.float pitch_speed;
var float physics_mode = 2;
float gamespeed;
#define TRUE 1
#define FALSE 0
#define MOVETYPE_NONE 0
@ -166,6 +168,7 @@ var float physics_mode = 2;
#define FL_ONGROUND 512
#define FL_PARTIALGROUND 1024
#define FL_WATERJUMP 2048
#define FL_JUMPRELEASED 4096
#define FL_FINDABLE_NONSOLID 16384
#define MOVE_NORMAL 0
#define MOVE_NOMONSTERS 1
@ -228,6 +231,8 @@ var float physics_mode = 2;
#define VF_PERSPECTIVE 200
#define VF_LPLAYER 202
#define VF_AFOV 203
#define VF_SCREENVSIZE 204
#define VF_SCREENPSIZE 205
#define RF_VIEWMODEL 1
#define RF_EXTERNALMODEL 2
#define RF_DEPTHHACK 4
@ -481,10 +486,8 @@ void(float buf, float fl) writefloat = #280;
#endif
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*(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;
string(float modidx, float framenum) frametoname = #284;
string(float modidx, float skin) skintoname = #285;
#ifdef CSQC
void() clearscene = #300;
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;
string(float efnum, float body) particleeffectquery = #374;
#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;
#ifdef SSQC
void(entity from, entity to) setcolors = #401;
@ -698,4 +705,6 @@ void(float fh, entity e) writetofile = #606;
float(string s) isfunction = #607;
void(entity e, string s) parseentitydata = #608;
string(...) sprintf = #627;
float(entity e, float s) getsurfacenumtriangles = #628;
vector(entity e, float s, float n) getsurfacetriangle = #629;
#pragma noref 0