MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / iFileLoad

Function iFileLoad

src/SB/Core/gc/iFile.cpp:37–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37U32* iFileLoad(char* name, U32* buffer, U32* size)
38{
39 char path[128];
40 tag_xFile file;
41 S32 fileSize, alignedSize;
42
43 iFileFullPath(name, path);
44 iFileOpen(name, IFILE_OPEN_ABSPATH, &file);
45
46 fileSize = iFileGetSize(&file);
47
48 if (!buffer)
49 {
50 buffer = (U32*)OSAlloc(OSRoundUp32B(fileSize));
51 }
52
53 alignedSize = OSRoundUp32B(fileSize);
54
55 iFileRead(&file, buffer, alignedSize);
56
57 if (size)
58 {
59 *size = alignedSize;
60 }
61
62 iFileClose(&file);
63
64 return buffer;
65}
66
67U32 iFileOpen(const char* name, S32 flags, tag_xFile* file)
68{

Callers 2

iSG_load_icondataFunction · 0.70
zMainReadINIFunction · 0.50

Calls 5

iFileFullPathFunction · 0.70
iFileOpenFunction · 0.70
iFileGetSizeFunction · 0.70
iFileReadFunction · 0.70
iFileCloseFunction · 0.70

Tested by

no test coverage detected