Fix some bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4718 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-08-10 00:31:37 +00:00
parent 1f9daedabe
commit 6066fdf421
6 changed files with 25 additions and 15 deletions

View file

@ -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) 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)); VectorCopy(vec3_origin, G_VECTOR(OFS_RETURN));
return; return;
} }

View file

@ -740,8 +740,8 @@ DWORD CrashExceptionHandler (qboolean iswatchdog, DWORD exceptionCode, LPEXCEPTI
} }
else 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) MessageBoxA(NULL, "We crashed.\nUnable to load dbghelp library. Stack info is not available", DISTRIBUTION " Sucks", MB_ICONSTOP);
return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_EXECUTE_HANDLER;
} }
} }

View file

@ -60,7 +60,22 @@ static int scrwidth, scrheight;
static int texwidth[MAXLEVELS], texheight[MAXLEVELS]; 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) void R_BloomRegister(void)
{ {
Cvar_Register (&r_bloom, "bloom"); Cvar_Register (&r_bloom, "bloom");
@ -244,16 +259,11 @@ void R_BloomBlend (void)
GLBE_FBO_Sources(scrtex, r_nulltex); 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); 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; GLBE_FBO_Destroy(&fbo_bloom);
bloomblur = NULL;
bloomfinal = NULL;
scrwidth = 0, scrheight = 0;
if (!gl_config.ext_framebuffer_objects)
return;
R_InitBloomTextures();
} }
#elif defined(GLQUAKE) #elif defined(GLQUAKE)

View file

@ -129,6 +129,7 @@ void GL_InitSceneProcessingShaders_WaterWarp (void)
void GL_ShutdownPostProcessing(void) void GL_ShutdownPostProcessing(void)
{ {
GLBE_FBO_Destroy(&fbo_gameview); GLBE_FBO_Destroy(&fbo_gameview);
R_BloomShutdown();
} }
void GL_InitSceneProcessingShaders (void) void GL_InitSceneProcessingShaders (void)
@ -387,7 +388,7 @@ void R_SetupGL (float stereooffset)
// //
// set up viewpoint // set up viewpoint
// //
if (r_refdef.rt_destcolour) if (*r_refdef.rt_destcolour[0].texname)
{ {
//with fbo rendering, we disable all virtual scaling. //with fbo rendering, we disable all virtual scaling.
x = r_refdef.vrect.x; x = r_refdef.vrect.x;

View file

@ -244,8 +244,6 @@ R_Init
void GLR_ReInit (void) void GLR_ReInit (void)
{ {
R_NetgraphInit(); R_NetgraphInit();
R_InitBloomTextures();
} }
#if 1 #if 1

View file

@ -421,7 +421,7 @@ void D3_GenerateAreas(model_t *mod);
#ifdef GLQUAKE #ifdef GLQUAKE
void R_BloomRegister(void); void R_BloomRegister(void);
void R_BloomBlend(void); void R_BloomBlend(void);
void R_InitBloomTextures(void); void R_BloomShutdown(void);
#endif #endif
// //