- second part of texture fix.

This commit is contained in:
Christoph Oelckers 2018-02-15 18:40:23 +01:00
parent ef55386d9f
commit 6a02eaa595
3 changed files with 14 additions and 5 deletions

View File

@ -162,6 +162,8 @@ void FGLRenderer::Initialize(int width, int height)
mCustomPostProcessShaders = new FCustomPostProcessShaders(); mCustomPostProcessShaders = new FCustomPostProcessShaders();
m2DDrawer = new F2DDrawer; m2DDrawer = new F2DDrawer;
GetSpecialTextures();
// needed for the core profile, because someone decided it was a good idea to remove the default VAO. // needed for the core profile, because someone decided it was a good idea to remove the default VAO.
if (!gl.legacyMode) if (!gl.legacyMode)
{ {
@ -171,11 +173,6 @@ void FGLRenderer::Initialize(int width, int height)
} }
else mVAOID = 0; else mVAOID = 0;
if (gl.legacyMode) glLight = TexMan.CheckForTexture("glstuff/gllight.png", FTexture::TEX_MiscPatch);
glPart2 = TexMan.CheckForTexture("glstuff/glpart2.png", FTexture::TEX_MiscPatch);
glPart = TexMan.CheckForTexture("glstuff/glpart.png", FTexture::TEX_MiscPatch);
mirrorTexture = TexMan.CheckForTexture("glstuff/mirror.png", FTexture::TEX_MiscPatch);
mVBO = new FFlatVertexBuffer(width, height); mVBO = new FFlatVertexBuffer(width, height);
mSkyVBO = new FSkyVertexBuffer; mSkyVBO = new FSkyVertexBuffer;
if (!gl.legacyMode) mLights = new FLightBuffer(); if (!gl.legacyMode) mLights = new FLightBuffer();
@ -236,6 +233,16 @@ FGLRenderer::~FGLRenderer()
delete mFXAALumaShader; delete mFXAALumaShader;
} }
void FGLRenderer::GetSpecialTextures()
{
if (gl.legacyMode) glLight = TexMan.CheckForTexture("glstuff/gllight.png", FTexture::TEX_MiscPatch);
glPart2 = TexMan.CheckForTexture("glstuff/glpart2.png", FTexture::TEX_MiscPatch);
glPart = TexMan.CheckForTexture("glstuff/glpart.png", FTexture::TEX_MiscPatch);
mirrorTexture = TexMan.CheckForTexture("glstuff/mirror.png", FTexture::TEX_MiscPatch);
}
//========================================================================== //==========================================================================
// //
// Calculates the viewport values needed for 2D and 3D operations // Calculates the viewport values needed for 2D and 3D operations

View File

@ -190,6 +190,7 @@ public:
void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma); void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
void DrawPresentTexture(const GL_IRECT &box, bool applyGamma); void DrawPresentTexture(const GL_IRECT &box, bool applyGamma);
void Flush(); void Flush();
void GetSpecialTextures();
bool StartOffscreen(); bool StartOffscreen();

View File

@ -551,6 +551,7 @@ void OpenGLFrameBuffer::GameRestart()
UpdatePalette (); UpdatePalette ();
ScreenshotBuffer = NULL; ScreenshotBuffer = NULL;
gl_GenerateGlobalBrightmapFromColormap(); gl_GenerateGlobalBrightmapFromColormap();
GLRenderer->GetSpecialTextures();
} }