Changed: only check screenshot folder presence one time
This commit is contained in:
parent
2a91013055
commit
4441f54bba
3 changed files with 9 additions and 3 deletions
|
@ -595,12 +595,16 @@ void displayScreenShotSavedInfo(const string &filename)
|
|||
pIM->displaySystemInfo(msg);
|
||||
}
|
||||
|
||||
void initScreenshot()
|
||||
{
|
||||
if (!CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
|
||||
}
|
||||
|
||||
void screenShotTGA()
|
||||
{
|
||||
CBitmap btm;
|
||||
getBuffer (btm);
|
||||
|
||||
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
|
||||
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.tga");
|
||||
COFile fs(filename);
|
||||
btm.writeTGA(fs, 24, false);
|
||||
|
@ -613,7 +617,6 @@ void screenShotPNG()
|
|||
CBitmap btm;
|
||||
getBuffer (btm);
|
||||
|
||||
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
|
||||
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.png");
|
||||
COFile fs(filename);
|
||||
if (!btm.writePNG(fs, 24))
|
||||
|
@ -634,7 +637,6 @@ void screenShotJPG()
|
|||
CBitmap btm;
|
||||
getBuffer (btm);
|
||||
|
||||
if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
|
||||
string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.jpg");
|
||||
COFile fs(filename);
|
||||
btm.writeJPG(fs);
|
||||
|
|
|
@ -174,6 +174,7 @@ public:
|
|||
/** Capture current content of framebuffer and save the result. If a custom size is asked in ClientCfg, then the scene is rendered again
|
||||
* instead (possibly multiple time)
|
||||
*/
|
||||
void initScreenshot();
|
||||
void screenShotTGA();
|
||||
void screenShotPNG();
|
||||
void screenShotJPG();
|
||||
|
|
|
@ -1443,6 +1443,9 @@ bool mainLoop()
|
|||
// initialize the structure for the ping.
|
||||
Ping.init();
|
||||
|
||||
// initialize screenshots directory
|
||||
initScreenshot();
|
||||
|
||||
// Call a function for a demo to init.
|
||||
|
||||
if (ClientCfg.Local)
|
||||
|
|
Loading…
Reference in a new issue