From 6066fdf4216fc066fc425d018b68d34c935a99af Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 10 Aug 2014 00:31:37 +0000 Subject: [PATCH] Fix some bugs. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4718 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_csqc.c | 3 ++- engine/client/sys_win.c | 4 ++-- engine/gl/gl_bloom.c | 26 ++++++++++++++++++-------- engine/gl/gl_rmain.c | 3 ++- engine/gl/gl_rmisc.c | 2 -- engine/gl/glquake.h | 2 +- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 6f48c9673..d35e03703 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -4068,7 +4068,8 @@ static void QCBUILTIN PF_getentity(pubprogfuncs_t *prinst, struct globalvars_s * if (entnum >= cl.maxlerpents || !cl.lerpentssequence || cl.lerpents[entnum].sequence != cl.lerpentssequence) { - Con_DPrintf("PF_getentity: entity %i is not valid\n", entnum); + if (fldnum != GE_ACTIVE) + Con_DPrintf("PF_getentity: entity %i is not valid\n", entnum); VectorCopy(vec3_origin, G_VECTOR(OFS_RETURN)); return; } diff --git a/engine/client/sys_win.c b/engine/client/sys_win.c index 29c305346..a410da2b1 100644 --- a/engine/client/sys_win.c +++ b/engine/client/sys_win.c @@ -740,8 +740,8 @@ DWORD CrashExceptionHandler (qboolean iswatchdog, DWORD exceptionCode, LPEXCEPTI } else { - if (MessageBoxA(NULL, "KABOOM! We crashed!\nBlame the monkey in the corner.\nI hope you saved your work.\nWould you like to take a dump now?", DISTRIBUTION " Sucks", MB_ICONSTOP|MB_YESNO) != IDYES) - return EXCEPTION_EXECUTE_HANDLER; + MessageBoxA(NULL, "We crashed.\nUnable to load dbghelp library. Stack info is not available", DISTRIBUTION " Sucks", MB_ICONSTOP); + return EXCEPTION_EXECUTE_HANDLER; } } diff --git a/engine/gl/gl_bloom.c b/engine/gl/gl_bloom.c index 33bc6756a..a6722432f 100644 --- a/engine/gl/gl_bloom.c +++ b/engine/gl/gl_bloom.c @@ -60,7 +60,22 @@ static int scrwidth, scrheight; static int texwidth[MAXLEVELS], texheight[MAXLEVELS]; +static void R_InitBloomTextures(void) +{ + int i; + bloomfilter = NULL; + bloomblur = NULL; + bloomfinal = NULL; + scrwidth = 0, scrheight = 0; + + scrtex = r_nulltex; + for (i = 0; i < MAXLEVELS; i++) + { + pingtex[0][i] = r_nulltex; + pingtex[1][i] = r_nulltex; + } +} void R_BloomRegister(void) { Cvar_Register (&r_bloom, "bloom"); @@ -244,16 +259,11 @@ void R_BloomBlend (void) GLBE_FBO_Sources(scrtex, r_nulltex); R2D_ScalePic(r_refdef.vrect.x, r_refdef.vrect.y + r_refdef.vrect.height, r_refdef.vrect.width, -r_refdef.vrect.height, bloomfinal); } -void R_InitBloomTextures(void) +void R_BloomShutdown(void) { - bloomfilter = NULL; - bloomblur = NULL; - bloomfinal = NULL; - scrwidth = 0, scrheight = 0; - - if (!gl_config.ext_framebuffer_objects) - return; + GLBE_FBO_Destroy(&fbo_bloom); + R_InitBloomTextures(); } #elif defined(GLQUAKE) diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index aaede77c0..e5c190037 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -129,6 +129,7 @@ void GL_InitSceneProcessingShaders_WaterWarp (void) void GL_ShutdownPostProcessing(void) { GLBE_FBO_Destroy(&fbo_gameview); + R_BloomShutdown(); } void GL_InitSceneProcessingShaders (void) @@ -387,7 +388,7 @@ void R_SetupGL (float stereooffset) // // set up viewpoint // - if (r_refdef.rt_destcolour) + if (*r_refdef.rt_destcolour[0].texname) { //with fbo rendering, we disable all virtual scaling. x = r_refdef.vrect.x; diff --git a/engine/gl/gl_rmisc.c b/engine/gl/gl_rmisc.c index 4671e101e..254fb05dd 100644 --- a/engine/gl/gl_rmisc.c +++ b/engine/gl/gl_rmisc.c @@ -244,8 +244,6 @@ R_Init void GLR_ReInit (void) { R_NetgraphInit(); - - R_InitBloomTextures(); } #if 1 diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index 7801c973d..3470eac01 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -421,7 +421,7 @@ void D3_GenerateAreas(model_t *mod); #ifdef GLQUAKE void R_BloomRegister(void); void R_BloomBlend(void); -void R_InitBloomTextures(void); +void R_BloomShutdown(void); #endif //