From 1e9a6e667e4b6e620b7f3a8a1e20638f20ec7d8f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 1 Apr 2015 11:59:41 +0200 Subject: [PATCH] - GL code adjustments for reworked precaching. --- src/gl/system/gl_framebuffer.cpp | 4 ++-- src/gl/textures/gl_skyboxtexture.cpp | 17 ----------------- src/gl/textures/gl_skyboxtexture.h | 1 - src/gl/textures/gl_texture.cpp | 4 ++-- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index d9f05bea6..38de87cae 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -332,7 +332,7 @@ void OpenGLFrameBuffer::GetHitlist(BYTE *hitlist) // check skybox textures and mark the separate faces as used for(int i=0;igl_info.bSkybox) @@ -343,7 +343,7 @@ void OpenGLFrameBuffer::GetHitlist(BYTE *hitlist) if (sb->faces[i]) { int index = sb->faces[i]->id.GetIndex(); - hitlist[index] |= 1; + hitlist[index] |= FTextureManager::HIT_Flat; } } } diff --git a/src/gl/textures/gl_skyboxtexture.cpp b/src/gl/textures/gl_skyboxtexture.cpp index 71f5be8f4..c86556ea9 100644 --- a/src/gl/textures/gl_skyboxtexture.cpp +++ b/src/gl/textures/gl_skyboxtexture.cpp @@ -132,23 +132,6 @@ void FSkyBox::Unload () // //----------------------------------------------------------------------------- -void FSkyBox::PrecacheGL(int cache) -{ - for (int i = 0; i < 6; i++) - { - if (faces[i]) - { - faces[i]->PrecacheGL(cache); - } - } -} - -//----------------------------------------------------------------------------- -// -// -// -//----------------------------------------------------------------------------- - void gl_ParseSkybox(FScanner &sc) { int facecount=0; diff --git a/src/gl/textures/gl_skyboxtexture.h b/src/gl/textures/gl_skyboxtexture.h index ce58308a1..28a052be9 100644 --- a/src/gl/textures/gl_skyboxtexture.h +++ b/src/gl/textures/gl_skyboxtexture.h @@ -21,7 +21,6 @@ public: int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf); bool UseBasePalette(); void Unload (); - void PrecacheGL(int cache); void SetSize() { diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index 8b314f02f..27a489162 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -320,12 +320,12 @@ void FTexture::PrecacheGL(int cache) { if (gl_precache) { - if (cache & 2) + if (cache & (FTextureManager::HIT_Wall | FTextureManager::HIT_Flat | FTextureManager::HIT_Sky)) { FMaterial * gltex = FMaterial::ValidateTexture(this, false); if (gltex) gltex->Precache(); } - if (cache & 4) + if (cache & FTextureManager::HIT_Sprite) { FMaterial * gltex = FMaterial::ValidateTexture(this, true); if (gltex) gltex->Precache();