- removed some legacy demo stuff from RedNukem backend.

This commit is contained in:
Christoph Oelckers 2019-09-26 00:19:49 +02:00
parent c815e1c246
commit 7fd395b5d7
4 changed files with 13 additions and 58 deletions

View file

@ -148,9 +148,7 @@ void klistfree(CACHE1D_FIND_REC *rec);
CACHE1D_FIND_REC *klistpath(const char *path, const char *mask, int type);
extern int32_t lz4CompressionLevel;
int32_t kdfread(void *buffer, int dasizeof, int count, buildvfs_kfd fil);
int32_t kdfread_LZ4(void *buffer, int dasizeof, int count, buildvfs_kfd fil);
void dfwrite(const void *buffer, int dasizeof, int count, buildvfs_FILE fil);
void dfwrite_LZ4(const void *buffer, int dasizeof, int count, buildvfs_FILE fil);
#endif // cache1d_h_

View file

@ -3899,7 +3899,6 @@ void A_ResetLanePics(void)
ACTOR_STATIC void G_MoveActors(void)
{
extern char g_demo_legacy;
int spriteNum;
if (g_jailDoorCnt)

View file

@ -911,7 +911,6 @@ static int32_t A_GetWaterZOffset(int const spriteNum)
static void VM_Fall(int const spriteNum, spritetype * const pSprite)
{
extern char g_demo_legacy;
int spriteGravity = g_spriteGravity;
int hitSprite = 0;
@ -927,10 +926,7 @@ static void VM_Fall(int const spriteNum, spritetype * const pSprite)
{
A_Spawn(vm.spriteNum, ROCK2);
A_Spawn(vm.spriteNum, ROCK2);
if (ud.recstat == 2 && g_demo_legacy)
A_DeleteSprite(vm.spriteNum);
else
vm.flags |= VM_SAFEDELETE;
vm.flags |= VM_SAFEDELETE;
}
}
else if (sector[vm.pSprite->sectnum].lotag == 802)
@ -939,20 +935,14 @@ static void VM_Fall(int const spriteNum, spritetype * const pSprite)
{
A_DoGuts(vm.spriteNum, JIBS6, 5);
A_PlaySound(SQUISHED, vm.spriteNum);
if (ud.recstat == 2 && g_demo_legacy)
A_DeleteSprite(vm.spriteNum);
else
vm.flags |= VM_SAFEDELETE;
vm.flags |= VM_SAFEDELETE;
}
}
else if (sector[vm.pSprite->sectnum].lotag == 803)
{
if (vm.pSprite->picnum == ROCK2)
{
if (ud.recstat == 2 && g_demo_legacy)
A_DeleteSprite(vm.spriteNum);
else
vm.flags |= VM_SAFEDELETE;
vm.flags |= VM_SAFEDELETE;
}
}
}
@ -960,10 +950,7 @@ static void VM_Fall(int const spriteNum, spritetype * const pSprite)
{
if (vm.pSprite->picnum == AMMO)
{
if (ud.recstat == 2 && g_demo_legacy)
A_DeleteSprite(vm.spriteNum);
else
vm.flags |= VM_SAFEDELETE;
vm.flags |= VM_SAFEDELETE;
return;
}
if (vm.pSprite->picnum != APLAYER && (A_CheckEnemySprite(vm.pSprite) || vm.pSprite->picnum == COW) && g_spriteExtra[vm.spriteNum] < 128)
@ -1586,12 +1573,6 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop)
VM_CONDITIONAL(0);
}
{
// This crashes VM...
extern char g_demo_legacy;
if (ud.recstat == 2 && g_demo_legacy)
insptr++;
}
continue;
case CON_SOUNDTAG:

View file

