mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 16:02:50 +02:00
- bugfix for corrupted screenshots in g3d viewer reported by tomreyn
This commit is contained in:
@@ -473,8 +473,13 @@ void Renderer::setAlphaColor(float alpha) {
|
|||||||
void Renderer::saveScreen(const string &path) {
|
void Renderer::saveScreen(const string &path) {
|
||||||
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
|
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
|
||||||
glFinish();
|
glFinish();
|
||||||
|
|
||||||
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
|
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
|
||||||
|
|
||||||
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
pixmapScreenShot->save(path);
|
pixmapScreenShot->save(path);
|
||||||
delete pixmapScreenShot;
|
delete pixmapScreenShot;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user