From 38d10cc59108dc53fccf7a898193ff03e0ecbb1b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 30 Aug 2020 13:04:07 +0200 Subject: [PATCH] - game input works, but still no 3D scene rendered. --- source/games/duke/src/gameloop.cpp | 5 +++++ source/games/duke/src/inlines.h | 5 +++++ source/games/duke/src/player_d.cpp | 4 +--- source/games/duke/src/player_r.cpp | 4 +--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/gameloop.cpp b/source/games/duke/src/gameloop.cpp index d7bdae796..3b12abd07 100644 --- a/source/games/duke/src/gameloop.cpp +++ b/source/games/duke/src/gameloop.cpp @@ -46,6 +46,11 @@ BEGIN_DUKE_NS void GameInterface::Ticker() { + // Make copies so that the originals do not have to be modified. + for (int i = 0; i < MAXPLAYERS; i++) + { + sync[i] = playercmds[i].ucmd; + } ud.camerasprite = -1; if (earthquaketime > 0) earthquaketime--; diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index a4f8fae52..0b7732a28 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -162,6 +162,11 @@ inline fixed_t PlayerInputAngVel(int pl) return sync[pl].q16avel; } +inline fixed_t PlayerHorizon(int pl) +{ + return sync[pl].q16horz; +} + inline void clearfriction() { for (int i = 0; i != -1; i = connectpoint2[i]) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 34eef0d52..4b7f919fb 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1339,8 +1339,6 @@ int doincrements_d(struct player_struct* p) int snum; snum = sprite[p->i].yvel; - // j = sync[snum].avel; - // p->weapon_ang = -(j/5); p->player_par++; @@ -3039,7 +3037,7 @@ HORIZONLY: if (cl_syncinput) { - sethorizon(snum, actions, 1, sync[snum].q16horz); + sethorizon(snum, actions, 1, PlayerHorizon(snum)); } checkhardlanding(p); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index c3ae51519..dc35de734 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1207,8 +1207,6 @@ int doincrements_r(struct player_struct* p) } snum = sprite[p->i].yvel; - // j = sync[snum].avel; - // p->weapon_ang = -(j/5); p->player_par++; if (p->yehaa_timer) @@ -4085,7 +4083,7 @@ HORIZONLY: if (cl_syncinput) { - sethorizon(snum, actions, 1, sync[snum].q16horz); + sethorizon(snum, actions, 1, PlayerHorizon(snum)); } checkhardlanding(p);