mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +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
|
@ -67,6 +67,8 @@ struct FLevelLocals
|
||||||
FString F1Pic;
|
FString F1Pic;
|
||||||
EMapType maptype;
|
EMapType maptype;
|
||||||
|
|
||||||
|
uint64_t ShaderStartTime = 0; // tell the shader system when we started the level (forces a timer restart)
|
||||||
|
|
||||||
TArray<vertex_t> vertexes;
|
TArray<vertex_t> vertexes;
|
||||||
TArray<sector_t> sectors;
|
TArray<sector_t> sectors;
|
||||||
TArray<line_t*> linebuffer; // contains the line lists for the sectors.
|
TArray<line_t*> linebuffer; // contains the line lists for the sectors.
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "gl/renderer/gl_colormap.h"
|
#include "gl/renderer/gl_colormap.h"
|
||||||
#include "gl/dynlights//gl_lightbuffer.h"
|
#include "gl/dynlights//gl_lightbuffer.h"
|
||||||
#include "gl/renderer/gl_renderbuffers.h"
|
#include "gl/renderer/gl_renderbuffers.h"
|
||||||
|
#include "g_levellocals.h"
|
||||||
|
|
||||||
void gl_SetTextureMode(int type);
|
void gl_SetTextureMode(int type);
|
||||||
|
|
||||||
|
@ -121,7 +122,7 @@ bool FRenderState::ApplyShader()
|
||||||
static uint64_t firstFrame = 0;
|
static uint64_t firstFrame = 0;
|
||||||
// if firstFrame is not yet initialized, initialize it to current time
|
// 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 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;
|
firstFrame = screen->FrameTime;
|
||||||
|
|
||||||
static const float nulvec[] = { 0.f, 0.f, 0.f, 0.f };
|
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;
|
bool buildmap;
|
||||||
const int *oldvertextable = NULL;
|
const int *oldvertextable = NULL;
|
||||||
|
|
||||||
|
level.ShaderStartTime = I_msTime(); // indicate to the shader system that the level just started
|
||||||
|
|
||||||
// This is motivated as follows:
|
// This is motivated as follows:
|
||||||
|
|
||||||
bool RequireGLNodes = Renderer->RequireGLNodes() || am_textured;
|
bool RequireGLNodes = Renderer->RequireGLNodes() || am_textured;
|
||||||
|
|
Loading…
Reference in a new issue