Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce fast mouse polling for lower lag interpolation #1194

Merged
merged 13 commits into from
Aug 2, 2024
4 changes: 4 additions & 0 deletions src/d_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#define MAXEVENTS 64

// [crispy]
event_t fastmouse;
boolean newfastmouse;

static event_t events[MAXEVENTS];
static int eventhead;
static int eventtail;
Expand Down
3 changes: 3 additions & 0 deletions src/d_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ typedef enum
} buttoncode2_t;


// [crispy] For fast polling
extern event_t fastmouse;

extern boolean newfastmouse;

// Called by IO functions when input is detected.
void D_PostEvent (event_t *ev);
Expand Down
10 changes: 5 additions & 5 deletions src/doom/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,8 +1910,8 @@ void AM_drawPlayers(void)
// [crispy] interpolate other player arrows
if (crispy->uncapped && leveltime > oldleveltime)
{
pt.x = (p->mo->oldx + FixedMul(p->mo->x - p->mo->oldx, fractionaltic)) >> FRACTOMAPBITS;
pt.y = (p->mo->oldy + FixedMul(p->mo->y - p->mo->oldy, fractionaltic)) >> FRACTOMAPBITS;
pt.x = LerpFixed(p->mo->oldx, p->mo->x) >> FRACTOMAPBITS;
pt.y = LerpFixed(p->mo->oldy, p->mo->y) >> FRACTOMAPBITS;
}
else
{
Expand All @@ -1926,7 +1926,7 @@ void AM_drawPlayers(void)
}
else
{
theirangle = R_InterpolateAngle(p->mo->oldangle, p->mo->angle, fractionaltic);
theirangle = LerpAngle(p->mo->oldangle, p->mo->angle);
}

AM_drawLineCharacter
Expand Down Expand Up @@ -1961,8 +1961,8 @@ AM_drawThings
// [crispy] interpolate thing triangles movement
if (leveltime > oldleveltime)
{
pt.x = (t->oldx + FixedMul(t->x - t->oldx, fractionaltic)) >> FRACTOMAPBITS;
pt.y = (t->oldy + FixedMul(t->y - t->oldy, fractionaltic)) >> FRACTOMAPBITS;
pt.x = LerpFixed(t->oldx, t->x) >> FRACTOMAPBITS;
pt.y = LerpFixed(t->oldy, t->y) >> FRACTOMAPBITS;
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions src/doom/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ boolean D_Display (void)

redrawsbar = false;

if (crispy->uncapped)
{
I_StartDisplay();
G_FastResponder();
G_PrepTiccmd();
}

// change the view size if needed
if (setsizeneeded)
{
Expand Down
Loading