summaryrefslogtreecommitdiff
path: root/src/doom/g_game.c
diff options
context:
space:
mode:
authorSimon Howard2010-02-05 23:08:12 +0000
committerSimon Howard2010-02-05 23:08:12 +0000
commit677729c658b39f075e563fbc9f5a898641f7de54 (patch)
tree109bae4ac22fbc6f8a34ba34a4e9fc6a33e75c48 /src/doom/g_game.c
parent8a77b34e936a3fd752db3bc1113e3d7bd0555440 (diff)
parentb4f2d75b34b6e2b9bbb2fa6449125d3446a93a73 (diff)
downloadchocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.tar.gz
chocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.tar.bz2
chocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.zip
Merge from trunk.
Subversion-branch: /branches/raven-branch Subversion-revision: 1845
Diffstat (limited to 'src/doom/g_game.c')
-rw-r--r--src/doom/g_game.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 35bf4d74..8d0e4503 100644
--- a/src/doom/g_game.c
+++ b/src/doom/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;
}
}