mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- removed RRDH code due to licensing conflicts.
# Conflicts: # source/games/duke/src/zz_d_menu.cpp # source/games/duke/src/zz_rrdh.cpp
This commit is contained in:
parent
a39f6062ce
commit
d49c5f7e4c
13 changed files with 5 additions and 5670 deletions
|
@ -44,6 +44,6 @@ set( PCH_SOURCES
|
|||
src/zz_text.cpp
|
||||
src/zz_sector.cpp
|
||||
src/zz_soundsdyn.cpp
|
||||
src/zz_rrdh.cpp)
|
||||
)
|
||||
|
||||
add_game_library2( duke )
|
||||
|
|
|
@ -127,7 +127,6 @@ END_DUKE_NS
|
|||
#include "sector.h"
|
||||
#include "sounds.h"
|
||||
#include "soundsdyn.h"
|
||||
#include "rrdh.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 2016 EDuke32 developers and contributors
|
||||
Copyright (C) 2020 Nuke.YKT
|
||||
|
||||
This file is part of EDuke32.
|
||||
|
||||
EDuke32 is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
int rrdh_random(void);
|
||||
int ghcons_isanimalescapewall(short w);
|
||||
int ghcons_isanimalescapesect(short s);
|
||||
int ghtrophy_isakill(short a1);
|
||||
int sub_535EC(void);
|
||||
void ghdeploy_bias(short a1);
|
||||
int ghcons_findnewspot(short a1);
|
||||
void ghtrax_leavedroppings(short a1);
|
||||
void ghtrax_leavetrax(short a1);
|
||||
int ghtrax_isplrupwind(short a1, short a2);
|
||||
int ghsound_pfiredgunnear(spritetype* a1, short a2);
|
||||
int ghsound_pmadesound(spritetype* a1, short a2);
|
||||
int ghsound_pmadecall(spritetype* a1, short a2);
|
||||
void sub_5A250(int a1);
|
||||
void sub_53304(void);
|
||||
void sub_54DE0(void);
|
||||
void ghtrophy_loadbestscores(void);
|
||||
void sub_5A02C(void);
|
||||
void sub_579A0(void);
|
||||
void ghsound_ambientlooppoll(void);
|
||||
int sub_51B68(void);
|
||||
void sub_5469C(vec2_t const origin, int a1);
|
||||
void ghstatbr_registerkillinfo(short a1, int a2, int a3);
|
||||
char sub_54B80(void);
|
||||
void ghpistol_fire(short snum);
|
||||
void ghbow_fire(short snum);
|
||||
void ghrifle_fire(short snum);
|
||||
void ghshtgn_fire(short snum);
|
||||
void ghsound_footstepsound(short a1, int a2);
|
||||
void ghsound_plrtouchedsprite(short a1, short a2);
|
||||
void ghdeploy_plrtouchedsprite(short a1, short a2);
|
||||
int sub_57A40(int a1);
|
||||
void sub_59C20(void);
|
||||
void sub_52BA8(void);
|
||||
int sub_57A60(int a1);
|
||||
void sub_54A2C(void);
|
||||
void sub_55F8C(void);
|
||||
void sub_566F0(void);
|
||||
void sub_558F4(void);
|
||||
void sub_56AB8(void);
|
||||
void sub_573C0(void);
|
||||
void sub_59314(void);
|
||||
void sub_55184(void);
|
||||
void sub_57B24(void);
|
||||
void sub_58388(void);
|
||||
void sub_59B50(void);
|
||||
void sub_59F80(int a1);
|
||||
void sub_535DC(void);
|
||||
void sub_57AC0(void);
|
||||
void sub_566E8(void);
|
||||
void sub_55F68(void);
|
||||
void sub_558D0(void);
|
||||
void sub_56AB0(void);
|
||||
void sub_56780(void);
|
||||
void sub_56020(void);
|
||||
void sub_55988(void);
|
||||
void sub_56B3C(void);
|
||||
void sub_56724(void);
|
||||
void sub_55FCC(void);
|
||||
void sub_55934(void);
|
||||
void sub_56AE4(void);
|
||||
void ghdeploy_drop(int a1, int a2);
|
||||
int sub_57AA0(int a1);
|
||||
void ghtarget_hit(short a1, int a2);
|
||||
void gharrow_spawnarrow(short snum);
|
||||
void sub_58A30(int a1);
|
||||
int sub_59B44(void);
|
||||
void ghtarget_setanimal(short a1);
|
||||
|
||||
void ghpistol_render(short);
|
||||
void ghrifle_render(short, int);
|
||||
void ghshtgn_render(short);
|
||||
void ghbow_render(short);
|
||||
void sub_56EA8(void);
|
||||
void ghtarget_move(void);
|
||||
void gharrow_move(void);
|
||||
void ghdeploy_move(void);
|
||||
void sub_5524C(void);
|
||||
void sub_519E8(int a1);
|
||||
void sub_57B38(long cposx, long cposy, long czoom, short cang);
|
||||
|
||||
|
||||
END_DUKE_NS
|
|
@ -261,16 +261,6 @@ void G_MoveWorld_r(void)
|
|||
|
||||
g_moveActorsTime = (1 - 0.033) * g_moveActorsTime + 0.033 * (timerGetHiTicks() - actorsTime);
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
sub_56EA8();
|
||||
ghtarget_move();
|
||||
gharrow_move();
|
||||
ghdeploy_move();
|
||||
sub_519E8(ud.level_number);
|
||||
sub_5524C();
|
||||
}
|
||||
|
||||
// XXX: Has to be before effectors, in particular movers?
|
||||
// TODO: lights in moving sectors ought to be interpolated
|
||||
// G_DoEffectorLights();
|
||||
|
|
|
@ -287,9 +287,6 @@ void G_DoCheats(void)
|
|||
int consoleCheat = 0;
|
||||
int cheatNum;
|
||||
|
||||
if (DEER)
|
||||
return;
|
||||
|
||||
if (osdcmd_cheatsinfo_stat.cheatnum != -1)
|
||||
{
|
||||
cheatNum = osdcmd_cheatsinfo_stat.cheatnum;
|
||||
|
|
|
@ -228,94 +228,6 @@ void Menu_DHLeaonardHeadReset(void)
|
|||
word_A99B0 = 0;
|
||||
}
|
||||
|
||||
void Menu_DHLeaonardHeadDisplay(vec2_t pos)
|
||||
{
|
||||
if (sub_51B68() && !dword_A99C0)
|
||||
{
|
||||
dword_A99C0 = (int)totalclock;
|
||||
}
|
||||
if (dword_A99C0 && (int)totalclock - dword_A99C0 > 40)
|
||||
{
|
||||
dword_A99C0 = 0;
|
||||
dword_A99C4 = 1;
|
||||
}
|
||||
switch (dword_A99A0)
|
||||
{
|
||||
case 0:
|
||||
if ((int)totalclock - dword_A99B8 >= 240 && dword_A99C4 && (rrdh_random() & 63) < 32)
|
||||
{
|
||||
dword_A99A0 = 1;
|
||||
dword_A99A4 = 160 - ((rrdh_random() & 255) - 128);
|
||||
word_A99B0 = ((rrdh_random() & 127) + 1984) & 2047;
|
||||
dword_A99AC = (rrdh_random() & 4095) - 4090;
|
||||
word_A99B2 = TILE_SPINNINGNUKEICON + (rrdh_random() & 15);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (dword_A99A8 < 54)
|
||||
{
|
||||
if ((int)totalclock - dword_A99B4 > 2)
|
||||
{
|
||||
dword_A99B4 = (int)totalclock;
|
||||
dword_A99A8 += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dword_A99A0 = 2;
|
||||
dword_A99BC = (int)totalclock;
|
||||
}
|
||||
pos.x += dword_A99A4 << 16;
|
||||
pos.y += (240 - dword_A99A8) << 16;
|
||||
rotatesprite(pos.x, pos.y, 32768 - dword_A99AC, word_A99B0, word_A99B2, 0, 0, 10, 0, 0, xdim - 1, ydim - 1);
|
||||
break;
|
||||
case 2:
|
||||
if (dword_A99C4 == 1)
|
||||
{
|
||||
if ((rrdh_random() & 63) > 32)
|
||||
word_A99B2--;
|
||||
else
|
||||
word_A99B2++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((rrdh_random() & 127) == 48)
|
||||
{
|
||||
if ((int)totalclock - dword_A99BC > 240)
|
||||
dword_A99A0 = 3;
|
||||
}
|
||||
}
|
||||
if (word_A99B2 < TILE_SPINNINGNUKEICON)
|
||||
word_A99B2 = TILE_SPINNINGNUKEICON + 15;
|
||||
if (word_A99B2 > TILE_SPINNINGNUKEICON + 15)
|
||||
word_A99B2 = TILE_SPINNINGNUKEICON;
|
||||
pos.x += dword_A99A4 << 16;
|
||||
pos.y += (240 - dword_A99A8) << 16;
|
||||
rotatesprite(pos.x, pos.y, 32768 - dword_A99AC, word_A99B0, word_A99B2, 0, 0, 10, 0, 0, xdim - 1, ydim - 1);
|
||||
if ((int)totalclock - dword_A99BC > 960)
|
||||
dword_A99A0 = 3;
|
||||
break;
|
||||
case 3:
|
||||
if (dword_A99A8 > 0)
|
||||
{
|
||||
if ((int)totalclock - dword_A99B4 > 2)
|
||||
{
|
||||
dword_A99B4 = (int)totalclock;
|
||||
dword_A99A8 -= 2;
|
||||
}
|
||||
pos.x += dword_A99A4 << 16;
|
||||
pos.y += (240 - dword_A99A8) << 16;
|
||||
rotatesprite(pos.x, pos.y, 32768 - dword_A99AC, word_A99B0, word_A99B2, 0, 0, 10, 0, 0, xdim - 1, ydim - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dword_A99B8 = (int)totalclock;
|
||||
dword_A99A0 = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
dword_A99C4 = 0;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -380,13 +292,7 @@ class DukeMainMenu : public DukeListMenu
|
|||
void PreDraw() override
|
||||
{
|
||||
DukeListMenu::PreDraw();
|
||||
if (DEER)
|
||||
{
|
||||
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
|
||||
Menu_DHLeaonardHeadDisplay(forigin);
|
||||
rotatesprite_fs(forigin.x + (MENU_MARGIN_CENTER << 16), forigin.y + ((32) << 16), 20480L, 0, TILE_DUKENUKEM, 0, 0, 10);
|
||||
}
|
||||
else if (RRRA)
|
||||
if (RRRA)
|
||||
{
|
||||
rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER - 5) << 16), int(origin.Y * 65536) + ((57) << 16), 16592L, 0, TILE_THREEDEE, 0, 0, 10);
|
||||
}
|
||||
|
@ -508,31 +414,6 @@ class DukeWeaponMenu : public DukeListMenu
|
|||
}
|
||||
};
|
||||
|
||||
class DukeTrophiesMenu : public DukeListMenu
|
||||
{
|
||||
void PreDraw() override
|
||||
{
|
||||
DukeListMenu::PreDraw();
|
||||
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
|
||||
if (g_player[myconnectindex].ps->gm & MODE_GAME)
|
||||
{
|
||||
if (ud.level_number < 4)
|
||||
{
|
||||
rotatesprite_fs(forigin.x + (160 << 16), forigin.y + (100 << 16), 65536, 0, 1730, 0, 0, 10);
|
||||
sub_5469C(forigin, 0);
|
||||
}
|
||||
else
|
||||
sub_5469C(forigin, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
rotatesprite_fs(forigin.x + (160 << 16), forigin.y + (100 << 16), 65536, 0, 1730, 0, 0, 10);
|
||||
sub_5469C(forigin, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// Menu related game interface functions
|
||||
|
@ -780,7 +661,7 @@ static TMenuClassDescriptor<Duke3d::DukeListMenu> _lm("Duke.ListMenu");
|
|||
static TMenuClassDescriptor<Duke3d::DukeHuntMenu> _dhm("Duke.HuntMenu");
|
||||
static TMenuClassDescriptor<Duke3d::DukeTargetMenu> _dtm("Duke.TargetMenu");
|
||||
static TMenuClassDescriptor<Duke3d::DukeWeaponMenu> _dwm("Duke.WeaponMenu");
|
||||
static TMenuClassDescriptor<Duke3d::DukeTrophiesMenu> _dttm("Duke.TrophiesMenu");
|
||||
|
||||
static TMenuClassDescriptor<DImageScrollerMenu> _ism("Duke.ImageScrollerMenu"); // does not implement a new class, we only need the descriptor.
|
||||
|
||||
void RegisterDuke3dMenus()
|
||||
|
@ -791,5 +672,4 @@ void RegisterDuke3dMenus()
|
|||
menuClasses.Push(&_dhm);
|
||||
menuClasses.Push(&_dtm);
|
||||
menuClasses.Push(&_dwm);
|
||||
menuClasses.Push(&_dttm);
|
||||
}
|
||||
|
|
|
@ -83,9 +83,6 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
|
|||
char demofn[14];
|
||||
const char *demofnptr;
|
||||
|
||||
if (DEER)
|
||||
return 0;
|
||||
|
||||
if (g_whichDemo == 1 && g_firstDemoFile[0])
|
||||
{
|
||||
demofnptr = g_firstDemoFile;
|
||||
|
|
|
@ -1517,19 +1517,6 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
|
|||
case DOGRUN__STATICRR:
|
||||
case VIXEN__STATICRR:
|
||||
case CHEER__STATICRR:
|
||||
if (DEER)
|
||||
{
|
||||
if ((t->cstat & 32768) == 0 && (t->cstat & 257) != 0)
|
||||
{
|
||||
if (klabs(ourx - t->x) + klabs(oury - t->y) < 46080)
|
||||
{
|
||||
if (klabs(oura - (getangle(t->x - ourx, t->y - oury) & 2047)) < 128)
|
||||
sub_5A250(32);
|
||||
else
|
||||
sub_5A250(64);
|
||||
}
|
||||
}
|
||||
}
|
||||
goto default_case1;
|
||||
case PUKE__STATIC:
|
||||
if (RR) goto default_case1;
|
||||
|
@ -2446,12 +2433,7 @@ skip:
|
|||
}
|
||||
}
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
if (pSprite->picnum == 806)
|
||||
t->picnum = 1023;
|
||||
}
|
||||
else switch (DYNAMICTILEMAP(pSprite->picnum))
|
||||
switch (DYNAMICTILEMAP(pSprite->picnum))
|
||||
{
|
||||
case LASERLINE__STATIC:
|
||||
if (RR) break;
|
||||
|
@ -2781,12 +2763,6 @@ void G_HandleLocalKeys(void)
|
|||
{
|
||||
// CONTROL_ProcessBinds();
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
sub_53304();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ud.recstat == 2)
|
||||
{
|
||||
ControlInfo noshareinfo;
|
||||
|
@ -3659,9 +3635,6 @@ static void G_Startup(void)
|
|||
G_LoadLookups();
|
||||
TileFiles.PostLoadSetup();
|
||||
|
||||
if (DEER)
|
||||
sub_54DE0();
|
||||
|
||||
screenpeek = myconnectindex;
|
||||
}
|
||||
|
||||
|
@ -4042,9 +4015,6 @@ void app_loop()
|
|||
{
|
||||
auto &myplayer = g_player[myconnectindex].ps;
|
||||
|
||||
if (DEER)
|
||||
ghtrophy_loadbestscores();
|
||||
|
||||
MAIN_LOOP_RESTART:
|
||||
totalclock = 0;
|
||||
ototalclock = 0;
|
||||
|
@ -4223,8 +4193,6 @@ MAIN_LOOP_RESTART:
|
|||
g_gameUpdateAndDrawTime = g_beforeSwapTime/* timerGetHiTicks()*/ - gameUpdateStartTime;
|
||||
}
|
||||
|
||||
if (DEER)
|
||||
sub_5A02C();
|
||||
}
|
||||
|
||||
if (g_player[myconnectindex].ps->gm&MODE_DEMO)
|
||||
|
@ -4259,8 +4227,6 @@ GAME_STATIC GAME_INLINE int32_t G_MoveLoop()
|
|||
|
||||
int G_DoMoveThings(void)
|
||||
{
|
||||
if (DEER)
|
||||
sub_579A0();
|
||||
ud.camerasprite = -1;
|
||||
lockclock += TICSPERFRAME;
|
||||
|
||||
|
@ -4393,13 +4359,11 @@ int G_DoMoveThings(void)
|
|||
if (sprite[g_player[i].ps->i].pal != 1)
|
||||
sprite[g_player[i].ps->i].pal = g_player[i].pcolor;
|
||||
|
||||
if (!DEER)
|
||||
hud_input(i);
|
||||
hud_input(i);
|
||||
|
||||
if (ud.pause_on == 0)
|
||||
{
|
||||
P_ProcessInput(i);
|
||||
if (!DEER)
|
||||
fi.checksectors(i);
|
||||
}
|
||||
}
|
||||
|
@ -4414,11 +4378,6 @@ int G_DoMoveThings(void)
|
|||
|
||||
if ((everyothertime&1) == 0)
|
||||
{
|
||||
if (DEER)
|
||||
{
|
||||
ghsound_ambientlooppoll();
|
||||
}
|
||||
else
|
||||
{
|
||||
fi.animatewalls();
|
||||
movecyclers();
|
||||
|
|
|
@ -1780,8 +1780,6 @@ void Net_GetInput(void)
|
|||
P_GetInputMotorcycle(myconnectindex);
|
||||
else if (RRRA && g_player[myconnectindex].ps->OnBoat)
|
||||
P_GetInputBoat(myconnectindex);
|
||||
else if (DEER)
|
||||
P_DHGetInput(myconnectindex);
|
||||
else
|
||||
P_GetInput(myconnectindex);
|
||||
|
||||
|
|
|
@ -131,27 +131,6 @@ static void P_IncurDamage(DukePlayer_t * const pPlayer)
|
|||
}
|
||||
|
||||
|
||||
void A_DHShoot(int const playerNum)
|
||||
{
|
||||
switch (g_player[playerNum].ps->dhat61f)
|
||||
{
|
||||
case 0:
|
||||
ghpistol_fire(playerNum);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
ghrifle_fire(playerNum);
|
||||
break;
|
||||
case 3:
|
||||
ghshtgn_fire(playerNum);
|
||||
break;
|
||||
case 4:
|
||||
ghbow_fire(playerNum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////// HUD WEAPON / MISC. DISPLAY CODE ////////////////////
|
||||
|
||||
static void P_DisplaySpit(void)
|
||||
|
@ -624,28 +603,6 @@ void P_DisplayWeapon(void)
|
|||
g_snum = screenpeek;
|
||||
#endif
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
switch (pPlayer->dhat61f)
|
||||
{
|
||||
case 0:
|
||||
ghpistol_render(screenpeek);
|
||||
break;
|
||||
case 1:
|
||||
ghrifle_render(screenpeek, 0);
|
||||
break;
|
||||
case 2:
|
||||
ghrifle_render(screenpeek, 1);
|
||||
break;
|
||||
case 3:
|
||||
ghshtgn_render(screenpeek);
|
||||
break;
|
||||
case 4:
|
||||
ghbow_render(screenpeek);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (pPlayer->newowner >= 0 || ud.camerasprite >= 0 || (!RR && pPlayer->over_shoulder_on > 0)
|
||||
|| (sprite[pPlayer->i].pal != 1 && sprite[pPlayer->i].extra <= 0))
|
||||
|
@ -2731,217 +2688,6 @@ int sub_299D8(void)
|
|||
return dword_A99DC;
|
||||
}
|
||||
|
||||
void P_DHGetInput(int const playerNum)
|
||||
{
|
||||
auto &thisPlayer = g_player[playerNum];
|
||||
auto const pPlayer = thisPlayer.ps;
|
||||
ControlInfo info;
|
||||
|
||||
if ((pPlayer->gm & (MODE_MENU|MODE_TYPE)) || (ud.pause_on && !inputState.GetKeyStatus(sc_Pause)))
|
||||
{
|
||||
if (!(pPlayer->gm&MODE_MENU))
|
||||
CONTROL_GetInput(&info);
|
||||
|
||||
localInput = {};
|
||||
localInput.bits = (((int32_t)g_gameQuit) << SK_GAMEQUIT);
|
||||
localInput.extbits |= (1 << 7);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
D_ProcessEvents();
|
||||
|
||||
bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming);
|
||||
|
||||
CONTROL_GetInput(&info);
|
||||
|
||||
// JBF: Run key behaviour is selectable
|
||||
int const playerRunning = G_CheckAutorun(buttonMap.ButtonDown(gamefunc_Run));
|
||||
int const playerCrouch = sub_299D8();
|
||||
int const playerJump = buttonMap.ButtonDown(gamefunc_Jump) && !(pPlayer->cursectnum >= 0 && sector[pPlayer->cursectnum].hitag == 2003);
|
||||
int const turnAmount = playerCrouch ? 2 : (playerRunning ? 16 : 8);
|
||||
constexpr int analogTurnAmount = 16;
|
||||
int const keyMove = playerCrouch ? 3 : (playerRunning ? 24 : 12);
|
||||
constexpr int analogExtent = 32767; // KEEPINSYNC sdlayer.cpp
|
||||
|
||||
input_t input {};
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
||||
{
|
||||
static int strafeyaw;
|
||||
|
||||
input.svel = -(info.mousex + strafeyaw) >> 3;
|
||||
strafeyaw = (info.mousex + strafeyaw) % 8;
|
||||
|
||||
input.svel -= info.dyaw * keyMove / analogExtent;
|
||||
}
|
||||
else
|
||||
{
|
||||
input.q16avel = fix16_sadd(input.q16avel, fix16_sdiv(fix16_from_int(info.mousex), F16(32)));
|
||||
input.q16avel = fix16_sadd(input.q16avel, fix16_from_int(info.dyaw / analogExtent * (analogTurnAmount << 1)));
|
||||
}
|
||||
|
||||
if (mouseaim)
|
||||
input.q16horz = fix16_sadd(input.q16horz, fix16_sdiv(fix16_from_int(info.mousey), F16(64)));
|
||||
else
|
||||
input.fvel = -(info.mousey >> 3);
|
||||
|
||||
if (!in_mouseflip) input.q16horz = -input.q16horz;
|
||||
|
||||
input.q16horz = fix16_ssub(input.q16horz, fix16_from_int(info.dpitch * analogTurnAmount / analogExtent));
|
||||
input.svel -= info.dx * keyMove / analogExtent;
|
||||
input.fvel -= info.dz * keyMove / analogExtent;
|
||||
|
||||
static double lastInputTicks;
|
||||
auto const currentHiTicks = timerGetHiTicks();
|
||||
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
|
||||
|
||||
lastInputTicks = currentHiTicks;
|
||||
|
||||
auto scaleAdjustmentToInterval = [=](double x) { return x * REALGAMETICSPERSEC / (1000.0 / elapsedInputTicks); };
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe))
|
||||
{
|
||||
if (!localInput.svel)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left) && !(pPlayer->movement_lock & 4) && !localInput.svel)
|
||||
input.svel = keyMove;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Right) && !(pPlayer->movement_lock & 8) && !localInput.svel)
|
||||
input.svel = -keyMove;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static int32_t turnHeldTime;
|
||||
static int32_t lastInputClock; // MED
|
||||
int32_t const elapsedTics = (int32_t)totalclock - lastInputClock;
|
||||
|
||||
lastInputClock = (int32_t) totalclock;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left))
|
||||
{
|
||||
turnHeldTime += elapsedTics;
|
||||
input.q16avel = fix16_ssub(input.q16avel, fix16_from_dbl(scaleAdjustmentToInterval((turnHeldTime >= TURBOTURNTIME) ? (turnAmount << 1) : (PREAMBLETURN << 1))));
|
||||
}
|
||||
else if (buttonMap.ButtonDown(gamefunc_Turn_Right))
|
||||
{
|
||||
turnHeldTime += elapsedTics;
|
||||
input.q16avel = fix16_sadd(input.q16avel, fix16_from_dbl(scaleAdjustmentToInterval((turnHeldTime >= TURBOTURNTIME) ? (turnAmount << 1) : (PREAMBLETURN << 1))));
|
||||
}
|
||||
else
|
||||
turnHeldTime = 0;
|
||||
}
|
||||
|
||||
if (localInput.svel < keyMove && localInput.svel > -keyMove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Left) && !(pPlayer->movement_lock & 4))
|
||||
input.svel += keyMove;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Right) && !(pPlayer->movement_lock & 8))
|
||||
input.svel += -keyMove;
|
||||
}
|
||||
|
||||
if (localInput.fvel < keyMove && localInput.fvel > -keyMove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Forward) && !(pPlayer->movement_lock & 1))
|
||||
input.fvel += keyMove;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Backward) && !(pPlayer->movement_lock & 2))
|
||||
input.fvel += -keyMove;
|
||||
}
|
||||
|
||||
if (playerRunning && sub_535EC())
|
||||
input.fvel <<= 3;
|
||||
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Fire) << SK_FIRE);
|
||||
|
||||
localInput.bits |= (playerJump << SK_JUMP) | (playerCrouch << SK_CROUCH);
|
||||
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Aim_Up) || (buttonMap.ButtonDown(gamefunc_Dpad_Aiming) && input.fvel > 0)) << SK_AIM_UP;
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Aim_Down) || (buttonMap.ButtonDown(gamefunc_Dpad_Aiming) && input.fvel < 0)) << SK_AIM_DOWN;
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Center_View) << SK_CENTER_VIEW);
|
||||
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Look_Left) << SK_LOOK_LEFT) | (buttonMap.ButtonDown(gamefunc_Look_Right) << SK_LOOK_RIGHT);
|
||||
localInput.bits |= (buttonMap.ButtonDown(gamefunc_Look_Up) << SK_LOOK_UP) | (buttonMap.ButtonDown(gamefunc_Look_Down) << SK_LOOK_DOWN);
|
||||
|
||||
localInput.bits |= (playerRunning << SK_RUN);
|
||||
|
||||
localInput.bits |= buttonMap.ButtonDown(gamefunc_TurnAround) << SK_TURNAROUND;
|
||||
|
||||
localInput.bits |= (mouseaim << SK_AIMMODE);
|
||||
localInput.bits |= (g_gameQuit << SK_GAMEQUIT);
|
||||
localInput.bits |= inputState.GetKeyStatus(sc_Pause) << SK_PAUSE;
|
||||
localInput.bits |= ((uint32_t)inputState.GetKeyStatus(sc_Escape)) << SK_ESCAPE;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Dpad_Aiming))
|
||||
input.fvel = 0;
|
||||
|
||||
localInput.extbits |= (buttonMap.ButtonDown(gamefunc_Move_Forward) || (input.fvel > 0));
|
||||
localInput.extbits |= (buttonMap.ButtonDown(gamefunc_Move_Backward) || (input.fvel < 0)) << 1;
|
||||
localInput.extbits |= (buttonMap.ButtonDown(gamefunc_Strafe_Left) || (input.svel > 0)) << 2;
|
||||
localInput.extbits |= (buttonMap.ButtonDown(gamefunc_Strafe_Right) || (input.svel < 0)) << 3;
|
||||
localInput.extbits |= buttonMap.ButtonDown(gamefunc_Turn_Left)<<4;
|
||||
localInput.extbits |= buttonMap.ButtonDown(gamefunc_Turn_Right)<<5;
|
||||
|
||||
if (pPlayer->cursectnum >= 0 && sector[pPlayer->cursectnum].hitag == 2003)
|
||||
input.fvel >>= 1;
|
||||
|
||||
// A horiz diff of 128 equal 45 degrees, so we convert horiz to 1024 angle units
|
||||
|
||||
if (thisPlayer.horizAngleAdjust)
|
||||
{
|
||||
float const horizAngle
|
||||
= atan2f(pPlayer->q16horiz - F16(100), F16(128)) * (512.f / fPI) + scaleAdjustmentToInterval(thisPlayer.horizAngleAdjust);
|
||||
pPlayer->q16horiz = F16(100) + Blrintf(F16(128) * tanf(horizAngle * (fPI / 512.f)));
|
||||
}
|
||||
else if (pPlayer->return_to_center > 0 || thisPlayer.horizRecenter)
|
||||
{
|
||||
pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl(fix16_from_dbl(200 / 3) - fix16_sdiv(pPlayer->q16horiz, F16(1.5))))));
|
||||
|
||||
if ((!pPlayer->return_to_center && thisPlayer.horizRecenter) || (pPlayer->q16horiz >= F16(99.9) && pPlayer->q16horiz <= F16(100.1)))
|
||||
{
|
||||
pPlayer->q16horiz = F16(100);
|
||||
thisPlayer.horizRecenter = false;
|
||||
}
|
||||
|
||||
if (pPlayer->q16horizoff >= F16(-0.1) && pPlayer->q16horizoff <= F16(0.1))
|
||||
pPlayer->q16horizoff = 0;
|
||||
}
|
||||
|
||||
if (pPlayer->q16horizoff > 0)
|
||||
{
|
||||
pPlayer->q16horizoff = fix16_ssub(pPlayer->q16horizoff, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl((pPlayer->q16horizoff >> 3) + fix16_one))));
|
||||
pPlayer->q16horizoff = fix16_max(pPlayer->q16horizoff, 0);
|
||||
}
|
||||
else if (pPlayer->q16horizoff < 0)
|
||||
{
|
||||
pPlayer->q16horizoff = fix16_sadd(pPlayer->q16horizoff, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl((-pPlayer->q16horizoff >> 3) + fix16_one))));
|
||||
pPlayer->q16horizoff = fix16_min(pPlayer->q16horizoff, 0);
|
||||
}
|
||||
|
||||
if (thisPlayer.horizSkew)
|
||||
pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl(thisPlayer.horizSkew))));
|
||||
|
||||
pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz, F16(HORIZ_MIN), F16(HORIZ_MAX));
|
||||
|
||||
if (input.fvel || input.svel || input.q16avel || TEST_SYNC_KEY(input.bits, SK_FIRE) || dword_A99E0 != pPlayer->pos.z)
|
||||
pPlayer->dhat60f = 1;
|
||||
dword_A99E0 = pPlayer->pos.z;
|
||||
pPlayer->dhat617 = playerRunning;
|
||||
if (!input.fvel)
|
||||
pPlayer->dhat617 = 0;
|
||||
pPlayer->dhat613 = buttonMap.ButtonDown(gamefunc_Move_Forward) | buttonMap.ButtonDown(gamefunc_Move_Backward);
|
||||
if (pPlayer->dhat60f)
|
||||
sub_5A250(256);
|
||||
//dword_A99D4++;
|
||||
//if (dword_A99D4 == 2)
|
||||
//{
|
||||
// sub_53304();
|
||||
// dword_A99D4 = 0;
|
||||
//}
|
||||
}
|
||||
|
||||
void madenoise(int playerNum)
|
||||
{
|
||||
DukePlayer_t *const pPlayer = g_player[playerNum].ps;
|
||||
|
@ -5501,11 +5247,6 @@ void P_ProcessInput(int playerNum)
|
|||
thisPlayer.horizAngleAdjust = 0;
|
||||
thisPlayer.horizSkew = 0;
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
P_DHProcessInput(playerNum);
|
||||
return;
|
||||
}
|
||||
if (thisPlayer.playerquitflag == 0)
|
||||
return;
|
||||
|
||||
|
@ -7425,538 +7166,6 @@ HORIZONLY:;
|
|||
P_ProcessWeapon(playerNum);
|
||||
}
|
||||
|
||||
void P_DHProcessInput(int playerNum)
|
||||
{
|
||||
auto &thisPlayer = g_player[playerNum];
|
||||
|
||||
thisPlayer.horizAngleAdjust = 0;
|
||||
thisPlayer.horizSkew = 0;
|
||||
|
||||
if (thisPlayer.playerquitflag == 0)
|
||||
return;
|
||||
|
||||
auto const pPlayer = thisPlayer.ps;
|
||||
auto const pSprite = &sprite[pPlayer->i];
|
||||
|
||||
++pPlayer->player_par;
|
||||
|
||||
uint32_t playerBits = thisPlayer.input->bits;
|
||||
|
||||
pSprite->cstat = 0;
|
||||
|
||||
if (pPlayer->cheat_phase > 0)
|
||||
playerBits = 0;
|
||||
|
||||
if (pPlayer->cursectnum == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int sectorLotag = sector[pPlayer->cursectnum].lotag;
|
||||
|
||||
pSprite->clipdist = 64;
|
||||
|
||||
pPlayer->spritebridge = 0;
|
||||
//pPlayer->sbs = 0;
|
||||
|
||||
int32_t floorZ, ceilZ, highZhit, lowZhit;
|
||||
getzrange((vec3_t *)pPlayer, pPlayer->cursectnum, &ceilZ, &highZhit, &floorZ, &lowZhit, 163, CLIPMASK0);
|
||||
|
||||
#ifdef YAX_ENABLE
|
||||
getzsofslope_player(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz);
|
||||
#else
|
||||
getzsofslope(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz);
|
||||
#endif
|
||||
int const trueFloorZ = pPlayer->truefz;
|
||||
int const trueFloorDist = klabs(pPlayer->pos.z - trueFloorZ);
|
||||
|
||||
if ((lowZhit & 49152) == 16384 && sectorLotag == 1 && trueFloorDist > PHEIGHT + ZOFFSET2)
|
||||
sectorLotag = 0;
|
||||
|
||||
actor[pPlayer->i].floorz = floorZ;
|
||||
actor[pPlayer->i].ceilingz = ceilZ;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (highZhit >= 0 && (highZhit&49152) == 49152)
|
||||
{
|
||||
highZhit &= (MAXSPRITES-1);
|
||||
|
||||
if (sprite[highZhit].statnum == STAT_ACTOR && sprite[highZhit].extra >= 0)
|
||||
{
|
||||
highZhit = 0;
|
||||
ceilZ = pPlayer->truecz;
|
||||
}
|
||||
}
|
||||
|
||||
if (lowZhit >= 0 && (lowZhit&49152) == 49152)
|
||||
{
|
||||
int spriteNum = lowZhit&(MAXSPRITES-1);
|
||||
|
||||
if ((sprite[spriteNum].cstat&33) == 33)
|
||||
{
|
||||
sectorLotag = 0;
|
||||
pPlayer->footprintcount = 0;
|
||||
pPlayer->spritebridge = 1;
|
||||
//pPlayer->sbs = spriteNum;
|
||||
}
|
||||
if (A_CheckEnemySprite(&sprite[spriteNum]) && sprite[spriteNum].xrepeat > 24
|
||||
&& klabs(pSprite->z - sprite[spriteNum].z) < (84 << 8))
|
||||
{
|
||||
// TX: I think this is what makes the player slide off enemies... might
|
||||
// be a good sprite flag to add later.
|
||||
// Helix: there's also SLIDE_ABOVE_ENEMY.
|
||||
int spriteAng = getangle(sprite[spriteNum].x - pPlayer->pos.x,
|
||||
sprite[spriteNum].y - pPlayer->pos.y);
|
||||
pPlayer->vel.x -= sintable[(spriteAng + 512) & 2047] << 4;
|
||||
pPlayer->vel.y -= sintable[spriteAng & 2047] << 4;
|
||||
}
|
||||
}
|
||||
|
||||
pSprite->extra = 32;
|
||||
pPlayer->inv_amount[GET_SHIELD] = 0;
|
||||
|
||||
pPlayer->last_extra = pSprite->extra;
|
||||
pPlayer->loogcnt = (pPlayer->loogcnt > 0) ? pPlayer->loogcnt - 1 : 0;
|
||||
|
||||
if (pPlayer->timebeforeexit > 1 && pPlayer->last_extra > 0)
|
||||
{
|
||||
if (--pPlayer->timebeforeexit == GAMETICSPERSEC*5)
|
||||
{
|
||||
FX_StopAllSounds();
|
||||
S_ClearSoundLocks();
|
||||
|
||||
if (pPlayer->customexitsound >= 0)
|
||||
{
|
||||
S_PlaySound(pPlayer->customexitsound);
|
||||
P_DoQuote(QUOTE_WEREGONNAFRYYOURASS,pPlayer);
|
||||
}
|
||||
}
|
||||
else if (pPlayer->timebeforeexit == 1)
|
||||
{
|
||||
for (bssize_t TRAVERSE_CONNECT(playerNum))
|
||||
g_player[playerNum].ps->gm = MODE_EOL;
|
||||
|
||||
ud.level_number = (++ud.level_number < MAXLEVELS) ? ud.level_number : 0;
|
||||
ud.m_level_number = ud.level_number;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pPlayer->pals.f > 0)
|
||||
P_HandlePal(pPlayer);
|
||||
|
||||
if (pPlayer->fta > 0 && --pPlayer->fta == 0)
|
||||
{
|
||||
pub = pus = NUMPAGES;
|
||||
pPlayer->ftq = 0;
|
||||
}
|
||||
|
||||
if (g_levelTextTime > 0)
|
||||
g_levelTextTime--;
|
||||
|
||||
if (pPlayer->newowner >= 0)
|
||||
{
|
||||
P_UpdatePosWhenViewingCam(pPlayer);
|
||||
P_DoCounters(playerNum);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
pPlayer->rotscrnang -= (pPlayer->rotscrnang >> 1);
|
||||
|
||||
if (pPlayer->rotscrnang && !(pPlayer->rotscrnang >> 1))
|
||||
pPlayer->rotscrnang -= ksgn(pPlayer->rotscrnang);
|
||||
|
||||
pPlayer->look_ang -= (pPlayer->look_ang >> 2);
|
||||
|
||||
if (pPlayer->look_ang && !(pPlayer->look_ang >> 2))
|
||||
pPlayer->look_ang -= ksgn(pPlayer->look_ang);
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_LOOK_LEFT) && !pPlayer->OnMotorcycle)
|
||||
{
|
||||
// look_left
|
||||
pPlayer->look_ang -= 152;
|
||||
pPlayer->rotscrnang += 24;
|
||||
}
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_LOOK_RIGHT) && !pPlayer->OnMotorcycle)
|
||||
{
|
||||
// look_right
|
||||
pPlayer->look_ang += 152;
|
||||
pPlayer->rotscrnang -= 24;
|
||||
}
|
||||
|
||||
int velocityModifier = TICSPERFRAME;
|
||||
const uint8_t *const weaponFrame = &pPlayer->kickback_pic;
|
||||
int floorZOffset = 40;
|
||||
int const playerShrunk = (pSprite->yrepeat < 8);
|
||||
|
||||
pPlayer->weapon_sway = (pSprite->xvel < 32 || pPlayer->on_ground == 0 || pPlayer->bobcounter == 1024)
|
||||
? (((pPlayer->weapon_sway & 2047) > (1024 + 96))
|
||||
? (pPlayer->weapon_sway - 96)
|
||||
: (((pPlayer->weapon_sway & 2047) < (1024 - 96)))
|
||||
? (pPlayer->weapon_sway + 96)
|
||||
: 1024)
|
||||
: pPlayer->bobcounter;
|
||||
|
||||
// NOTE: This silently wraps if the difference is too great, e.g. used to do
|
||||
// that when teleported by silent SE7s.
|
||||
pSprite->xvel = ksqrt(uhypsq(pPlayer->pos.x - pPlayer->bobpos.x, pPlayer->pos.y - pPlayer->bobpos.y));
|
||||
|
||||
if (pPlayer->on_ground)
|
||||
pPlayer->bobcounter += sprite[pPlayer->i].xvel>>1;
|
||||
|
||||
if (ud.clipping == 0 && ((uint16_t)pPlayer->cursectnum >= MAXSECTORS || sector[pPlayer->cursectnum].floorpicnum == TILE_MIRROR))
|
||||
{
|
||||
pPlayer->pos.x = pPlayer->opos.x;
|
||||
pPlayer->pos.y = pPlayer->opos.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->opos.x = pPlayer->pos.x;
|
||||
pPlayer->opos.y = pPlayer->pos.y;
|
||||
}
|
||||
|
||||
pPlayer->bobpos.x = pPlayer->pos.x;
|
||||
pPlayer->bobpos.y = pPlayer->pos.y;
|
||||
pPlayer->opos.z = pPlayer->pos.z;
|
||||
pPlayer->opyoff = pPlayer->pyoff;
|
||||
|
||||
if (pPlayer->one_eighty_count < 0)
|
||||
{
|
||||
pPlayer->one_eighty_count += 128;
|
||||
pPlayer->q16ang += F16(128);
|
||||
}
|
||||
|
||||
// Shrinking code
|
||||
|
||||
if (sectorLotag == ST_2_UNDERWATER)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->scuba_on = 0;
|
||||
|
||||
if (pPlayer->pos.z < (floorZ-(floorZOffset<<8))) //falling
|
||||
{
|
||||
// not jumping or crouching
|
||||
|
||||
if ((!TEST_SYNC_KEY(playerBits, SK_JUMP) && !TEST_SYNC_KEY(playerBits, SK_CROUCH)) && pPlayer->on_ground &&
|
||||
(sector[pPlayer->cursectnum].floorstat & 2) && pPlayer->pos.z >= (floorZ - (floorZOffset << 8) - ZOFFSET2))
|
||||
pPlayer->pos.z = floorZ - (floorZOffset << 8);
|
||||
else
|
||||
{
|
||||
pPlayer->on_ground = 0;
|
||||
pPlayer->vel.z += (g_spriteGravity + 80); // (TICSPERFRAME<<6);
|
||||
|
||||
if (pPlayer->vel.z >= (4096 + 2048))
|
||||
pPlayer->vel.z = (4096 + 2048);
|
||||
|
||||
if (pPlayer->vel.z > 2400 && pPlayer->falling_counter < 255)
|
||||
{
|
||||
pPlayer->falling_counter++;
|
||||
if (pPlayer->falling_counter >= 38 && !A_CheckSoundPlaying(pPlayer->i, -1, CHAN_VOICE))
|
||||
{
|
||||
int32_t voice = A_PlaySound(DUKE_SCREAM,pPlayer->i);
|
||||
if (voice <= 127) // XXX: p->scream_voice is an int8_t
|
||||
pPlayer->scream_voice = voice;
|
||||
}
|
||||
}
|
||||
|
||||
if ((pPlayer->pos.z + pPlayer->vel.z) >= (floorZ - (floorZOffset << 8)) && pPlayer->cursectnum >= 0) // hit the ground
|
||||
{
|
||||
ghsound_footstepsound(playerNum, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->falling_counter = 0;
|
||||
|
||||
if ((sectorLotag != ST_1_ABOVE_WATER && sectorLotag != ST_2_UNDERWATER) &&
|
||||
(pPlayer->on_ground == 0 && pPlayer->vel.z > (6144 >> 1)))
|
||||
pPlayer->hard_landing = pPlayer->vel.z>>10;
|
||||
|
||||
pPlayer->on_ground = 1;
|
||||
|
||||
if (floorZOffset==40)
|
||||
{
|
||||
//Smooth on the ground
|
||||
int Zdiff = ((floorZ - (floorZOffset << 8)) - pPlayer->pos.z) >> 1;
|
||||
|
||||
if (klabs(Zdiff) < 256)
|
||||
Zdiff = 0;
|
||||
|
||||
pPlayer->pos.z += ((klabs(Zdiff) >= 256) ? (((floorZ - (floorZOffset << 8)) - pPlayer->pos.z) >> 1) : 0);
|
||||
pPlayer->vel.z -= 768;
|
||||
|
||||
if (pPlayer->vel.z < 0)
|
||||
pPlayer->vel.z = 0;
|
||||
}
|
||||
else if (pPlayer->jumping_counter == 0)
|
||||
{
|
||||
pPlayer->pos.z += ((floorZ - (floorZOffset << 7)) - pPlayer->pos.z) >> 1; // Smooth on the water
|
||||
|
||||
if (pPlayer->on_warping_sector == 0 && pPlayer->pos.z > floorZ - ZOFFSET2)
|
||||
{
|
||||
pPlayer->pos.z = floorZ - ZOFFSET2;
|
||||
pPlayer->vel.z >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->on_warping_sector = 0;
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_CROUCH) && !pPlayer->OnMotorcycle)
|
||||
{
|
||||
// crouching
|
||||
pPlayer->pos.z += (2048+768);
|
||||
pPlayer->crack_time = 777;
|
||||
}
|
||||
|
||||
// jumping
|
||||
if (!TEST_SYNC_KEY(playerBits, SK_JUMP) && !pPlayer->OnMotorcycle && pPlayer->jumping_toggle == 1)
|
||||
pPlayer->jumping_toggle = 0;
|
||||
else if (TEST_SYNC_KEY(playerBits, SK_JUMP) && !pPlayer->OnMotorcycle && pPlayer->jumping_toggle == 0)
|
||||
{
|
||||
if (pPlayer->jumping_counter == 0)
|
||||
if ((floorZ-ceilZ) > (56<<8))
|
||||
{
|
||||
pPlayer->jumping_counter = 1;
|
||||
pPlayer->jumping_toggle = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pPlayer->jumping_counter)
|
||||
{
|
||||
if (!TEST_SYNC_KEY(playerBits, SK_JUMP) && !pPlayer->OnMotorcycle && pPlayer->jumping_toggle == 1)
|
||||
pPlayer->jumping_toggle = 0;
|
||||
|
||||
if (pPlayer->jumping_counter < 768)
|
||||
{
|
||||
if (sectorLotag == ST_1_ABOVE_WATER && pPlayer->jumping_counter > 768)
|
||||
{
|
||||
pPlayer->jumping_counter = 0;
|
||||
pPlayer->vel.z = -512;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->vel.z -= (sintable[(2048-128+pPlayer->jumping_counter)&2047])/12;
|
||||
pPlayer->jumping_counter += 180;
|
||||
pPlayer->on_ground = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->jumping_counter = 0;
|
||||
pPlayer->vel.z = 0;
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->pos.z += pPlayer->vel.z;
|
||||
|
||||
if (pPlayer->pos.z < (ceilZ+ZOFFSET6))
|
||||
{
|
||||
pPlayer->jumping_counter = 0;
|
||||
if (pPlayer->vel.z < 0)
|
||||
pPlayer->vel.x = pPlayer->vel.y = 0;
|
||||
pPlayer->vel.z = 128;
|
||||
pPlayer->pos.z = ceilZ+ZOFFSET6;
|
||||
}
|
||||
}
|
||||
|
||||
if (P_CheckLockedMovement(playerNum) & IL_NOMOVE)
|
||||
{
|
||||
velocityModifier = 0;
|
||||
pPlayer->vel.x = 0;
|
||||
pPlayer->vel.y = 0;
|
||||
}
|
||||
else if (thisPlayer.input->q16avel)
|
||||
pPlayer->crack_time = 777;
|
||||
|
||||
if (pPlayer->vel.x || pPlayer->vel.y || thisPlayer.input->fvel || thisPlayer.input->svel)
|
||||
{
|
||||
pPlayer->crack_time = 777;
|
||||
|
||||
pPlayer->not_on_water = 1;
|
||||
|
||||
pPlayer->vel.x += (((thisPlayer.input->fvel) * velocityModifier) << 6);
|
||||
pPlayer->vel.y += (((thisPlayer.input->svel) * velocityModifier) << 6);
|
||||
|
||||
pPlayer->vel.x = mulscale16(pPlayer->vel.x, pPlayer->runspeed);
|
||||
pPlayer->vel.y = mulscale16(pPlayer->vel.y, pPlayer->runspeed);
|
||||
|
||||
if (klabs(pPlayer->vel.x) < 2048 && klabs(pPlayer->vel.y) < 2048)
|
||||
pPlayer->vel.x = pPlayer->vel.y = 0;
|
||||
}
|
||||
|
||||
int stepHeight = (sectorLotag == ST_1_ABOVE_WATER || pPlayer->spritebridge == 1) ? pPlayer->autostep_sbw : pPlayer->autostep;
|
||||
|
||||
#ifdef EDUKE32_TOUCH_DEVICES
|
||||
if (TEST_SYNC_KEY(playerBits, SK_CROUCH))
|
||||
stepHeight = pPlayer->autostep_sbw;
|
||||
#endif
|
||||
|
||||
int spriteNum;
|
||||
|
||||
if (ud.clipping)
|
||||
{
|
||||
spriteNum = 0;
|
||||
pPlayer->pos.x += pPlayer->vel.x >> 14;
|
||||
pPlayer->pos.y += pPlayer->vel.y >> 14;
|
||||
updatesector(pPlayer->pos.x, pPlayer->pos.y, &pPlayer->cursectnum);
|
||||
changespritesect(pPlayer->i, pPlayer->cursectnum);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef YAX_ENABLE
|
||||
int const playerSectNum = pPlayer->cursectnum;
|
||||
int16_t ceilingBunch, floorBunch;
|
||||
|
||||
if (playerSectNum >= 0)
|
||||
yax_getbunches(playerSectNum, &ceilingBunch, &floorBunch);
|
||||
|
||||
// This updatesectorz conflicts with Duke3D's way of teleporting through water,
|
||||
// so make it a bit conditional... OTOH, this way we have an ugly z jump when
|
||||
// changing from above water to underwater
|
||||
|
||||
if ((playerSectNum >= 0 && !(sector[playerSectNum].lotag == ST_1_ABOVE_WATER && pPlayer->on_ground && floorBunch >= 0))
|
||||
&& ((floorBunch >= 0 && !(sector[playerSectNum].floorstat & 512))
|
||||
|| (ceilingBunch >= 0 && !(sector[playerSectNum].ceilingstat & 512))))
|
||||
{
|
||||
pPlayer->cursectnum += MAXSECTORS; // skip initial z check, restored by updatesectorz
|
||||
updatesectorz(pPlayer->pos.x, pPlayer->pos.y, pPlayer->pos.z, &pPlayer->cursectnum);
|
||||
}
|
||||
#endif
|
||||
int const oldSector = pPlayer->cursectnum;
|
||||
spriteNum = clipmove((vec3_t *)pPlayer, &pPlayer->cursectnum, pPlayer->vel.x, pPlayer->vel.y, 164,
|
||||
(4L << 8), stepHeight, CLIPMASK0);
|
||||
|
||||
if (pPlayer->cursectnum >= 0 && pPlayer->cursectnum < numsectors && sector[pPlayer->cursectnum].hitag == 2002)
|
||||
{
|
||||
pPlayer->pos = pPlayer->opos;
|
||||
pPlayer->cursectnum = oldSector;
|
||||
P_DoQuote(152, pPlayer);
|
||||
clipmove((vec3_t*)pPlayer, &pPlayer->cursectnum, 0, 0, 164, (4L << 8), stepHeight, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
||||
int waterSector = (sector[pPlayer->cursectnum].hitag == 2003);
|
||||
|
||||
if (waterSector)
|
||||
pPlayer->pos.z += 2048;
|
||||
|
||||
if ((spriteNum & 49152) == 32768)
|
||||
{
|
||||
}
|
||||
else if ((spriteNum & 49152) == 49152)
|
||||
{
|
||||
spriteNum &= (MAXSPRITES-1);
|
||||
|
||||
ghsound_plrtouchedsprite(spriteNum, playerNum);
|
||||
ghdeploy_plrtouchedsprite(spriteNum, playerNum);
|
||||
}
|
||||
|
||||
if (pPlayer->jetpack_on == 0)
|
||||
{
|
||||
if (thisPlayer.input->fvel && pPlayer->on_ground)
|
||||
{
|
||||
pPlayer->pycount += 64;
|
||||
pPlayer->pycount &= 2047;
|
||||
if (TEST_SYNC_KEY(playerBits, SK_CROUCH))
|
||||
{
|
||||
pPlayer->pyoff = klabs(sintable[pPlayer->pycount]) >> 6;
|
||||
ghsound_footstepsound(playerNum, 2);
|
||||
}
|
||||
else if (TEST_SYNC_KEY(playerBits, SK_RUN))
|
||||
{
|
||||
pPlayer->pyoff = klabs(sintable[pPlayer->pycount]) >> 5;
|
||||
pPlayer->pyoff += 256;
|
||||
if (waterSector)
|
||||
pPlayer->pyoff += 512;
|
||||
ghsound_footstepsound(playerNum, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->pyoff = klabs(sintable[pPlayer->pycount]) >> 6;
|
||||
pPlayer->pyoff += 16;
|
||||
if (waterSector)
|
||||
pPlayer->pyoff += 512;
|
||||
ghsound_footstepsound(playerNum, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
pPlayer->pyoff = 0;
|
||||
}
|
||||
|
||||
pPlayer->pos.z += PHEIGHT;
|
||||
setsprite(pPlayer->i, &pPlayer->pos);
|
||||
pPlayer->pos.z -= PHEIGHT;
|
||||
|
||||
if (pPlayer->cursectnum >= 0 && pPlayer->cursectnum != pSprite->sectnum)
|
||||
changespritesect(pPlayer->i, pPlayer->cursectnum);
|
||||
|
||||
if (pPlayer->cursectnum >= 0 && ud.clipping == 0)
|
||||
{
|
||||
int const squishPlayer = (pushmove((vec3_t *)pPlayer, &pPlayer->cursectnum, (!RR || pSprite->clipdist == 64) ? 164 : 16, (4L << 8), (4L << 8), CLIPMASK0) < 0 &&
|
||||
furthestangle(pPlayer->i, 8) < 512);
|
||||
}
|
||||
|
||||
if (pPlayer->return_to_center > 0)
|
||||
pPlayer->return_to_center--;
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_CENTER_VIEW) || pPlayer->hard_landing)
|
||||
pPlayer->return_to_center = 9;
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_LOOK_UP))
|
||||
{
|
||||
pPlayer->return_to_center = 9;
|
||||
thisPlayer.horizRecenter = true;
|
||||
thisPlayer.horizAngleAdjust = float(12<<(int)(TEST_SYNC_KEY(playerBits, SK_RUN)));
|
||||
}
|
||||
else if (TEST_SYNC_KEY(playerBits, SK_LOOK_DOWN))
|
||||
{
|
||||
pPlayer->return_to_center = 9;
|
||||
thisPlayer.horizRecenter = true;
|
||||
thisPlayer.horizAngleAdjust = -float(12<<(int)(TEST_SYNC_KEY(playerBits, SK_RUN)));
|
||||
}
|
||||
else if (TEST_SYNC_KEY(playerBits, SK_AIM_UP) && !pPlayer->OnMotorcycle)
|
||||
{
|
||||
thisPlayer.horizAngleAdjust = float(6 << (int)(TEST_SYNC_KEY(playerBits, SK_RUN)));
|
||||
thisPlayer.horizRecenter = false;
|
||||
}
|
||||
else if (TEST_SYNC_KEY(playerBits, SK_AIM_DOWN) && !pPlayer->OnMotorcycle)
|
||||
{
|
||||
thisPlayer.horizAngleAdjust = -float(6 << (int)(TEST_SYNC_KEY(playerBits, SK_RUN)));
|
||||
thisPlayer.horizRecenter = false;
|
||||
}
|
||||
if (RR && pPlayer->recoil && *weaponFrame == 0)
|
||||
{
|
||||
int delta = pPlayer->recoil >> 1;
|
||||
if (!delta) delta++;
|
||||
pPlayer->recoil -= delta;
|
||||
pPlayer->q16horiz -= F16(delta);
|
||||
}
|
||||
|
||||
if (pPlayer->hard_landing > 0)
|
||||
{
|
||||
thisPlayer.horizSkew = fix16_from_int(-(pPlayer->hard_landing << 4));
|
||||
pPlayer->hard_landing--;
|
||||
}
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_FIRE))
|
||||
A_DHShoot(playerNum);
|
||||
}
|
||||
|
||||
int P_HasKey(int sectNum, int playerNum)
|
||||
{
|
||||
|
|
|
@ -1681,12 +1681,6 @@ static void prelevel(char g)
|
|||
animwall[g_animWallCnt].tag = 0;
|
||||
animwall[g_animWallCnt].wallnum = 0;
|
||||
|
||||
if (DEER)
|
||||
{
|
||||
pWall->extra = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
int const switchPic = G_GetForcefieldPicnum(i);
|
||||
|
||||
if (switchPic >= 0)
|
||||
|
@ -1843,8 +1837,6 @@ static void prelevel(char g)
|
|||
|
||||
G_SetupGlobalPsky();
|
||||
|
||||
if (DEER)
|
||||
sub_52BA8();
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -751,9 +751,6 @@ void G_DisplayRest(int32_t smoothratio)
|
|||
G_MoveClouds();
|
||||
}
|
||||
|
||||
if (DEER)
|
||||
sub_57B38(pp->opos.x, pp->opos.y, 20, 1536);
|
||||
|
||||
if (ud.overhead_on > 0)
|
||||
{
|
||||
// smoothratio = min(max(smoothratio,0),65536);
|
||||
|
@ -1094,103 +1091,6 @@ void G_DisplayLogo(void)
|
|||
|
||||
Mus_Stop();
|
||||
FX_StopAllSounds(); // JBF 20031228
|
||||
if (DEER)
|
||||
{
|
||||
if (!g_noLogo /* && (!g_netServer && ud.multimode < 2) */)
|
||||
{
|
||||
if (!inputState.CheckAllInput() && g_noLogoAnim == 0)
|
||||
{
|
||||
videoClearScreen(0);
|
||||
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
|
||||
fadepal(0, 0, 0, 0, 252, 28);
|
||||
renderFlushPerms();
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 7106, 0, 0, 2 + 8 + 64 + BGSTRETCH);
|
||||
videoNextPage();
|
||||
fadepaltile(0, 0, 0, 252, 0, -4, 7106, BASEPAL);
|
||||
totalclock = 0;
|
||||
|
||||
while (totalclock < (120 * 3) && !inputState.CheckAllInput())
|
||||
{
|
||||
if (G_FPSLimit())
|
||||
{
|
||||
videoClearScreen(0);
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 7106, 0, 0, 2 + 8 + 64 + BGSTRETCH);
|
||||
G_HandleAsync();
|
||||
|
||||
if (restorepalette)
|
||||
{
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, g_player[myconnectindex].ps->palette, 0);
|
||||
restorepalette = 0;
|
||||
}
|
||||
videoNextPage();
|
||||
}
|
||||
}
|
||||
|
||||
fadepaltile(0, 0, 0, 0, 252, 4, 7106, BASEPAL);
|
||||
}
|
||||
|
||||
videoClearScreen(0L);
|
||||
videoNextPage();
|
||||
|
||||
inputState.ClearAllInput();
|
||||
|
||||
videoClearScreen(0L);
|
||||
videoNextPage();
|
||||
|
||||
videoClearScreen(0);
|
||||
|
||||
//g_player[myconnectindex].ps->palette = drealms;
|
||||
//G_FadePalette(0,0,0,252);
|
||||
|
||||
if (!inputState.CheckAllInput() && g_noLogoAnim == 0)
|
||||
{
|
||||
videoClearScreen(0);
|
||||
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
|
||||
fadepal(0, 0, 0, 0, 252, 28);
|
||||
renderFlushPerms();
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 7107, 0, 0, 2 + 8 + 64 + BGSTRETCH);
|
||||
videoNextPage();
|
||||
fadepaltile(0, 0, 0, 252, 0, -4, 7107, BASEPAL);
|
||||
totalclock = 0;
|
||||
|
||||
while (totalclock < (120 * 3) && !inputState.CheckAllInput())
|
||||
{
|
||||
if (G_FPSLimit())
|
||||
{
|
||||
videoClearScreen(0);
|
||||
rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 7107, 0, 0, 2 + 8 + 64 + BGSTRETCH);
|
||||
G_HandleAsync();
|
||||
|
||||
if (restorepalette)
|
||||
{
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, g_player[myconnectindex].ps->palette, 0);
|
||||
restorepalette = 0;
|
||||
}
|
||||
videoNextPage();
|
||||
}
|
||||
}
|
||||
|
||||
fadepaltile(0, 0, 0, 0, 252, 4, 7107, BASEPAL);
|
||||
}
|
||||
|
||||
inputState.ClearAllInput();
|
||||
}
|
||||
|
||||
renderFlushPerms();
|
||||
videoClearScreen(0L);
|
||||
videoNextPage();
|
||||
|
||||
//g_player[myconnectindex].ps->palette = palette;
|
||||
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
|
||||
|
||||
//G_FadePalette(0,0,0,0);
|
||||
videoClearScreen(0L);
|
||||
|
||||
g_noLogo = 1; // Play intro only once
|
||||
return;
|
||||
}
|
||||
if (RRRA)
|
||||
return;
|
||||
if (RR)
|
||||
|
|
Loading…
Reference in a new issue