mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- Exhumed/SW: Move code to trigger synchronised input for edge cases where its needed into gamecontrol.
This commit is contained in:
parent
0b797b0ccd
commit
22f7fc93f4
4 changed files with 25 additions and 17 deletions
|
@ -152,6 +152,8 @@ extern int hud_size_max;
|
|||
int paused;
|
||||
bool pausedWithKey;
|
||||
|
||||
bool gamesetinput = false;
|
||||
|
||||
CUSTOM_CVAR(Int, cl_gender, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < 0 || self > 3) self = 0;
|
||||
|
|
|
@ -226,3 +226,20 @@ extern int chatmodeon;
|
|||
|
||||
extern bool sendPause;
|
||||
extern int lastTic;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Inline functions to help with edge cases where synchronised input is needed.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
extern bool gamesetinput;
|
||||
inline void setForcedSyncInput()
|
||||
{
|
||||
if (!cl_syncinput) gamesetinput = cl_syncinput = true;
|
||||
}
|
||||
inline void resetForcedSyncInput()
|
||||
{
|
||||
if (gamesetinput) gamesetinput = cl_syncinput = false;
|
||||
}
|
||||
|
|
|
@ -34,8 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
BEGIN_PS_NS
|
||||
|
||||
static bool gamesetinput = false;
|
||||
|
||||
void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
||||
{
|
||||
Player *nPlayer = &PlayerList[nLocalPlayer];
|
||||
|
@ -107,15 +105,15 @@ void GameInterface::ToggleThirdPerson()
|
|||
{
|
||||
bCamera = !bCamera;
|
||||
|
||||
if (bCamera && !cl_syncinput)
|
||||
if (bCamera)
|
||||
{
|
||||
gamesetinput = cl_syncinput = true;
|
||||
setForcedSyncInput();
|
||||
GrabPalette();
|
||||
}
|
||||
}
|
||||
if (gamesetinput && !bCamera)
|
||||
if (!bCamera)
|
||||
{
|
||||
gamesetinput = cl_syncinput = false;
|
||||
resetForcedSyncInput();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -133,9 +133,6 @@ PLAYER Player[MAX_SW_PLAYERS_REG + 1];
|
|||
|
||||
short NormalVisibility;
|
||||
|
||||
// bool for determining whether game has set cl_syncinput or not.
|
||||
static bool gamesetinput = false;
|
||||
|
||||
int InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity);
|
||||
|
||||
SPRITEp FindNearSprite(SPRITEp sp, short stat);
|
||||
|
@ -2815,10 +2812,7 @@ DoPlayerMoveVehicle(PLAYERp pp)
|
|||
}
|
||||
|
||||
// force synchronised input here for now.
|
||||
if (!cl_syncinput)
|
||||
{
|
||||
gamesetinput = cl_syncinput = true;
|
||||
}
|
||||
setForcedSyncInput();
|
||||
|
||||
if (PLAYER_MOVING(pp) == 0)
|
||||
RESET(pp->Flags, PF_PLAYER_MOVED);
|
||||
|
@ -7236,10 +7230,7 @@ domovethings(void)
|
|||
pp->angle.resetadjustment();
|
||||
|
||||
// disable synchronised input if set by game.
|
||||
if (gamesetinput)
|
||||
{
|
||||
gamesetinput = cl_syncinput = false;
|
||||
}
|
||||
resetForcedSyncInput();
|
||||
|
||||
if (pp->DoPlayerAction) pp->DoPlayerAction(pp);
|
||||
|
||||
|
|
Loading…
Reference in a new issue