From b6ad2223d207cbddfd6e1232de202c187994d173 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 22 Oct 2001 19:46:34 +0000 Subject: [PATCH] attempt to handle the byte swapping of screenshots seen on voodoo2s in windows --- include/QF/GL/qf_funcs_list.h | 2 +- libs/video/targets/vid_common_gl.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/QF/GL/qf_funcs_list.h b/include/QF/GL/qf_funcs_list.h index 0d7be521e..f82e32a34 100644 --- a/include/QF/GL/qf_funcs_list.h +++ b/include/QF/GL/qf_funcs_list.h @@ -264,7 +264,7 @@ QFGL_DONT_NEED (void, glPixelMapfv, (GLenum map, GLint mapsize, const GLfloat * QFGL_DONT_NEED (void, glPixelMapuiv, (GLenum map, GLint mapsize, const GLuint * values)); QFGL_DONT_NEED (void, glPixelMapusv, (GLenum map, GLint mapsize, const GLushort * values)); QFGL_DONT_NEED (void, glPixelStoref, (GLenum pname, GLfloat param)); -QFGL_DONT_NEED (void, glPixelStorei, (GLenum pname, GLint param)); +QFGL_NEED (void, glPixelStorei, (GLenum pname, GLint param)); QFGL_DONT_NEED (void, glPixelTransferf, (GLenum pname, GLfloat param)); QFGL_DONT_NEED (void, glPixelTransferi, (GLenum pname, GLint param)); QFGL_DONT_NEED (void, glPixelZoom, (GLfloat xfactor, GLfloat yfactor)); diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index e2538a841..7c7595e4d 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -83,6 +83,7 @@ QF_glColorTableEXT qglColorTableEXT = NULL; qboolean is8bit = false; cvar_t *gl_multitexture; +cvar_t *gl_screenshot_byte_swap; cvar_t *vid_mode; cvar_t *vid_use8bit; @@ -97,6 +98,12 @@ gl_multitexture_f (cvar_t *var) gl_mtex_active = gl_mtex_capable && var->int_val; } +static void +gl_screenshot_byte_swap_f (cvar_t *var) +{ + qfglPixelStorei (GL_PACK_SWAP_BYTES, var->int_val ? GL_TRUE : GL_FALSE); +} + void GL_Common_Init_Cvars (void) { @@ -105,6 +112,11 @@ GL_Common_Init_Cvars (void) gl_multitexture = Cvar_Get ("gl_multitexture", "0", CVAR_ARCHIVE, gl_multitexture_f, "Use multitexture when " "available"); + gl_screenshot_byte_swap = + Cvar_Get ("gl_screenshot_byte_swap", "0", + CVAR_NONE, gl_screenshot_byte_swap_f, + "Swap the bytes for gl screenshots. Needed if you get " + "screenshots with red and blue swapped."); } /*