mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- track level start time for the shader system, reset the shaders.
This commit is contained in:
parent
d2bc24737b
commit
ab32cb4c88
4 changed files with 7 additions and 2 deletions
|
@ -362,7 +362,7 @@ struct level_info_t
|
|||
int outsidefogdensity;
|
||||
int skyfog;
|
||||
float pixelstretch;
|
||||
|
||||
|
||||
// Redirection: If any player is carrying the specified item, then
|
||||
// you go to the RedirectMap instead of this one.
|
||||
FName RedirectType;
|
||||
|
|
|
@ -67,6 +67,8 @@ struct FLevelLocals
|
|||
FString F1Pic;
|
||||
EMapType maptype;
|
||||
|
||||
uint64_t ShaderStartTime = 0; // tell the shader system when we started the level (forces a timer restart)
|
||||
|
||||
TArray<vertex_t> vertexes;
|
||||
TArray<sector_t> sectors;
|
||||
TArray<line_t*> linebuffer; // contains the line lists for the sectors.
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "gl/renderer/gl_colormap.h"
|
||||
#include "gl/dynlights//gl_lightbuffer.h"
|
||||
#include "gl/renderer/gl_renderbuffers.h"
|
||||
#include "g_levellocals.h"
|
||||
|
||||
void gl_SetTextureMode(int type);
|
||||
|
||||
|
@ -121,7 +122,7 @@ bool FRenderState::ApplyShader()
|
|||
static uint64_t firstFrame = 0;
|
||||
// if firstFrame is not yet initialized, initialize it to current time
|
||||
// if we're going to overflow a float (after ~4.6 hours, or 24 bits), re-init to regain precision
|
||||
if ((firstFrame == 0) || (screen->FrameTime - firstFrame >= 1<<24))
|
||||
if ((firstFrame == 0) || (screen->FrameTime - firstFrame >= 1<<24) || level.ShaderStartTime > firstFrame)
|
||||
firstFrame = screen->FrameTime;
|
||||
|
||||
static const float nulvec[] = { 0.f, 0.f, 0.f, 0.f };
|
||||
|
|
|
@ -3627,6 +3627,8 @@ void P_SetupLevel (const char *lumpname, int position)
|
|||
bool buildmap;
|
||||
const int *oldvertextable = NULL;
|
||||
|
||||
level.ShaderStartTime = I_msTime(); // indicate to the shader system that the level just started
|
||||
|
||||
// This is motivated as follows:
|
||||
|
||||
bool RequireGLNodes = Renderer->RequireGLNodes() || am_textured;
|
||||
|
|
Loading…
Reference in a new issue