[Scummvm-cvs-logs] SF.net SVN: scummvm:[51478] scummvm/trunk/backends/platform/dc

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Thu Jul 29 21:11:49 CEST 2010


Revision: 51478
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51478&view=rev
Author:   marcus_c
Date:     2010-07-29 19:11:49 +0000 (Thu, 29 Jul 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/dc/dc.h
    scummvm/trunk/backends/platform/dc/dcmain.cpp

Modified: scummvm/trunk/backends/platform/dc/dc.h
===================================================================
--- scummvm/trunk/backends/platform/dc/dc.h	2010-07-29 19:08:07 UTC (rev 51477)
+++ scummvm/trunk/backends/platform/dc/dc.h	2010-07-29 19:11:49 UTC (rev 51478)
@@ -233,6 +233,9 @@
 
 
   Common::SaveFileManager *createSavefileManager();
+
+  Common::SeekableReadStream *createConfigReadStream();
+  Common::WriteStream *createConfigWriteStream();
 };
 
 

Modified: scummvm/trunk/backends/platform/dc/dcmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/dcmain.cpp	2010-07-29 19:08:07 UTC (rev 51477)
+++ scummvm/trunk/backends/platform/dc/dcmain.cpp	2010-07-29 19:11:49 UTC (rev 51478)
@@ -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 @@
   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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list