- let SyncInput return a combination of gamesetinput and cl_syncinput - also serialize gamesetinput.

This commit is contained in:
Christoph Oelckers 2020-11-30 23:45:21 +01:00
parent ae36ea88c3
commit 5850c7b284
3 changed files with 21 additions and 19 deletions

View file

@ -228,18 +228,3 @@ extern bool sendPause;
extern int lastTic; 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;
}

View file

@ -105,8 +105,24 @@ void SetupGameButtons();
void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false); void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false);
extern ESyncBits ActionsToSend; extern ESyncBits ActionsToSend;
double InputScale(); double InputScale();
extern bool gamesetinput;
inline bool SyncInput() inline bool SyncInput()
{ {
return cl_syncinput; return gamesetinput || cl_syncinput;
} }
//---------------------------------------------------------------------------
//
// Inline functions to help with edge cases where synchronised input is needed.
//
//---------------------------------------------------------------------------
inline void setForcedSyncInput()
{
gamesetinput = true;
}
inline void resetForcedSyncInput()
{
gamesetinput = false;
}

View file

@ -630,7 +630,7 @@ void SerializeMap(FSerializer& arc)
.Array("headspritesect", headspritesect, MAXSECTORS + 1) .Array("headspritesect", headspritesect, MAXSECTORS + 1)
.Array("nextspritesect", nextspritesect, MAXSPRITES) .Array("nextspritesect", nextspritesect, MAXSPRITES)
.Array("prevspritesect", prevspritesect, MAXSPRITES) .Array("prevspritesect", prevspritesect, MAXSPRITES)
("tailspritefree", tailspritefree) ("tailspritefree", tailspritefree)
("myconnectindex", myconnectindex) ("myconnectindex", myconnectindex)
("connecthead", connecthead) ("connecthead", connecthead)
@ -643,7 +643,8 @@ void SerializeMap(FSerializer& arc)
("parallaxyo", parallaxyoffs_override) ("parallaxyo", parallaxyoffs_override)
("parallaxys", parallaxyscale_override) ("parallaxys", parallaxyscale_override)
("pskybits", pskybits_override) ("pskybits", pskybits_override)
("numsprites", Numsprites); ("numsprites", Numsprites)
("gamesetinput", gamesetinput);
SerializeInterpolations(arc); SerializeInterpolations(arc);