OSYSTEM: Pushed out some port specific code from common/system.cpp to the respective ports

svn-id: r34812
This commit is contained in:
Max Horn 2008-10-16 17:18:15 +00:00
parent 0cd4939110
commit 36311eefb4
9 changed files with 62 additions and 38 deletions

View file

@ -122,48 +122,19 @@ void OSystem::clearScreen() {
/*
FIXME: The config file loading code below needs to be cleaned up.
Port specific variants should be pushed into the respective ports.
Ideally, the default OSystem::openConfigFileForReading/Writing methods
should be removed completely.
FIXME: Maybe we should push the default config file loading/saving code below
out to all the backends?
*/
#ifdef __PLAYSTATION2__
#include "backends/platform/ps2/systemps2.h"
#endif
#ifdef IPHONE
#include "backends/platform/iphone/osys_iphone.h"
#endif
#if defined(UNIX)
#define DEFAULT_CONFIG_FILE ".scummvmrc"
#else
#define DEFAULT_CONFIG_FILE "scummvm.ini"
#endif
static Common::String getDefaultConfigFileName() {
char configFile[MAXPATHLEN];
#if defined(PALMOS_MODE)
strcpy(configFile,"/PALM/Programs/ScummVM/" DEFAULT_CONFIG_FILE);
#elif defined(IPHONE)
strcpy(configFile, OSystem_IPHONE::getConfigPath());
#elif defined(__PLAYSTATION2__)
((OSystem_PS2*)g_system)->makeConfigPath(configFile);
#elif defined(__PSP__)
strcpy(configFile, "ms0:/" DEFAULT_CONFIG_FILE);
#else
strcpy(configFile, DEFAULT_CONFIG_FILE);
#endif
return configFile;
}
Common::SeekableReadStream *OSystem::openConfigFileForReading() {
Common::FSNode file(getDefaultConfigFileName());
Common::FSNode file(DEFAULT_CONFIG_FILE);
return file.openForReading();
}
@ -171,7 +142,7 @@ Common::WriteStream *OSystem::openConfigFileForWriting() {
#ifdef __DC__
return 0;
#else
Common::FSNode file(getDefaultConfigFileName());
Common::FSNode file(DEFAULT_CONFIG_FILE);
return file.openForWriting();
#endif
}