- see if this fixes some peoples screenshot problems

This commit is contained in:
Mark Vejvoda 2011-04-18 20:20:16 +00:00
parent c4d32ae0d2
commit c366d108e8
1 changed files with 4 additions and 0 deletions

View File

@ -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));