about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-06-27 13:12:00 +0200
committeroy <Tom_Adams@web.de>2010-06-27 13:12:00 +0200
commit29d29df4f043aecf7711e956da5076456241d68f (patch)
treebdf0fbcf42a5ca31a20347bfe55c1a56cd289a7c /src/engine/client
parent9130c918419fdc1e29d66e53cd21b34ed05eabc7 (diff)
downloadzcatch-29d29df4f043aecf7711e956da5076456241d68f.tar.gz
zcatch-29d29df4f043aecf7711e956da5076456241d68f.zip
fixed screenshot bug. Closes #144
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/graphics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp
index e2f4ae4c..bf3f42ea 100644
--- a/src/engine/client/graphics.cpp
+++ b/src/engine/client/graphics.cpp
@@ -422,7 +422,11 @@ void CGraphics_OpenGL::ScreenshotDirect(const char *pFilename)
 	int h = m_ScreenHeight;
 	unsigned char *pPixelData = (unsigned char *)mem_alloc(w*(h+1)*3, 1);
 	unsigned char *pTempRow = pPixelData+w*h*3;
+	GLint Alignment;
+	glGetIntegerv(GL_PACK_ALIGNMENT, &Alignment);
+	glPixelStorei(GL_PACK_ALIGNMENT, 1);
 	glReadPixels(0,0, w, h, GL_RGB, GL_UNSIGNED_BYTE, pPixelData);
+	glPixelStorei(GL_PACK_ALIGNMENT, Alignment);
 	
 	// flip the pixel because opengl works from bottom left corner
 	for(y = 0; y < h/2; y++)