mirror of
https://github.com/dborth/fceugx.git
synced 2025-01-05 21:38:17 +01:00
filetime correction
This commit is contained in:
parent
47c65f5ebe
commit
08a18edb32
@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wiiuse/wpad.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HW_RVL
|
||||
#include <di/di.h>
|
||||
@ -1445,10 +1446,14 @@ static int MenuGameSaves(int action)
|
||||
{
|
||||
int menu = MENU_NONE;
|
||||
int ret;
|
||||
int i, len, len2;
|
||||
int i, n, len, len2;
|
||||
int j = 0;
|
||||
SaveList saves;
|
||||
char filepath[1024];
|
||||
char scrfile[1024];
|
||||
char tmp[256];
|
||||
struct stat filestat;
|
||||
struct tm * timeinfo;
|
||||
int method = GCSettings.SaveMethod;
|
||||
|
||||
if(method == METHOD_AUTO)
|
||||
@ -1552,8 +1557,6 @@ static int MenuGameSaves(int action)
|
||||
|
||||
if(saves.type[j] != -1)
|
||||
{
|
||||
int n = -1;
|
||||
char tmp[256];
|
||||
strncpy(tmp, browserList[i].filename, 255);
|
||||
tmp[len2-4] = 0;
|
||||
|
||||
@ -1561,6 +1564,8 @@ static int MenuGameSaves(int action)
|
||||
n = atoi(&tmp[len2-5]);
|
||||
else if(len2 - len == 6)
|
||||
n = atoi(&tmp[len2-6]);
|
||||
else
|
||||
n = -1;
|
||||
|
||||
if(n > 0 && n < MAX_SAVES)
|
||||
saves.files[saves.type[j]][n] = 1;
|
||||
@ -1571,7 +1576,6 @@ static int MenuGameSaves(int action)
|
||||
{
|
||||
if(saves.type[j] == FILE_STATE)
|
||||
{
|
||||
char scrfile[1024];
|
||||
sprintf(scrfile, "%s/%s.png", GCSettings.SaveFolder, tmp);
|
||||
|
||||
AllocSaveBuffer();
|
||||
@ -1579,9 +1583,13 @@ static int MenuGameSaves(int action)
|
||||
saves.previewImg[j] = new GuiImageData(savebuffer);
|
||||
FreeSaveBuffer();
|
||||
}
|
||||
struct tm * timeinfo = localtime(&browserList[j].mtime);
|
||||
strftime(saves.date[j], 20, "%a %b %d", timeinfo);
|
||||
strftime(saves.time[j], 10, "%I:%M %p", timeinfo);
|
||||
snprintf(filepath, 1024, "%s%s/%s", rootdir, GCSettings.SaveFolder, saves.filename[j]);
|
||||
if (stat(filepath, &filestat) == 0)
|
||||
{
|
||||
timeinfo = localtime(&filestat.st_mtime);
|
||||
strftime(saves.date[j], 20, "%a %b %d", timeinfo);
|
||||
strftime(saves.time[j], 10, "%I:%M %p", timeinfo);
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user