mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 11:22: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:
|
case sf::Keyboard::F3:
|
||||||
showDebugPhysics = ! showDebugPhysics;
|
showDebugPhysics = ! showDebugPhysics;
|
||||||
break;
|
break;
|
||||||
case sf::Keyboard::F12:
|
case sf::Keyboard::F12: {
|
||||||
window.capture().saveToFile("/home/dan/screenshot.png");
|
auto homedir = getenv("HOME");
|
||||||
|
if( homedir == nullptr ) {
|
||||||
|
std::cerr << "Unable to determine home directory for screenshot" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string savePath(homedir);
|
||||||
|
std::string path = savePath+"/screenshot.png";
|
||||||
|
window.capture().saveToFile(path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user