2011-09-27 21:52:55 +02:00
|
|
|
|
|
|
|
#include <dirent.h>
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include "video.h"
|
|
|
|
#include "Tools/save.h"
|
|
|
|
|
|
|
|
void Screenshot()
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
bool stop = false;
|
|
|
|
char temp[100];
|
|
|
|
|
|
|
|
DIR *pDir;
|
|
|
|
bool Exists = false;
|
|
|
|
|
|
|
|
folder_exists();
|
2012-03-04 21:01:11 +01:00
|
|
|
pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str());
|
2011-09-27 21:52:55 +02:00
|
|
|
|
|
|
|
if(pDir != NULL)
|
|
|
|
{
|
|
|
|
Exists = true;
|
|
|
|
closedir (pDir);
|
|
|
|
}
|
|
|
|
else
|
2012-03-04 21:01:11 +01:00
|
|
|
if(mkdir((Settings.device_dat + ":/config/HBF/Screenshots").c_str(), 777) != -1)
|
2011-09-27 21:52:55 +02:00
|
|
|
Exists = true;
|
|
|
|
|
|
|
|
if(Exists)
|
|
|
|
{
|
|
|
|
while(!stop)
|
|
|
|
{
|
2012-03-04 21:01:11 +01:00
|
|
|
sprintf (temp, "%s/%i.png", check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str(), i);
|
2011-09-27 21:52:55 +02:00
|
|
|
FILE * f= fopen (temp,"r");
|
|
|
|
if (!f)
|
|
|
|
stop = true;
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
|
|
|
|
fclose(f); // dann ging's. Also wieder zu damit
|
|
|
|
}
|
|
|
|
|
|
|
|
TakeScreenshot(temp);
|
|
|
|
}
|
2011-09-25 19:47:02 +02:00
|
|
|
}
|