Skip to content

Commit

Permalink
Merge pull request #1194 from fabiangreffrath/fastpoll
Browse files Browse the repository at this point in the history
Introduce fast mouse polling for lower lag interpolation
  • Loading branch information
SoDOOManiac authored Aug 2, 2024
2 parents d81d233 + 89b5bf2 commit ae2fc6e
Show file tree
Hide file tree
Showing 44 changed files with 1,349 additions and 372 deletions.
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

0 comments on commit ae2fc6e

Please sign in to comment.