Fix some more bugs thanks to Tribes.

Now the mouse y cordinate works fine
Set right timestap on the event. 
Remove time delay on 50ms 
new code for 50ms event calction.

Todo
why does the Tribes get wrong x,y cordinate.
why does the mouse limit area setup are wrong.




svn path=/trunk/; revision=14333
This commit is contained in:
Magnus Olsen 2005-03-26 16:41:45 +00:00
parent 24a420afcf
commit 3210fa3a76

View file

@ -871,6 +871,7 @@ static int b[5];
static POINT point; static POINT point;
int calc; int calc;
int count_button; int count_button;
int add = 0;
#endif #endif
@ -898,19 +899,13 @@ GetCursorPos( &point );
if (This->acquired == 0) { if (This->acquired == 0) {
WARN(" application tries to get data from an unacquired device !\n"); WARN(" application tries to get data from an unacquired device !\n");
//return DIERR_NOTACQUIRED; return DIERR_NOTACQUIRED;
// windows does not get any data if // windows does not get any data if
// we do not call manual to mouse Acquire // we do not call manual to mouse Acquire
// this is only need if some apps calling on getdevice data direcly // this is only need if some apps calling on getdevice data direcly
// in windows GetdeviceData does always update first the data // in windows GetdeviceData does always update first the data
// then return it. // then return it.
if (last_event==0)
{
This->absolute = 0;
SysMouseAImpl_Acquire(iface);
FIXME("This make the mouse choppy in Tribes , need new center code for calcuation of the mouse !!!!!!!!\n");
}
} }
@ -919,6 +914,7 @@ GetCursorPos( &point );
#ifdef __REACTOS__ #ifdef __REACTOS__
if (*entries == 0) return DIERR_INVALIDPARAM; if (*entries == 0) return DIERR_INVALIDPARAM;
if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) { if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) {
@ -930,24 +926,36 @@ GetCursorPos( &point );
return DIERR_NOTINITIALIZED; return DIERR_NOTINITIALIZED;
} }
/* this code are not need it but if we want 100% compatible
with ms we should keep it. but the mouse will be choppy
in Unreal 2004 Demo
if (GetTickCount()-time <50) { if (GetTickCount()-time <50) {
*entries=0; *entries=0;
return DI_OK; return DI_OK;
} }
time = GetTickCount(); time = GetTickCount();
*/
if (GetTickCount()-time <50)
{
add=0;
}
else
{
add=1;
time = GetTickCount();
}
for (count=0;count<*entries;count++) { for (count=0;count<*entries;count++) {
if (save_point.x != point.x) { if (save_point.x != point.x) {
dod[count_ent].dwOfs = DIMOFS_X; dod[count_ent].dwOfs = DIMOFS_X;
dod[count_ent].dwData = point.x - save_point.x; dod[count_ent].dwData = point.x - save_point.x;
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_point.x = point.x; save_point.x = point.x;
} }
@ -956,8 +964,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_Y; dod[count_ent].dwOfs = DIMOFS_Y;
dod[count_ent].dwData = point.y - save_point.y; dod[count_ent].dwData = point.y - save_point.y;
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_point.y = point.y; save_point.y = point.y;
} }
@ -966,8 +974,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON0; dod[count_ent].dwOfs = DIMOFS_BUTTON0;
dod[count_ent].dwData = b[0]; dod[count_ent].dwData = b[0];
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[0] = b[0]; save_b[0] = b[0];
} }
@ -976,8 +984,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON1; dod[count_ent].dwOfs = DIMOFS_BUTTON1;
dod[count_ent].dwData = b[1]; dod[count_ent].dwData = b[1];
dod[count_ent].dwTimeStamp = time ; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[1] = b[1]; save_b[1] = b[1];
} }
@ -986,8 +994,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON2; dod[count_ent].dwOfs = DIMOFS_BUTTON2;
dod[count_ent].dwData = b[2]; dod[count_ent].dwData = b[2];
dod[count_ent].dwTimeStamp = time ; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[2] = b[2]; save_b[2] = b[2];
} }
@ -996,8 +1004,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON3; dod[count_ent].dwOfs = DIMOFS_BUTTON3;
dod[count_ent].dwData = b[3]; dod[count_ent].dwData = b[3];
dod[count_ent].dwTimeStamp = time ; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[3] = b[3]; save_b[3] = b[3];
} }
@ -1005,8 +1013,8 @@ GetCursorPos( &point );
} // end for } // end for
if (count_ent>0)last_event++;
SetCursorPos(save_point.x, save_point.y); SetCursorPos(point.x, point.y);
*entries = count_ent; *entries = count_ent;
#endif #endif