mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-01 19:00:34 +02:00
PSV collect files list for fast content access
This commit is contained in:
@@ -1,19 +1,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
#include "debugScreen.h"
|
#include "debugScreen.h"
|
||||||
|
#include <vitasdk.h>
|
||||||
#include <psp2/rtc.h>
|
|
||||||
#include <psp2/ctrl.h>
|
|
||||||
#include <psp2/audioout.h>
|
|
||||||
#include <psp2/kernel/sysmem.h>
|
|
||||||
#include <psp2/kernel/threadmgr.h>
|
|
||||||
#include <psp2/power.h>
|
|
||||||
#include <psp2/touch.h>
|
|
||||||
#include <psp2/apputil.h>
|
|
||||||
#include <psp2/system_param.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
@@ -250,6 +241,8 @@ int main()
|
|||||||
strcpy(saveDir, "ux0:data/OpenLara/");
|
strcpy(saveDir, "ux0:data/OpenLara/");
|
||||||
strcpy(contentDir, "ux0:data/OpenLara/");
|
strcpy(contentDir, "ux0:data/OpenLara/");
|
||||||
|
|
||||||
|
Stream::init();
|
||||||
|
|
||||||
Core::defLang = checkLanguage();
|
Core::defLang = checkLanguage();
|
||||||
|
|
||||||
sndInit();
|
sndInit();
|
||||||
|
32
src/utils.h
32
src/utils.h
@@ -1938,7 +1938,7 @@ public:
|
|||||||
if (f) fclose(f);
|
if (f) fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _OS_3DS
|
#if _OS_3DS
|
||||||
static void readDirectory(const FS_Archive &archive, const char* path) {
|
static void readDirectory(const FS_Archive &archive, const char* path) {
|
||||||
char buf[255];
|
char buf[255];
|
||||||
strcpy(buf, contentDir + 5); // 5 to skip "sdmc:"
|
strcpy(buf, contentDir + 5); // 5 to skip "sdmc:"
|
||||||
@@ -1990,6 +1990,36 @@ public:
|
|||||||
|
|
||||||
FSUSER_CloseArchive(sdmc);
|
FSUSER_CloseArchive(sdmc);
|
||||||
}
|
}
|
||||||
|
#elif _OS_PSV
|
||||||
|
static void readDirectory(char* path) {
|
||||||
|
SceUID dd = sceIoDopen(path);
|
||||||
|
|
||||||
|
size_t len = strlen(path);
|
||||||
|
|
||||||
|
SceIoDirent entry;
|
||||||
|
while (sceIoDread(dd, &entry) > 0)
|
||||||
|
{
|
||||||
|
strcat(path, entry.d_name);
|
||||||
|
|
||||||
|
if (SCE_S_ISDIR(entry.d_stat.st_mode))
|
||||||
|
{
|
||||||
|
strcat(path, "/");
|
||||||
|
readDirectory(path);
|
||||||
|
} else {
|
||||||
|
fileList.push(StrUtils::copy(path + strlen(contentDir)));
|
||||||
|
}
|
||||||
|
|
||||||
|
path[len] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sceIoClose(dd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void readFileList() {
|
||||||
|
char path[255];
|
||||||
|
strcpy(path, contentDir);
|
||||||
|
readDirectory(path);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static void readFileList() {};
|
static void readFileList() {};
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user