@ -6133,8 +6133,6 @@ static void P_HandlePal(DukePlayer_t *const pPlayer)
pPlayer->pals.f--;
}
extern char g_demo_legacy;
void P_ProcessInput(int playerNum)
{
if (g_player[playerNum].playerquitflag == 0)
@ -6781,27 +6779,15 @@ void P_ProcessInput(int playerNum)
}
}
if (ud.recstat == 2 && g_demo_legacy)
if (pPlayer->q16horizoff > 0)
{
int horizoff = fix16_to_int(pPlayer->q16horizoff);
if (horizoff > 0)
horizoff -= ((horizoff >> 3) + 1);
else if (horizoff < 0)
horizoff += (((-horizoff) >> 3) + 1);
pPlayer->q16horizoff = F16(horizoff);
pPlayer->q16horizoff -= ((pPlayer->q16horizoff >> 3) + fix16_one);
pPlayer->q16horizoff = max(pPlayer->q16horizoff, 0);
}
else
else if (pPlayer->q16horizoff < 0)
{
if (pPlayer->q16horizoff > 0)
{
pPlayer->q16horizoff -= ((pPlayer->q16horizoff >> 3) + fix16_one);
pPlayer->q16horizoff = max(pPlayer->q16horizoff, 0);
}
else if (pPlayer->q16horizoff < 0)
{
pPlayer->q16horizoff += (((-pPlayer->q16horizoff) >> 3) + fix16_one);
pPlayer->q16horizoff = min(pPlayer->q16horizoff, 0);
}
pPlayer->q16horizoff += (((-pPlayer->q16horizoff) >> 3) + fix16_one);
pPlayer->q16horizoff = min(pPlayer->q16horizoff, 0);
}
if (highZhit >= 0 && (highZhit&49152) == 49152)
@ -7403,11 +7389,7 @@ check_enemy_sprite:
{
fix16_t const inputAng = g_player[playerNum].inputBits->q16avel;
if (ud.recstat == 2 && g_demo_legacy)
pPlayer->q16angvel = (sectorLotag == ST_2_UNDERWATER) ? ((fix16_to_int(inputAng) - (fix16_to_int(inputAng) >> 3))*fix16_from_int(ksgn(velocityModifier)))
: (fix16_to_int(inputAng) * fix16_from_int(ksgn(velocityModifier)));
else
pPlayer->q16angvel = (sectorLotag == ST_2_UNDERWATER) ? fix16_mul(inputAng - (inputAng >> 3), fix16_from_int(ksgn(velocityModifier)))
pPlayer->q16angvel = (sectorLotag == ST_2_UNDERWATER) ? fix16_mul(inputAng - (inputAng >> 3), fix16_from_int(ksgn(velocityModifier)))
: fix16_mul(inputAng, fix16_from_int(ksgn(velocityModifier)));
pPlayer->q16ang += pPlayer->q16angvel;
pPlayer->q16ang &= 0x7FFFFFF;
@ -7983,10 +7965,7 @@ HORIZONLY:;
else if (pPlayer->return_to_center > 0 && !TEST_SYNC_KEY(playerBits, SK_LOOK_UP) && !TEST_SYNC_KEY(playerBits, SK_LOOK_DOWN))
{
pPlayer->return_to_center--;
if (ud.recstat == 2 && g_demo_legacy)
pPlayer->q16horiz += F16(33-fix16_to_int(pPlayer->q16horiz) / 3);
else
pPlayer->q16horiz += F16(33)-fix16_div(pPlayer->q16horiz, F16(3));
pPlayer->q16horiz += F16(33)-fix16_div(pPlayer->q16horiz, F16(3));
centerHoriz++;
}
@ -7996,9 +7975,7 @@ HORIZONLY:;
pPlayer->q16horiz -= fix16_from_int(pPlayer->hard_landing<<4);
}
pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz + ((ud.recstat == 2 && g_demo_legacy && !pPlayer->aim_mode) ? 0 : g_player[playerNum].inputBits->q16horz), F16(HORIZ_MIN), F16(HORIZ_MAX));
if (ud.recstat == 2 && g_demo_legacy) centerHoriz = !pPlayer->aim_mode;
pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz + g_player[playerNum].inputBits->q16horz, F16(HORIZ_MIN), F16(HORIZ_MAX));
if (centerHoriz && (!RR || !pPlayer->recoil))
{