mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
Add FILESYSTEM_loadAssetToMemory()
This is currently just a wrapper around FILESYSTEM_loadFileToMemory(), but assets are supposed to use this function instead of the regular one.
This commit is contained in:
parent
aea5611e5b
commit
72ae6921ea
2 changed files with 19 additions and 0 deletions
|
@ -441,6 +441,19 @@ void FILESYSTEM_loadFileToMemory(
|
||||||
PHYSFS_close(handle);
|
PHYSFS_close(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FILESYSTEM_loadAssetToMemory(
|
||||||
|
const char* name,
|
||||||
|
unsigned char** mem,
|
||||||
|
size_t* len,
|
||||||
|
const bool addnull
|
||||||
|
) {
|
||||||
|
const char* path;
|
||||||
|
|
||||||
|
path = name;
|
||||||
|
|
||||||
|
FILESYSTEM_loadFileToMemory(path, mem, len, addnull);
|
||||||
|
}
|
||||||
|
|
||||||
void FILESYSTEM_freeMemory(unsigned char **mem)
|
void FILESYSTEM_freeMemory(unsigned char **mem)
|
||||||
{
|
{
|
||||||
SDL_free(*mem);
|
SDL_free(*mem);
|
||||||
|
|
|
@ -22,6 +22,12 @@ bool FILESYSTEM_isAssetMounted(const char* filename);
|
||||||
|
|
||||||
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
|
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
|
||||||
size_t *len, bool addnull);
|
size_t *len, bool addnull);
|
||||||
|
void FILESYSTEM_loadAssetToMemory(
|
||||||
|
const char* name,
|
||||||
|
unsigned char** mem,
|
||||||
|
size_t* len,
|
||||||
|
const bool addnull
|
||||||
|
);
|
||||||
void FILESYSTEM_freeMemory(unsigned char **mem);
|
void FILESYSTEM_freeMemory(unsigned char **mem);
|
||||||
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
||||||
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
||||||
|
|
Loading…
Reference in a new issue