mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 09:24:24 +02:00
- added ability to specify scaled image size of screenshots in g3d viewer example:
./megaglest_g3dviewer --load-unit=techs/megapack/factions/romans/units/catapult,attack_skill --auto-screenshot=resize-1024x768
This commit is contained in:
@@ -483,7 +483,7 @@ void Renderer::setAlphaColor(float alpha) {
|
||||
//printf("#3.1 The framebuffer uses %d bit(s) per the alpha component\n", alpha_bits);
|
||||
}
|
||||
|
||||
void Renderer::saveScreen(const string &path) {
|
||||
void Renderer::saveScreen(const string &path,std::pair<int,int> *overrideSize) {
|
||||
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
|
||||
//glFinish();
|
||||
|
||||
@@ -494,6 +494,10 @@ void Renderer::saveScreen(const string &path) {
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if(overrideSize != NULL && overrideSize->first > 0 && overrideSize->second > 0) {
|
||||
pixmapScreenShot->Scale(GL_RGBA,overrideSize->first,overrideSize->second);
|
||||
}
|
||||
|
||||
pixmapScreenShot->save(path);
|
||||
delete pixmapScreenShot;
|
||||
}
|
||||
|
Reference in New Issue
Block a user