Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-02-15 19:12:06 +0000
committerStijn Buys <ingar@osirion.org>2010-02-15 19:12:06 +0000
commit9b0f64f2fdfa1801a39bfae61dad4e11a8f0bc59 (patch)
tree2bb9b7e9c23901cfe176c66dc223141c43a8f366 /src/render
parent9ce5ea1d2235cf2849acfe02b370cf1c65f8f458 (diff)
Make screenshots work again
Diffstat (limited to 'src/render')
-rw-r--r--src/render/screenshot.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/render/screenshot.cc b/src/render/screenshot.cc
index adab01b..45e2299 100644
--- a/src/render/screenshot.cc
+++ b/src/render/screenshot.cc
@@ -29,7 +29,6 @@ int Screenshot::current_date = 0;
void Screenshot::save()
{
- bool available = false;
std::string filename;
const int TYPETGA = 0;
const int TYPEPNG = 1;
@@ -79,6 +78,7 @@ void Screenshot::save()
current_date = date_serial;
}
+ bool available = false;
do {
std::stringstream filenamestr;
// screenshots directory
@@ -93,7 +93,8 @@ void Screenshot::save()
filenamestr << "." << screenshotformat->str();
// try to open the file
- FILE *handle = fopen(filenamestr.str().c_str(), "r");
+ filename.assign(filenamestr.str().c_str());
+ FILE *handle = fopen(filename.c_str(), "r");
if (handle) {
fclose(handle);
} else {
@@ -110,15 +111,8 @@ void Screenshot::save()
image.flip();
if (filetype == TYPEPNG) {
- /* if ((Camera::width() % 8 != 0 ) || (Camera::height() % 8 != 0 )) {
- image.pad();
- }*/
- render::PNG::save(filename.c_str(), image);
+ render::PNG::save(filenamestr.str().c_str(), image);
} else if (filetype == TYPEJPG) {
- /* if ((Camera::width() % 8 != 0 ) || (Camera::height() % 8 != 0 )) {
- image.pad();
- }
- */
render::JPG::save(filename.c_str(), image, (int) screenshotquality->value());
} else if (filetype == TYPETGA) {
render::TGA::save(filename.c_str(), image);