about summary refs log tree commit diff
path: root/src/engine/client/graphics.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2010-07-05 20:46:32 +0200
committerMagnus Auvinen <magnus.auvinen@gmail.com>2010-07-05 20:46:32 +0200
commitd302ba921e61177da9af1f85df58fe6f47ca5e95 (patch)
tree4ac19b9caab0a7142b6dfbc05d234af152bd5407 /src/engine/client/graphics.cpp
parent143af11a25bc4a944c3605b9a165ffd2f1970641 (diff)
parentbd02c2043e9f76ec47ee9ac35caf23ae294b1dfa (diff)
downloadzcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.tar.gz
zcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.zip
Merge branch 'master' of github.com:matricks/teeworlds
Diffstat (limited to 'src/engine/client/graphics.cpp')
-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++)