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:
parent
11365a3c73
commit
a1072de670
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user