aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt2010-07-29 19:11:49 +0000
committerMarcus Comstedt2010-07-29 19:11:49 +0000
commit3e8a972602663810465414cd9aad6dddab6a2f14 (patch)
tree7ec5cd9c27860e42b655026514f2c3a9d156eec8
parentbc54fde8e1f58b910026644d606ba140aa3032c4 (diff)
downloadscummvm-rg350-3e8a972602663810465414cd9aad6dddab6a2f14.tar.gz
scummvm-rg350-3e8a972602663810465414cd9aad6dddab6a2f14.tar.bz2
scummvm-rg350-3e8a972602663810465414cd9aad6dddab6a2f14.zip
DC: Specialize createConfig{Read,Write}Stream
Implement platform-specific variants of createConfigReadStream() and createConfigWriteStream(), instead of inheriting the BaseBackend definitions. Nonstandard behavious is as follows: * createConfigWriteStream() always returns 0 (read-only filesystem) * createConfigReadStream() returns an empty MemoryReadStream instead of NULL if scummvm.ini does not exist. This is to make sure that loadDefaultConfigFile() always clears out any old config data, as I'll want to restart config parsing from scratch after a disc swap. svn-id: r51478
-rw-r--r--backends/platform/dc/dc.h3
-rw-r--r--backends/platform/dc/dcmain.cpp11
2 files changed, 14 insertions, 0 deletions
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index e87a0a8c90..057ab283cf 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -233,6 +233,9 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
Common::SaveFileManager *createSavefileManager();
+
+ Common::SeekableReadStream *createConfigReadStream();
+ Common::WriteStream *createConfigWriteStream();
};
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index 5a9286093f..5fde919650 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -31,6 +31,7 @@
#include "icon.h"
#include "DCLauncherDialog.h"
#include <common/config-manager.h>
+#include <common/stream.h>
#include "backends/plugins/dc/dc-provider.h"
#include "sound/mixer_intern.h"
@@ -206,6 +207,16 @@ void OSystem_Dreamcast::getTimeAndDate(TimeDate &td) const {
td.tm_year = t.tm_year;
}
+Common::SeekableReadStream *OSystem_Dreamcast::createConfigReadStream() {
+ Common::FSNode file("/scummvm.ini");
+ Common::SeekableReadStream *s = file.createReadStream();
+ return s? s : new Common::MemoryReadStream((const byte *)"", 0);
+}
+
+Common::WriteStream *OSystem_Dreamcast::createConfigWriteStream() {
+ return 0;
+}
+
void DCHardware::dc_init_hardware()
{
#ifndef NOSERIAL