mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
* 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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user