From e0b2c4cc86f1e1a19498d8bc899729e5d178cff8 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 6 Dec 2013 23:02:00 -0600 Subject: Fix white flash levelshot bug in OpenGL1 If you tried to draw the last loaded image, gl texture 0 (which is appearently white) was used because renderer thought the image was already bound. Why OpenGL1 renderer binds texture 0, I have no idea. It's been removed from OpenGL2. --- src/renderergl1/tr_image.c | 2 ++ src/renderergl1/tr_model.c | 5 ----- src/renderergl2/tr_model.c | 5 ----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/renderergl1/tr_image.c b/src/renderergl1/tr_image.c index e91df62f..d66661c6 100644 --- a/src/renderergl1/tr_image.c +++ b/src/renderergl1/tr_image.c @@ -901,6 +901,8 @@ image_t *R_CreateImage( const char *name, byte *pic, int width, int height, qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glWrapClampMode ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glWrapClampMode ); + // FIXME: this stops fog from setting border color? + glState.currenttextures[glState.currenttmu] = 0; qglBindTexture( GL_TEXTURE_2D, 0 ); if ( image->TMU == 1 ) { diff --git a/src/renderergl1/tr_model.c b/src/renderergl1/tr_model.c index bbc8e437..3f7423c3 100644 --- a/src/renderergl1/tr_model.c +++ b/src/renderergl1/tr_model.c @@ -887,11 +887,6 @@ void RE_BeginRegistration( glconfig_t *glconfigOut ) { RE_ClearScene(); tr.registered = qtrue; - - // NOTE: this sucks, for some reason the first stretch pic is never drawn - // without this we'd see a white flash on a level load because the very - // first time the level shot would not be drawn -// RE_StretchPic(0, 0, 0, 0, 0, 0, 1, 1, 0); } //============================================================================= diff --git a/src/renderergl2/tr_model.c b/src/renderergl2/tr_model.c index 3ac40e6a..2627afc4 100644 --- a/src/renderergl2/tr_model.c +++ b/src/renderergl2/tr_model.c @@ -1148,11 +1148,6 @@ void RE_BeginRegistration( glconfig_t *glconfigOut ) { RE_ClearScene(); tr.registered = qtrue; - - // NOTE: this sucks, for some reason the first stretch pic is never drawn - // without this we'd see a white flash on a level load because the very - // first time the level shot would not be drawn -// RE_StretchPic(0, 0, 0, 0, 0, 0, 1, 1, 0); } //============================================================================= -- cgit