mirror of
https://github.com/glest/glest-source.git
synced 2025-08-19 06:31:19 +02:00
- bugfix on windows for autoscreenshots in g3d viewer
This commit is contained in:
@@ -616,8 +616,7 @@ void MainWindow::onPaint(wxPaintEvent &event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderer->renderParticleManager();
|
renderer->renderParticleManager();
|
||||||
glCanvas->SwapBuffers();
|
|
||||||
|
|
||||||
bool haveLoadedParticles = (particleProjectilePathList.empty() == false || particleSplashPathList.empty() == false);
|
bool haveLoadedParticles = (particleProjectilePathList.empty() == false || particleSplashPathList.empty() == false);
|
||||||
|
|
||||||
if(autoScreenShotAndExit == true) {
|
if(autoScreenShotAndExit == true) {
|
||||||
@@ -629,7 +628,10 @@ void MainWindow::onPaint(wxPaintEvent &event) {
|
|||||||
Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if((modelPathList.empty() == false) && resetAnimation && haveLoadedParticles) {
|
|
||||||
|
glCanvas->SwapBuffers();
|
||||||
|
|
||||||
|
if((modelPathList.empty() == false) && resetAnimation && haveLoadedParticles) {
|
||||||
if(anim >= resetAnim && resetAnim > 0) {
|
if(anim >= resetAnim && resetAnim > 0) {
|
||||||
printf("RESETTING EVERYTHING [%f][%f]...\n",anim,resetAnim);
|
printf("RESETTING EVERYTHING [%f][%f]...\n",anim,resetAnim);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@@ -485,11 +485,12 @@ 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);
|
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);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
|
@@ -6395,7 +6395,7 @@ void Renderer::saveScreen(const string &path) {
|
|||||||
Pixmap2D *pixmapScreenShot = new Pixmap2D(sm.getScreenW(), sm.getScreenH(), 3);
|
Pixmap2D *pixmapScreenShot = new Pixmap2D(sm.getScreenW(), sm.getScreenH(), 3);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
glFinish();
|
//glFinish();
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user