Change some clocks to support sub-tick precision using a new class, ClockTicks.

Using that higher precision, interpolate at a higher granularity.
Further, truncate the target interpolation time to vertical blank boundaries to avoid producing temporal artifacts.
Fix issues caused by interpolation calculations being handled differently in multiple places (and fix cases where smoothratios were being thrown away only to be redone without checking all proper conditions).
Ensure ClockTicks changes do not break other targets (EKenBuild, VoidSW), but note any interpolation there is not similarly updated.

git-svn-id: https://svn.eduke32.com/eduke32@8050 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
#	source/build/src/sdlayer.cpp
This commit is contained in:
pogokeen 2019-08-27 13:39:54 +00:00 committed by Christoph Oelckers
parent ec7fce9ff2
commit 222e593437
41 changed files with 339 additions and 162 deletions

View file

@ -622,7 +622,7 @@ void computergetinput(int snum, SW_PACKET *syn)
//Strafe attack
if (fightdist)
{
j = totalclock+snum*13468;
j = (int32_t) totalclock+snum*13468;
i = sintable[(j<<6)&2047];
i += sintable[((j+4245)<<5)&2047];
i += sintable[((j+6745)<<4)&2047];
@ -843,7 +843,7 @@ void computergetinput(int snum, SW_PACKET *syn)
daang = getangle(x2-x1,y2-y1);
if ((i&0xc000) == 32768)
daang = getangle(wall[wall[i&(MAXWALLS-1)].point2].x-wall[i&(MAXWALLS-1)].x,wall[wall[i&(MAXWALLS-1)].point2].y-wall[i&(MAXWALLS-1)].y);
j = totalclock+snum*13468;
j = (int32_t) totalclock+snum*13468;
i = sintable[(j<<6)&2047];
i += sintable[((j+4245)<<5)&2047];
i += sintable[((j+6745)<<4)&2047];