mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-16 04:30:38 +00:00
- fixed some initialization issues with the new main loop.
Looks like all map starting cases are working now.
This commit is contained in:
parent
695d81f88c
commit
85538b467b
3 changed files with 46 additions and 38 deletions
|
@ -746,48 +746,53 @@ void EndOfLevel()
|
||||||
|
|
||||||
void GameTicker(void)
|
void GameTicker(void)
|
||||||
{
|
{
|
||||||
if (SavegameLoaded)
|
if (!ExitLevel)
|
||||||
{
|
{
|
||||||
InitLevelGlobals();
|
if (SavegameLoaded)
|
||||||
SavegameLoaded = false;
|
|
||||||
// contains what is needed from calls below
|
|
||||||
if (snd_ambience)
|
|
||||||
StartAmbientSound();
|
|
||||||
// crappy little hack to prevent play clock from being overwritten
|
|
||||||
// for load games
|
|
||||||
int SavePlayClock = PlayClock;
|
|
||||||
InitTimingVars();
|
|
||||||
PlayClock = SavePlayClock;
|
|
||||||
}
|
|
||||||
else if (NextLevel)
|
|
||||||
{
|
|
||||||
InitLevel();
|
|
||||||
InitRunLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
ready2send = 1;
|
|
||||||
|
|
||||||
|
|
||||||
if (paused)
|
|
||||||
{
|
|
||||||
ototalclock = (int)totalclock - (120 / synctics);
|
|
||||||
buttonMap.ResetButtonStates();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while (ready2send && (totalclock >= ototalclock + synctics))
|
|
||||||
{
|
{
|
||||||
UpdateInputs();
|
InitLevelGlobals();
|
||||||
MoveTicker();
|
SavegameLoaded = false;
|
||||||
|
// contains what is needed from calls below
|
||||||
|
if (snd_ambience)
|
||||||
|
StartAmbientSound();
|
||||||
|
// crappy little hack to prevent play clock from being overwritten
|
||||||
|
// for load games
|
||||||
|
int SavePlayClock = PlayClock;
|
||||||
|
InitTimingVars();
|
||||||
|
PlayClock = SavePlayClock;
|
||||||
|
ExitLevel = false;
|
||||||
|
}
|
||||||
|
else if (NextLevel)
|
||||||
|
{
|
||||||
|
InitLevel();
|
||||||
|
InitRunLevel();
|
||||||
|
ExitLevel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get input again to update q16ang/q16horiz.
|
ready2send = 1;
|
||||||
if (!PedanticMode)
|
|
||||||
getinput(&loc, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
drawscreen(Player + screenpeek);
|
|
||||||
ready2send = 0;
|
if (paused)
|
||||||
|
{
|
||||||
|
ototalclock = (int)totalclock - (120 / synctics);
|
||||||
|
buttonMap.ResetButtonStates();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (ready2send && (totalclock >= ototalclock + synctics))
|
||||||
|
{
|
||||||
|
UpdateInputs();
|
||||||
|
MoveTicker();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get input again to update q16ang/q16horiz.
|
||||||
|
if (!PedanticMode)
|
||||||
|
getinput(&loc, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawscreen(Player + screenpeek);
|
||||||
|
ready2send = 0;
|
||||||
|
}
|
||||||
if (ExitLevel)
|
if (ExitLevel)
|
||||||
{
|
{
|
||||||
ExitLevel = false;
|
ExitLevel = false;
|
||||||
|
@ -812,7 +817,7 @@ int32_t GameInterface::app_main()
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// if the menu initiazed a new game or loaded a savegame, switch to play mode.
|
// if the menu initiazed a new game or loaded a savegame, switch to play mode.
|
||||||
if (NewGame || SavegameLoaded) gamestate = GS_LEVEL;
|
if (SavegameLoaded || NextLevel) gamestate = GS_LEVEL;
|
||||||
|
|
||||||
handleevents();
|
handleevents();
|
||||||
updatePauseStatus();
|
updatePauseStatus();
|
||||||
|
|
|
@ -2121,6 +2121,7 @@ void DoSoundSpotMatch(short match, short sound_num, short sound_type);
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
extern SWBOOL NewGame;
|
||||||
extern SWBOOL ExitLevel, FinishedLevel;
|
extern SWBOOL ExitLevel, FinishedLevel;
|
||||||
extern SWBOOL Warping;
|
extern SWBOOL Warping;
|
||||||
extern uint8_t CommPlayers;
|
extern uint8_t CommPlayers;
|
||||||
|
|
|
@ -46,6 +46,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "mapinfo.h"
|
#include "mapinfo.h"
|
||||||
#include "jsector.h"
|
#include "jsector.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "gamestate.h"
|
||||||
|
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ static void levelwarp(MapRecord *maprec)
|
||||||
|
|
||||||
NextLevel = maprec;
|
NextLevel = maprec;
|
||||||
ExitLevel = TRUE;
|
ExitLevel = TRUE;
|
||||||
|
if (gamestate == GS_MENUSCREEN || gamestate == GS_FULLCONSOLE) NewGame = true;
|
||||||
|
|
||||||
sprintf(ds, "%s %s", GStrings("TXT_ENTERING"), maprec->DisplayName());
|
sprintf(ds, "%s %s", GStrings("TXT_ENTERING"), maprec->DisplayName());
|
||||||
PutStringInfo(pp, ds);
|
PutStringInfo(pp, ds);
|
||||||
|
|
Loading…
Reference in a new issue