TempleOSCD_140715.ISO
This commit is contained in:
1 parent
7ef616a20e
commit
64f679eeb9
1095 files changed
+24814
-221011
No files matched your search
@@ -1,70 +1,67 @@
|
||||
U0 GridInit()
|
||||
{
|
||||
{//Init input pointer grid struct.
|
||||
ip_grid.x=ip_grid.y=ip_grid.z=8;
|
||||
ip_grid.x_offset=ip_grid.y_offset=ip_grid.z_offset=0;
|
||||
ip_grid.x_speed =ip_grid.y_speed =ip_grid.z_speed =1;
|
||||
ip_grid.show=ip_grid.snap=FALSE;
|
||||
}
|
||||
|
||||
U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool c,Bool r)
|
||||
U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
{
|
||||
ipx_presnap=ToI64(ipx_scale*x)+ipx_offset;
|
||||
ipy_presnap=ToI64(ipy_scale*y)+ipy_offset;
|
||||
ipz_presnap=ToI64(ipz_scale*z)+ipz_offset;
|
||||
ip.presnap.x=ToI64(ip.scale.x*x)+ip.offset.x;
|
||||
ip.presnap.y=ToI64(ip.scale.y*y)+ip.offset.y;
|
||||
ip.presnap.z=ToI64(ip.scale.z*z)+ip.offset.z;
|
||||
if (ip_grid.snap) {
|
||||
ipx=Trunc(ipx_presnap/ip_grid.x)*ip_grid.x+ip_grid.x_offset;
|
||||
ipy=Trunc(ipy_presnap/ip_grid.y)*ip_grid.y+ip_grid.y_offset;
|
||||
ipz=Trunc(ipz_presnap/ip_grid.z)*ip_grid.z+ip_grid.z_offset;
|
||||
ip.pos.x=Trunc(ip.presnap.x/ip_grid.x)*ip_grid.x+ip_grid.x_offset;
|
||||
ip.pos.y=Trunc(ip.presnap.y/ip_grid.y)*ip_grid.y+ip_grid.y_offset;
|
||||
ip.pos.z=Trunc(ip.presnap.z/ip_grid.z)*ip_grid.z+ip_grid.z_offset;
|
||||
} else {
|
||||
ipx=ipx_presnap;
|
||||
ipy=ipy_presnap;
|
||||
ipz=ipz_presnap;
|
||||
ip.pos.x=ip.presnap.x;
|
||||
ip.pos.y=ip.presnap.y;
|
||||
ip.pos.z=ip.presnap.z;
|
||||
}
|
||||
|
||||
ipx=ClampI64(ipx,0,gr_width-1);
|
||||
ipy=ClampI64(ipy,0,gr_height-1);
|
||||
ip_throttle=ClampI64(ip_throttle,MIN_I32,MAX_I32);
|
||||
iptx=ipx/FONT_WIDTH;
|
||||
if (iptx>=text_cols) {
|
||||
iptx=text_cols-1;
|
||||
ipx=text_cols*FONT_WIDTH-1;
|
||||
ip.pos.x=ClampI64(ip.pos.x,0,GR_WIDTH-1);
|
||||
ip.pos.y=ClampI64(ip.pos.y,0,GR_HEIGHT-1);
|
||||
ip.throttle=ClampI64(ip.throttle,MIN_I32,MAX_I32);
|
||||
ip.pos_text.x=ip.pos.x/FONT_WIDTH;
|
||||
if (ip.pos_text.x>=text.cols) {
|
||||
ip.pos_text.x=text.cols-1;
|
||||
ip.pos.x=text.cols*FONT_WIDTH-1;
|
||||
}
|
||||
ipty=ipy/FONT_HEIGHT;
|
||||
if (ipty>=text_rows) {
|
||||
ipty=text_rows-1;
|
||||
ipy=text_rows*FONT_HEIGHT-1;
|
||||
ip.pos_text.y=ip.pos.y/FONT_HEIGHT;
|
||||
if (ip.pos_text.y>=text.rows) {
|
||||
ip.pos_text.y=text.rows-1;
|
||||
ip.pos.y=text.rows*FONT_HEIGHT-1;
|
||||
}
|
||||
ip_lb=l;
|
||||
ip_cb=c;
|
||||
ip_rb=r;
|
||||
LBEqu(&sys_cur_scan_code,SCf_IP_L_DOWN,ip_lb);
|
||||
LBEqu(&sys_cur_scan_code,SCf_IP_R_DOWN,ip_rb);
|
||||
ip.lb=l;
|
||||
ip.rb=r;
|
||||
LBEqu(&kbd.scan_code,SCf_IP_L_DOWN,ip.lb);
|
||||
LBEqu(&kbd.scan_code,SCf_IP_R_DOWN,ip.rb);
|
||||
}
|
||||
|
||||
U0 SetIP(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64,I64 c=MAX_I64)
|
||||
{ //Note: Generates a message.
|
||||
U0 SetIP(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64)
|
||||
{//Note: Generates a message.
|
||||
Bool old_preempt=Preempt(OFF);
|
||||
if (!(0<=x<gr_width))
|
||||
x=ipx;
|
||||
if (!(0<=y<gr_height))
|
||||
y=ipy;
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
x=ip.pos.x;
|
||||
if (!(0<=y<GR_HEIGHT))
|
||||
y=ip.pos.y;
|
||||
if (z==MAX_I64)
|
||||
z=ipz;
|
||||
z=ip.pos.z;
|
||||
|
||||
if (!(FALSE<=l<=TRUE))
|
||||
l=ip_lb;
|
||||
if (!(FALSE<=c<=TRUE))
|
||||
c=ip_cb;
|
||||
l=ip.lb;
|
||||
if (!(FALSE<=r<=TRUE))
|
||||
r=ip_rb;
|
||||
r=ip.rb;
|
||||
|
||||
x=(x-ipx_offset)/ipx_scale;
|
||||
y=(y-ipy_offset)/ipy_scale;
|
||||
z=(z-ipz_offset)/ipz_scale;
|
||||
IPVarsUpdate(x,y,z,l,c,r);
|
||||
switch (ip_dev) {
|
||||
x=(x-ip.offset.x)/ip.scale.x;
|
||||
y=(y-ip.offset.y)/ip.scale.y;
|
||||
z=(z-ip.offset.z)/ip.scale.z;
|
||||
IPVarsUpdate(x,y,z,l,r);
|
||||
switch (ip.dev) {
|
||||
case IP_MOUSE:
|
||||
SetMouseIP(x,y,z,l,c,r);
|
||||
SetMouseIP(x,y,z,l,r);
|
||||
break;
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
@@ -72,28 +69,18 @@ U0 SetIP(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64,I
|
||||
|
||||
U0 IPVarsInit()
|
||||
{
|
||||
ipx=0;
|
||||
ipy=0;
|
||||
ipz=0;
|
||||
ip_throttle=0;
|
||||
ip_throttle_step=(MAX_I32+1)>>3;
|
||||
ipx_offset=0;
|
||||
ipy_offset=0;
|
||||
ipz_offset=0;
|
||||
ipx_scale=1.0;
|
||||
ipy_scale=1.0;
|
||||
ipz_scale=1.0;
|
||||
ip_speed=0;
|
||||
ip_dev=IP_NULL;
|
||||
iptx=ipx/FONT_WIDTH;
|
||||
ipty=ipy/FONT_HEIGHT;
|
||||
ip_on=TRUE;
|
||||
ip_lb_last=FALSE;
|
||||
ip_rb_last=FALSE;
|
||||
ip_lb=FALSE;
|
||||
ip_cb=FALSE;
|
||||
ip_rb=FALSE;
|
||||
ip_has_wheel=FALSE;
|
||||
ip_last_move_time=tS;
|
||||
MemSet(&ip,0,sizeof(CIPStateGlbls));
|
||||
MemSet(&ip_last,0,sizeof(CIPStateGlbls));
|
||||
ip.throttle=0;
|
||||
ip.throttle_step=(MAX_I32+1)>>3;
|
||||
ip.offset.x=ip.offset.y=ip.offset.z=0;
|
||||
ip.scale.x=ip.scale.y=ip.scale.z=1.0;
|
||||
ip.dev=IP_NULL;
|
||||
ip.pos_text.x=ip.pos_text.y=ip.pos_text.z=0;
|
||||
ip.has_wheel=FALSE;
|
||||
ip.show=TRUE;
|
||||
ip.speed=0;
|
||||
ip.timestamp=GetTSC;
|
||||
ip.dbl_time=0.350;
|
||||
GridInit;
|
||||
}
|
||||
Reference in new issue
Block a user