Permalink
Browse files

create the screenshots directory before trying to write the screenshot

  • Loading branch information...
1 parent 4f46d05 commit 2e688f328c290a1a1329eeb31243b108534f8690 @johnbartholomew johnbartholomew committed Feb 18, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/utils.cpp
View
@@ -152,7 +152,9 @@ std::string format_distance(double dist)
void Screendump(const char* destFile, const int width, const int height)
{
- std::string fname = FileSystem::JoinPath(FileSystem::GetUserDir("screenshots"), destFile);
+ std::string dir = FileSystem::GetUserDir("screenshots");
+ FileSystem::rawFileSystem.MakeDirectory(dir);
+ std::string fname = FileSystem::JoinPath(dir, destFile);
// pad rows to 4 bytes, which is the default row alignment for OpenGL
const int stride = (3*width + 3) & ~3;

0 comments on commit 2e688f3

Please sign in to comment.