mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-29 17:57:23 +02:00
c1572de9e2
So, 2.3 added recoloring one-way tiles to no longer make them be always yellow. However, custom levels that retexture the one-way tiles might not want them to be recolored. So, if there are ANY custom assets mounted, then the one-ways will not be recolored. However, if the XML has a <onewaycol_override>1</onewaycol_override> tag, then the one-way will be recolored again anyways. When I added one-way recoloring, I didn't intend for any custom asset to disable the recoloring; I only did it because I couldn't find a way to check if a specific file was customized by the custom level or not. However, I have figured out how to do so, and so now tiles.png one-way recolors will only be disabled if there's a custom tiles.png, and tiles2.png one-way recolors will only be disabled if there's a custom tiles2.png. In order to make sure we're not calling PhysFS functions on every single deltaframe, I've added caching variables, tiles1_mounted and tiles2_mounted, to Graphics; these get assigned every time reloadresources() is called.
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
#ifndef FILESYSTEMUTILS_H
|
|
#define FILESYSTEMUTILS_H
|
|
|
|
#include <stddef.h>
|
|
|
|
// Forward declaration, including the entirety of tinyxml2.h across all files this file is included in is unnecessary
|
|
namespace tinyxml2 { class XMLDocument; }
|
|
|
|
int FILESYSTEM_init(char *argvZero, char* baseDir, char* assetsPath);
|
|
void FILESYSTEM_deinit(void);
|
|
|
|
char *FILESYSTEM_getUserSaveDirectory(void);
|
|
char *FILESYSTEM_getUserLevelDirectory(void);
|
|
|
|
bool FILESYSTEM_isFile(const char* filename);
|
|
bool FILESYSTEM_isMounted(const char* filename);
|
|
|
|
void FILESYSTEM_mount(const char *fname);
|
|
void FILESYSTEM_loadZip(const char* filename);
|
|
void FILESYSTEM_mountassets(const char *path);
|
|
void FILESYSTEM_unmountassets(void);
|
|
bool FILESYSTEM_isAssetMounted(const char* filename);
|
|
|
|
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
|
|
size_t *len, bool addnull = false);
|
|
void FILESYSTEM_freeMemory(unsigned char **mem);
|
|
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
|
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
|
|
|
|
void FILESYSTEM_enumerateLevelDirFileNames(void (*callback)(const char* filename));
|
|
|
|
bool FILESYSTEM_openDirectoryEnabled(void);
|
|
bool FILESYSTEM_openDirectory(const char *dname);
|
|
|
|
bool FILESYSTEM_delete(const char *name);
|
|
|
|
#endif /* FILESYSTEMUTILS_H */
|