diff --git a/src/FileSystem.cpp b/src/FileSystem.cpp index 76628b26..d15866e2 100644 --- a/src/FileSystem.cpp +++ b/src/FileSystem.cpp @@ -7,7 +7,7 @@ u32 g_LastFileSize; -u8 *OpenPath(char *filepath, int isExternalResource) +u8 *FileSystem::OpenPath(char *filepath, int isExternalResource) { // char *slashPos; u8 *buf; @@ -87,7 +87,7 @@ u8 *OpenPath(char *filepath, int isExternalResource) return buf; } -int WriteDataToFile(char *path, void *data, size_t size) +int FileSystem::WriteDataToFile(char *path, void *data, size_t size) { FILE *f; diff --git a/src/FileSystem.hpp b/src/FileSystem.hpp index 2a7715cb..9fac6fbc 100644 --- a/src/FileSystem.hpp +++ b/src/FileSystem.hpp @@ -2,7 +2,10 @@ #include "inttypes.hpp" +namespace FileSystem +{ u8 *OpenPath(char *filepath, int isExternalResource); int WriteDataToFile(char *path, void *data, size_t size); +} // namespace FileSystem extern u32 g_LastFileSize; diff --git a/src/GameContext.cpp b/src/GameContext.cpp index 317b754e..35e296d7 100644 --- a/src/GameContext.cpp +++ b/src/GameContext.cpp @@ -32,7 +32,7 @@ i32 GameContext::Parse(char *path) memset(&g_GameContext.cfg, 0, sizeof(GameConfiguration)); g_GameContext.cfg.opts = g_GameContext.cfg.opts | USE_D3D_HW_TEXTURE_BLENDING; - data = OpenPath(path, 1); + data = FileSystem::OpenPath(path, 1); if (data == NULL) { g_GameContext.cfg.lifeCount = 2; @@ -145,7 +145,7 @@ i32 GameContext::Parse(char *path) { GameErrorContextLog(&g_GameErrorContext, TH_ERR_DO_NOT_USE_DIRECTINPUT); } - if (WriteDataToFile(path, &g_GameContext.cfg, sizeof(GameConfiguration)) == 0) + if (FileSystem::WriteDataToFile(path, &g_GameContext.cfg, sizeof(GameConfiguration)) == 0) { return 0; } diff --git a/src/main.cpp b/src/main.cpp index e2a9bcf5..23724fef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -268,7 +268,7 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL } else { - WriteDataToFile(TH_CONFIG_FILE, &g_GameContext.cfg, sizeof(g_GameContext.cfg)); + FileSystem::WriteDataToFile(TH_CONFIG_FILE, &g_GameContext.cfg, sizeof(g_GameContext.cfg)); SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, g_ScreenSaveActive, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETLOWPOWERACTIVE, g_LowPowerActive, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETPOWEROFFACTIVE, g_PowerOffActive, NULL, SPIF_SENDCHANGE);