BACKENDS: Add OSystem::getDefaultConfigFileName

This is used to provide default implementations for createConfigWriteStream
and createConfigReadStream, which can be used by most backends.

Note that backends can still override createConfigRead/WriteStream;
this could be useful if settings on some port are not stored in a
regular file (think 'Windows registry', for a hypothetical example).
This commit is contained in:
Max Horn 2011-06-06 15:30:21 +02:00
parent afb06b51cc
commit c847522422
16 changed files with 43 additions and 137 deletions

View file

@ -52,40 +52,5 @@ void BaseBackend::fillScreen(uint32 col) {
unlockScreen();
}
/*
FIXME: Maybe we should push the default config file loading/saving code below
out to all the backends?
*/
#if defined(POSIX)
#define DEFAULT_CONFIG_FILE ".scummvmrc"
#endif
#if !defined(POSIX)
#define DEFAULT_CONFIG_FILE "scummvm.ini"
#endif
BaseBackend::BaseBackend() {
}
BaseBackend::~BaseBackend() {
}
Common::SeekableReadStream *BaseBackend::createConfigReadStream() {
Common::FSNode file(DEFAULT_CONFIG_FILE);
return file.createReadStream();
}
Common::WriteStream *BaseBackend::createConfigWriteStream() {
#ifdef __DC__
return 0;
#else
Common::FSNode file(DEFAULT_CONFIG_FILE);
return file.createWriteStream();
#endif
}
void BaseBackend::resetGraphicsScale() {
}