Merge branch 'add-screenshot-dir-to-config' into 'main/gingo-test'

Add ScreenShotDirectory entry to client.cfg

See merge request ryzom/ryzom-core!16
merge-requests/19/merge
Nuno Gonçalves (Ulukyn) 3 years ago
commit b12c7ac25c

@ -413,6 +413,7 @@ CClientConfig::CClientConfig()
CameraRecorderPrefix = "cam_rec";
CameraRecorderBlend = true;
ScreenShotDirectory = "screenshots";
ScreenShotWidth = 0;
ScreenShotHeight = 0;
ScreenShotFullDetail = true;
@ -1142,6 +1143,7 @@ void CClientConfig::setValues()
READ_BOOL_FV(CameraRecorderBlend)
// Screenshot
READ_STRING_FV(ScreenShotDirectory)
READ_INT_FV(ScreenShotWidth)
READ_INT_FV(ScreenShotHeight)
READ_BOOL_FV(ScreenShotFullDetail)

@ -306,6 +306,7 @@ struct CClientConfig
bool CameraRecorderBlend;
/// Screen shot
string ScreenShotDirectory;
uint ScreenShotWidth; // If 0 : normal screen shot, else custom screen shot without interface
uint ScreenShotHeight;
bool ScreenShotFullDetail; // If set to true, then load balancing will be disabled for the duration of the screenshot

@ -62,9 +62,6 @@ extern NLMISC::CLog g_log;
////////////
//static CCDBNodeLeaf *MenuColorWidgetValue = NULL; // db entry for the color menu widget (Red)
static const string ScreenshotsDirectory("screenshots/"); // don't forget the final /
void preRenderNewSky ();
// ***************************************************************************
@ -602,11 +599,6 @@ void displayScreenShotSavedInfo(const string &filename)
pIM->displaySystemInfo(msg);
}
void initScreenshot()
{
if (!CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
}
bool screenshotZBuffer(const std::string &filename)
{
std::string::size_type pos = filename.find(".");
@ -672,6 +664,11 @@ bool screenshotZBuffer(const std::string &filename)
static std::string findNewScreenShotFileName(std::string filename)
{
// make screenshot directory if it does not exist
if (!CFile::isExists(ClientCfg.ScreenShotDirectory))
CFile::createDirectory(ClientCfg.ScreenShotDirectory);
filename = CPath::standardizePath(ClientCfg.ScreenShotDirectory) + filename;
static char cstime[25];
time_t dtime;
time(&dtime);
@ -698,7 +695,7 @@ void screenShotTGA()
CBitmap btm;
getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.tga");
string filename = findNewScreenShotFileName("screenshot.tga");
COFile fs(filename);
if (!btm.writeTGA(fs, 24, false))
@ -720,7 +717,7 @@ void screenShotPNG()
CBitmap btm;
getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.png");
string filename = findNewScreenShotFileName("screenshot.png");
COFile fs(filename);
if (!btm.writePNG(fs, 24))
@ -742,7 +739,7 @@ void screenShotJPG()
CBitmap btm;
getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.jpg");
string filename = findNewScreenShotFileName("screenshot.jpg");
COFile fs(filename);
if (!btm.writeJPG(fs))

@ -181,7 +181,6 @@ 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();

@ -1000,9 +1000,6 @@ 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…
Cancel
Save