From c8475224221ed14590ad08929a1cadd6e8e3cc4e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 15:30:21 +0200 Subject: 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). --- backends/platform/ds/arm9/source/osystem_ds.cpp | 12 ++---------- backends/platform/ds/arm9/source/osystem_ds.h | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'backends/platform/ds/arm9/source') diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index e65402c604..90af02f43b 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -853,16 +853,8 @@ void OSystem_DS::setCharactersEntered(int count) { DS::setCharactersEntered(count); } -Common::SeekableReadStream *OSystem_DS::createConfigReadStream() { - Common::FSNode file(DEFAULT_CONFIG_FILE); -// consolePrintf("R %s", DEFAULT_CONFIG_FILE); - return file.createReadStream(); -} - -Common::WriteStream *OSystem_DS::createConfigWriteStream() { - Common::FSNode file(DEFAULT_CONFIG_FILE); -// consolePrintf("W %s", DEFAULT_CONFIG_FILE); - return file.createWriteStream(); +Common::String OSystem_DS::getDefaultConfigFileName() { + return DEFAULT_CONFIG_FILE; } u16 OSystem_DS::applyGamma(u16 color) { diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index ecb8011060..d3e7fce1a1 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -176,8 +176,7 @@ public: void refreshCursor(); - Common::WriteStream *createConfigWriteStream(); - Common::SeekableReadStream *createConfigReadStream(); + virtual Common::String getDefaultConfigFileName(); u16 applyGamma(u16 color); void setGammaValue(int gamma) { _gammaValue = gamma; } -- cgit v1.2.3