Skip to content

Commit

Permalink
- second part of texture fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Feb 15, 2018
1 parent ef55386 commit 6a02eaa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/gl/renderer/gl_renderer.cpp
Expand Up @@ -162,6 +162,8 @@ void FGLRenderer::Initialize(int width, int height)
mCustomPostProcessShaders = new FCustomPostProcessShaders();
m2DDrawer = new F2DDrawer;

GetSpecialTextures();

// needed for the core profile, because someone decided it was a good idea to remove the default VAO.
if (!gl.legacyMode)
{
Expand All @@ -171,11 +173,6 @@ void FGLRenderer::Initialize(int width, int height)
}
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);
mSkyVBO = new FSkyVertexBuffer;
if (!gl.legacyMode) mLights = new FLightBuffer();
Expand Down Expand Up @@ -236,6 +233,16 @@ FGLRenderer::~FGLRenderer()
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
Expand Down
1 change: 1 addition & 0 deletions src/gl/renderer/gl_renderer.h
Expand Up @@ -190,6 +190,7 @@ class FGLRenderer
void CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma);
void DrawPresentTexture(const GL_IRECT &box, bool applyGamma);
void Flush();
void GetSpecialTextures();


bool StartOffscreen();
Expand Down
1 change: 1 addition & 0 deletions src/gl/system/gl_framebuffer.cpp
Expand Up @@ -551,6 +551,7 @@ void OpenGLFrameBuffer::GameRestart()
UpdatePalette ();
ScreenshotBuffer = NULL;
gl_GenerateGlobalBrightmapFromColormap();
GLRenderer->GetSpecialTextures();
}


Expand Down

0 comments on commit 6a02eaa

Please sign in to comment.