- route the input to the player.

Still very broken.
This commit is contained in:
Christoph Oelckers 2020-10-30 20:53:59 +01:00
parent dc24dcadf5
commit 25a0ce51ba
3 changed files with 8 additions and 10 deletions

View file

@ -174,6 +174,8 @@ void processinput(int num) {
short onsprite = -1;
PLAYER& plr = player[num];
oldposx = plr.x;
oldposy = plr.y;
auto bits = plr.plInput.actions;
@ -228,7 +230,7 @@ void processinput(int num) {
tics += tics >> 1;
}
plr.horiz = clamp(plr.horiz + plr.plInput.horz + 100, -(200 >> 1), 100 + (200 >> 1));
plr.horiz = clamp(plr.horiz + plr.plInput.horz, -(200 >> 1), 100 + (200 >> 1));
if ((bits & SB_AIM_DOWN) != 0) {
if (plr.horiz > 100 - (200 >> 1)) {
@ -415,9 +417,6 @@ void processinput(int num) {
// yvect -= (plr.pInput.svel * tics * BCosAngle(plr.ang));
// }
oldposx = plr.x;
oldposy = plr.y;
if (plr.noclip) {
plr.x += xvect >> 14;
plr.y += yvect >> 14;

View file

@ -303,15 +303,13 @@ bool playrunning()
void GameInterface::Ticker()
{
#if 0
// Make copies so that the originals do not have to be modified.
for (int i = 0; i < MAXPLAYERS; i++)
{
auto oldactions = ps[i].sync.actions;
ps[i].sync = playercmds[i].ucmd;
if (oldactions & SB_CENTERVIEW) ps[i].sync.actions |= SB_CENTERVIEW;
auto oldactions = player[i].plInput.actions;
player[i].plInput = playercmds[i].ucmd;
if (oldactions & SB_CENTERVIEW) player[i].plInput.actions |= SB_CENTERVIEW;
}
#endif
if (!playrunning())
{
@ -325,7 +323,7 @@ void GameInterface::Ticker()
PLAYER &plr = player[pyrn];
viewBackupPlayerLoc(pyrn);
//processinput(pyrn);
processinput(pyrn);
updateviewmap(plr);
updatepaletteshifts();

View file

@ -194,6 +194,7 @@ int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordi
void trowajavlin(int s);
void spawnhornskull(short i);
void spawnapentagram(int sn);
void processinput(int num);
// whplr