From 4441f54bbaee9d0e4e2613249a1a008a333b6079 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:47:38 +0200 Subject: [PATCH] Changed: only check screenshot folder presence one time --- .../ryzom/client/src/interface_v3/action_handler_misc.cpp | 8 +++++--- code/ryzom/client/src/interface_v3/action_handler_misc.h | 1 + code/ryzom/client/src/main_loop.cpp | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 9a4f5f232..565165987 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -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); diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.h b/code/ryzom/client/src/interface_v3/action_handler_misc.h index 39e9c9eb0..5e9328832 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.h +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.h @@ -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(); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 430c0a81c..d995c0ed8 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -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)