fix memory alignment issue when saving odd-width screenshots (set GL_PACK_ALIGNMENT...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 3 Aug 2006 15:25:42 +0000 (15:25 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 3 Aug 2006 15:25:42 +0000 (15:25 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6541 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c
glquake.h

index 97e0aa9..e473f6f 100644 (file)
@@ -452,6 +452,7 @@ static void r_textures_start(void)
        // LordHavoc: allow any alignment
        CHECKGLERROR
        qglPixelStorei(GL_UNPACK_ALIGNMENT, 1);CHECKGLERROR
+       qglPixelStorei(GL_PACK_ALIGNMENT, 1);CHECKGLERROR
 
        texturemempool = Mem_AllocPool("texture management", 0, NULL);
 
index 5cc8935..af5d77a 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -110,6 +110,7 @@ typedef double GLclampd;
 #define GL_TEXTURE_BORDER_COLOR                        0x1004
 #define GL_TEXTURE_MAG_FILTER                  0x2800
 #define GL_TEXTURE_MIN_FILTER                  0x2801
+#define GL_PACK_ALIGNMENT                      0x0D05
 #define GL_UNPACK_ALIGNMENT                    0x0CF5
 #define GL_TEXTURE_BINDING_1D                   0x8068
 #define GL_TEXTURE_BINDING_2D                   0x8069