gl_rmisc.c (R_Envmap_f): the envmap command can only be run when there's something

to render, ie. when connected to a server. besides, the refdef must be restored when
it is completed.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@68 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-02-20 00:05:14 +00:00
parent a3bae85fe6
commit 8e0638e867

View file

@ -120,7 +120,12 @@ Grab six views for environment mapping tests
void R_Envmap_f (void)
{
byte buffer[256*256*4];
refdef_t save_refdef;
if (cls.state != ca_connected)
return;
memcpy (&save_refdef, &r_refdef, sizeof(refdef_t));
glDrawBuffer (GL_FRONT);
glReadBuffer (GL_FRONT);
envmap = true;
@ -174,6 +179,9 @@ void R_Envmap_f (void)
glDrawBuffer (GL_BACK);
glReadBuffer (GL_BACK);
GL_EndRendering ();
memcpy (&r_refdef, &save_refdef, sizeof(refdef_t));
vid.recalc_refdef = 1;
}
/*