diff options
author | Simon Howard | 2010-02-06 03:14:20 +0000 |
---|---|---|
committer | Simon Howard | 2010-02-06 03:14:20 +0000 |
commit | d9520b6415f8e373cf759f316094b986e57f0f5a (patch) | |
tree | d256f7d4f1941ec33ae3c956449c70349de7297d /src/strife/g_game.c | |
parent | 57011e785808847273461aaf6d8ed1df76ff1db9 (diff) | |
parent | 52f81b4ef175358d1e1f7f9eecab2a1edb7f4b65 (diff) | |
download | chocolate-doom-d9520b6415f8e373cf759f316094b986e57f0f5a.tar.gz chocolate-doom-d9520b6415f8e373cf759f316094b986e57f0f5a.tar.bz2 chocolate-doom-d9520b6415f8e373cf759f316094b986e57f0f5a.zip |
Merge from trunk.
Subversion-branch: /branches/strife-branch
Subversion-revision: 1849
Diffstat (limited to 'src/strife/g_game.c')
-rw-r--r-- | src/strife/g_game.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/strife/g_game.c b/src/strife/g_game.c index 35bf4d74..8d0e4503 100644 --- a/src/strife/g_game.c +++ b/src/strife/g_game.c @@ -588,10 +588,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; } } |