summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2009-12-28 20:57:20 +0000
committerSimon Howard2009-12-28 20:57:20 +0000
commit2e6406e08349f3bfb6f5d38ac5042aca7a02073d (patch)
treeab59b0f1d16258f80513c1f96b4f354c0135f96d /src
parent51948fd78f11d689af0c8a6201fcfd3b87392c77 (diff)
downloadchocolate-doom-2e6406e08349f3bfb6f5d38ac5042aca7a02073d.tar.gz
chocolate-doom-2e6406e08349f3bfb6f5d38ac5042aca7a02073d.tar.bz2
chocolate-doom-2e6406e08349f3bfb6f5d38ac5042aca7a02073d.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/g_game.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/g_game.c b/src/g_game.c
index 8255fdd0..542c1a7d 100644
--- a/src/g_game.c
+++ b/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;
}
}