mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
- allow screenshots to be taken ANY time (in menus etc.) and not only when a game is playing
This commit is contained in:
parent
77bad3ce07
commit
44563b6f73
@ -1193,28 +1193,6 @@ void Game::keyDown(char key) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(key == configKeys.getCharKey("Screenshot")) {
|
||||
string path = GameConstants::folder_path_screenshots;
|
||||
if(isdir(path.c_str()) == true) {
|
||||
Config &config= Config::getInstance();
|
||||
string fileFormat = config.getString("ScreenShotFileType","png");
|
||||
|
||||
unsigned int queueSize = Renderer::getInstance().getSaveScreenQueueSize();
|
||||
|
||||
for(int i=0; i < 250; ++i) {
|
||||
path = GameConstants::folder_path_screenshots;
|
||||
path += "screen" + intToStr(i + queueSize) + "." + fileFormat;
|
||||
FILE *f= fopen(path.c_str(), "rb");
|
||||
if(f == NULL) {
|
||||
Renderer::getInstance().saveScreen(path);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//move camera left
|
||||
else if(key == configKeys.getCharKey("CameraModeLeft")) {
|
||||
gameCamera.setMoveX(-1);
|
||||
|
@ -372,6 +372,28 @@ void MainWindow::eventKeyDown(char key){
|
||||
Config &config = Config::getInstance();
|
||||
config.reload();
|
||||
}
|
||||
else if(key == configKeys.getCharKey("Screenshot")) {
|
||||
string path = GameConstants::folder_path_screenshots;
|
||||
if(isdir(path.c_str()) == true) {
|
||||
Config &config= Config::getInstance();
|
||||
string fileFormat = config.getString("ScreenShotFileType","png");
|
||||
|
||||
unsigned int queueSize = Renderer::getInstance().getSaveScreenQueueSize();
|
||||
|
||||
for(int i=0; i < 250; ++i) {
|
||||
path = GameConstants::folder_path_screenshots;
|
||||
path += "screen" + intToStr(i + queueSize) + "." + fileFormat;
|
||||
FILE *f= fopen(path.c_str(), "rb");
|
||||
if(f == NULL) {
|
||||
Renderer::getInstance().saveScreen(path);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
Loading…
x
Reference in New Issue
Block a user