Cavestory Mod API
|
Platform-specific functions. More...
Functions | |
CAVESTORY_MOD_API bool | CSM_Platform_GetGameFilePath (const char *pDesiredSubpath, const char *pFileName, char *pOutputFilePath, char *pOutputFileName, const char *pFileNameFormat="*.*", void *pModPointer=NULL) |
Convert a file path into a mod file path. More... | |
CAVESTORY_MOD_API void | CSM_Platform_GetProgramMode (CSM_ProgramMode *eModePtr) |
Get the current program mode. More... | |
CAVESTORY_MOD_API BOOL | CSM_Platform_IsProgramMode (CSM_ProgramMode eMode) |
Check the current program mode. More... | |
Platform-specific functions.
These functions assist with platform-specific features.
CAVESTORY_MOD_API bool CSM_Platform_GetGameFilePath | ( | const char * | pDesiredSubpath, |
const char * | pFileName, | ||
char * | pOutputFilePath, | ||
char * | pOutputFileName, | ||
const char * | pFileNameFormat = "*.*" , |
||
void * | pModPointer = NULL |
||
) |
Convert a file path into a mod file path.
pDesiredSubpath | The desired subpath. Example: 'Stage' will point towards 'mymod/Stage/myfile.png' |
pFileName | The buffer that holds the file name. |
pOutputFilePath | The buffer that will hold the resulting absolute file path. Can be 'NULL'. This function assumes that this buffer can hold at least 260 characters. |
pOutputFileName | The buffer that will hold the resulting file base (excludes path & extension). Can be 'NULL'. This function assumes that this buffer can hold at least 260 characters. |
pFileNameFormat | The format of the result filename. |
pModPointer | The mod to use. Leave this as 'NULL' to use the currently loaded mod. |
char pPath[260]; char pFilePath[260]; char pFileBase[260]; strcpy(pPath, "H:\\SomeOtherDirectory\\MyStageBmp.png");
CSM_Platform_GetGameFilePath("Stage", pPath, pFilePath, pFileBase, "Prt*");
CSM_Log("%s\r\n", pFilePath); // This will print out "G:/TheGameDirectory/data/Stage/PrtMyStageBmp.png" CSM_Log("%s\r\n", pFileBase); // This will print out "PrtMyStageBmp"
CAVESTORY_MOD_API void CSM_Platform_GetProgramMode | ( | CSM_ProgramMode * | eModePtr | ) |
Get the current program mode.
eModePtr | A pointer to a 'CSM_ProgramMode' that will store the value. |
CAVESTORY_MOD_API BOOL CSM_Platform_IsProgramMode | ( | CSM_ProgramMode | eMode | ) |
Check the current program mode.
eMode | The mode to check for. |