Skip to content

Commit

Permalink
Refactor|Client: Use de::String to compose screenshot save path
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jun 17, 2014
1 parent 8466194 commit 9f42ace
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions doomsday/client/src/m_misc.cpp
Expand Up @@ -395,21 +395,15 @@ void M_WriteTextEsc(FILE* file, const char* text)
DENG_EXTERN_C int M_ScreenShot(char const *name, int bits)
{
#ifdef __CLIENT__
DENG_UNUSED(bits);
DENG2_UNUSED(bits);

ddstring_t fullName; Str_Init(&fullName);
Str_Set(&fullName, name);

if(!_api_F.FindFileExtension(name))
de::String fullName(name);
if(de::String(name).fileNameExtension().isEmpty())
{
Str_Append(&fullName, ".png"); // Default format.
fullName += ".png"; // Default format.
}
F_ToNativeSlashes(&fullName, &fullName);

bool result = ClientWindow::main().grabToFile(Str_Text(&fullName));
Str_Free(&fullName);

return result? 1 : 0;
return ClientWindow::main().grabToFile(fullName)? 1 : 0;
#else
DENG2_UNUSED2(name, bits);
return false;
Expand Down

0 comments on commit 9f42ace

Please sign in to comment.