mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-02 19:00:58 +00:00
gl_screen.c:
- Cleanup for the screenshot code.. (Now requires OpenGL 1.2+) gl_rsurf.c: - Oh Mr Havoc, *WHACK*, you needed to disable GL_BLEND when you switch to GL_REPLACE..
This commit is contained in:
parent
298f23f2c7
commit
46855eff2d
2 changed files with 3 additions and 15 deletions
|
@ -58,10 +58,6 @@
|
||||||
extern double realtime;
|
extern double realtime;
|
||||||
int skytexturenum;
|
int skytexturenum;
|
||||||
|
|
||||||
#ifndef GL_RGBA4
|
|
||||||
#define GL_RGBA4 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern vec3_t shadecolor; // Ender (Extend) Colormod
|
extern vec3_t shadecolor; // Ender (Extend) Colormod
|
||||||
int lightmap_bytes; // 1 or 3
|
int lightmap_bytes; // 1 or 3
|
||||||
|
|
||||||
|
@ -952,6 +948,7 @@ void R_DrawWorld (void)
|
||||||
R_DrawSky ();
|
R_DrawSky ();
|
||||||
|
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
R_RecursiveWorldNode (cl.worldmodel->nodes);
|
R_RecursiveWorldNode (cl.worldmodel->nodes);
|
||||||
|
|
||||||
|
|
|
@ -670,7 +670,7 @@ void SCR_ScreenShot_f (void)
|
||||||
byte *buffer;
|
byte *buffer;
|
||||||
char pcxname[80];
|
char pcxname[80];
|
||||||
char checkname[MAX_OSPATH];
|
char checkname[MAX_OSPATH];
|
||||||
int i, c, temp;
|
int i;
|
||||||
//
|
//
|
||||||
// find a file name to save it to
|
// find a file name to save it to
|
||||||
//
|
//
|
||||||
|
@ -701,16 +701,7 @@ void SCR_ScreenShot_f (void)
|
||||||
buffer[15] = glheight>>8;
|
buffer[15] = glheight>>8;
|
||||||
buffer[16] = 24; // pixel size
|
buffer[16] = 24; // pixel size
|
||||||
|
|
||||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
|
glReadPixels (glx, gly, glwidth, glheight, GL_BGR, GL_UNSIGNED_BYTE, buffer+18 );
|
||||||
|
|
||||||
// swap rgb to bgr
|
|
||||||
c = 18+glwidth*glheight*3;
|
|
||||||
for (i=18 ; i<c ; i+=3)
|
|
||||||
{
|
|
||||||
temp = buffer[i];
|
|
||||||
buffer[i] = buffer[i+2];
|
|
||||||
buffer[i+2] = temp;
|
|
||||||
}
|
|
||||||
COM_WriteFile (pcxname, buffer, glwidth*glheight*3 + 18 );
|
COM_WriteFile (pcxname, buffer, glwidth*glheight*3 + 18 );
|
||||||
|
|
||||||
free (buffer);
|
free (buffer);
|
||||||
|
|
Loading…
Reference in a new issue