When recording low resolution (non-longtics) Vanilla demos, carry
forward the error from angleturn caused by the reduced resolution, so that consecutive errors can accumulate, possibly making turning slightly smoother. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1770
This commit is contained in:
parent
51948fd78f
commit
2e6406e083
1 changed files with 12 additions and 2 deletions
14
src/g_game.c
14
src/g_game.c
|
|
@ -650,10 +650,20 @@ void G_BuildTiccmd (ticcmd_t* cmd)
|
|||
|
||||
if (lowres_turn)
|
||||
{
|
||||
// round angleturn to the nearest 256 boundary
|
||||
static signed short carry = 0;
|
||||
signed short desired_angleturn;
|
||||
|
||||
desired_angleturn = cmd->angleturn + carry;
|
||||
|
||||
// round angleturn to the nearest 256 unit boundary
|
||||
// for recording demos with single byte values for turn
|
||||
|
||||
cmd->angleturn = (cmd->angleturn + 128) & 0xff00;
|
||||
cmd->angleturn = (desired_angleturn + 128) & 0xff00;
|
||||
|
||||
// Carry forward the error from the reduced resolution to the
|
||||
// next tic, so that successive small movements can accumulate.
|
||||
|
||||
carry = desired_angleturn - cmd->angleturn;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue