From c366d108e8c08f76e15e5f809bfe0431a419eb7f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 18 Apr 2011 20:20:16 +0000 Subject: [PATCH] - see if this fixes some peoples screenshot problems --- source/glest_game/graphics/renderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index cc2a2b11..3f001ea1 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -4030,12 +4030,16 @@ void Renderer::saveScreen(const string &path) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); glFinish(); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(), GL_RGB, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels()); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + // Signal the threads queue to add a screenshot save request MutexSafeWrapper safeMutex(&saveScreenShotThreadAccessor,string(__FILE__) + "_" + intToStr(__LINE__)); saveScreenQueue.push_back(make_pair(path,pixmapScreenShot));