1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

Don't hardcode screenshot directory (still hardcodes filename)

Signed-off-by: Rob Crittenden <rcrit@greyoak.com>
This commit is contained in:
Rob Crittenden 2016-05-19 11:10:50 -04:00 committed by Rob Crittenden
parent 11365a3c73
commit a1072de670

View File

@ -794,9 +794,18 @@ void RWGame::globalKeyEvent(const sf::Event& event)
case sf::Keyboard::F3:
showDebugPhysics = ! showDebugPhysics;
break;
case sf::Keyboard::F12:
window.capture().saveToFile("/home/dan/screenshot.png");
case sf::Keyboard::F12: {
auto homedir = getenv("HOME");
if( homedir == nullptr ) {
std::cerr << "Unable to determine home directory for screenshot" << std::endl;
break;
}
std::string savePath(homedir);
std::string path = savePath+"/screenshot.png";
window.capture().saveToFile(path);
break;
}
default: break;
}
}