diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-03-27 13:34:26 +0100 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-03-27 13:34:26 +0100 |
commit | f08b87b41f0ffaabd7928d68c41d704e824b5de3 (patch) | |
tree | 8a0548247fbd0a63d4a810d4c1c81bd8444681b3 /src/Config.cpp | |
parent | 6d7e80b67768d1c14792f5da5ff59b739e2109e6 (diff) |
* move melon_fopen_local() to Platform.cpp
* make it require that the file already exist (hopefully fixing config saving bug)
* finally axe melon_fopen.cpp
Diffstat (limited to 'src/Config.cpp')
-rw-r--r-- | src/Config.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/Config.cpp b/src/Config.cpp index 760ad3b..deddc58 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -21,10 +21,8 @@ #include <stdlib.h> #include "Config.h" #include "Platform.h" -#include "melon_fopen.h" -bool LocalFileExists(const char* name); extern char* EmuDirectory; namespace Config @@ -69,7 +67,7 @@ void Load() entry++; } - FILE* f = melon_fopen_local(kConfigFile, "r"); + FILE* f = Platform::OpenLocalFile(kConfigFile, "r"); if (!f) return; char linebuf[1024]; @@ -112,14 +110,8 @@ void Load() void Save() { - // TODO not make path search shit tself and pick the wrong ath every damn tiem!!!!! - FILE* f; - if (LocalFileExists(kConfigFile)) - { - f = melon_fopen_local(kConfigFile, "w"); - if (!f) return; - } - else + FILE* f = Platform::OpenLocalFile(kConfigFile, "w"); + if (!f) { int dirlen = strlen(EmuDirectory); int filelen = strlen(kConfigFile); |