- things are mostly working again.

Rendering produces an image again, input gets properly processed, but unsynchronised mouse input isn't properly applied yet.
This commit is contained in:
Christoph Oelckers 2020-08-30 19:59:46 +02:00
parent 38d10cc591
commit 765f211e05
6 changed files with 25 additions and 9 deletions

View file

@ -138,7 +138,6 @@ void S_ParseSndInfo();
void I_DetectOS(void); void I_DetectOS(void);
void LoadScripts(); void LoadScripts();
void app_loop(); void app_loop();
void DrawFullscreenBlends();
void MainLoop(); void MainLoop();
@ -904,7 +903,7 @@ void TickSubsystems()
if (cnt == 5) nexttick = nowtick + tickInterval; if (cnt == 5) nexttick = nowtick + tickInterval;
} }
static void updatePauseStatus() void updatePauseStatus()
{ {
// This must go through the network in multiplayer games. // This must go through the network in multiplayer games.
if (M_Active() || System_WantGuiCapture()) if (M_Active() || System_WantGuiCapture())

View file

@ -16,6 +16,7 @@ class FArgs;
extern bool GUICapture; extern bool GUICapture;
extern bool AppActive; extern bool AppActive;
extern cycle_t drawtime, actortime, thinktime, gameupdatetime; extern cycle_t drawtime, actortime, thinktime, gameupdatetime;
extern bool r_NoInterpolate;
extern FMemArena dump; // this is for memory blocks than cannot be deallocated without some huge effort. Put them in here so that they do not register on shutdown. extern FMemArena dump; // this is for memory blocks than cannot be deallocated without some huge effort. Put them in here so that they do not register on shutdown.
@ -49,6 +50,7 @@ int32_t CONFIG_GetMapBestTime(char const* const mapname, uint8_t const* const ma
int CONFIG_SetMapBestTime(uint8_t const* const mapmd4, int32_t tm); int CONFIG_SetMapBestTime(uint8_t const* const mapmd4, int32_t tm);
int GameMain(); int GameMain();
void startmainmenu(); void startmainmenu();
void updatePauseStatus();
struct UserConfig struct UserConfig
{ {

View file

@ -160,6 +160,7 @@ int32_t handleevents(void)
setViewport(hud_size); setViewport(hud_size);
setsizeneeded = false; setsizeneeded = false;
} }
#pragma message ("only for old game loop")
twod->SetSize(screen->GetWidth(), screen->GetHeight()); twod->SetSize(screen->GetWidth(), screen->GetHeight());
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight()); twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());

View file

@ -179,6 +179,7 @@ static void GameTicker()
} }
C_RunDelayedCommands(); C_RunDelayedCommands();
updatePauseStatus();
switch (gamestate) switch (gamestate)
{ {
@ -191,6 +192,7 @@ static void GameTicker()
case GS_LEVEL: case GS_LEVEL:
gameupdatetime.Reset(); gameupdatetime.Reset();
gameupdatetime.Clock(); gameupdatetime.Clock();
gameclock += 120 / GameTicRate;
gi->Ticker(); gi->Ticker();
gameupdatetime.Unclock(); gameupdatetime.Unclock();
break; break;
@ -238,6 +240,12 @@ void Display()
case GS_LEVEL: case GS_LEVEL:
if (gametic != 0) if (gametic != 0)
{ {
screen->BeginFrame();
screen->SetSceneRenderTarget(gl_ssao != 0);
twodpsp.Clear();
twod->Clear();
twod->SetSize(screen->GetWidth(), screen->GetHeight());
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());
gi->Render(); gi->Render();
DrawFullscreenBlends(); DrawFullscreenBlends();
} }
@ -259,7 +267,7 @@ void Display()
DrawRateStuff(); DrawRateStuff();
} }
videoShowFrame(0); videoShowFrame(1);
} }
//========================================================================== //==========================================================================

View file

@ -68,7 +68,9 @@ void GameInterface::Ticker()
{ {
global_random = krand(); global_random = krand();
movedummyplayers();//ST 13 movedummyplayers();//ST 13
r_NoInterpolate = false;
} }
else r_NoInterpolate = true;
for (int i = connecthead; i >= 0; i = connectpoint2[i]) for (int i = connecthead; i >= 0; i = connectpoint2[i])
{ {

View file

@ -489,13 +489,17 @@ void videoShowFrame(int32_t w)
}); });
screen->Update(); screen->Update();
screen->mVertexData->Reset(); screen->mVertexData->Reset();
videoSetBrightness(0); // immediately reset this after rendering so that the value doesn't stick around in the backend.
// After finishing the frame, reset everything for the next frame. This needs to be done better. // After finishing the frame, reset everything for the next frame. This needs to be done better.
if (!w)
{
screen->BeginFrame(); screen->BeginFrame();
bool useSSAO = (gl_ssao != 0); bool useSSAO = (gl_ssao != 0);
screen->SetSceneRenderTarget(useSSAO); screen->SetSceneRenderTarget(useSSAO);
twodpsp.Clear(); twodpsp.Clear();
twod->Clear(); twod->Clear();
videoSetBrightness(0); // immediately reset this after rendering so that the value doesn't stick around in the backend. }
} }
TMap<int64_t, bool> cachemap; TMap<int64_t, bool> cachemap;