diff options
Diffstat (limited to 'backends/platform/symbian/src/SymbianOS.cpp')
-rw-r--r-- | backends/platform/symbian/src/SymbianOS.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 0ce44d1704..90bd99fa7d 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -123,10 +123,6 @@ void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) { } } -FilesystemFactory *OSystem_SDL_Symbian::getFilesystemFactory() { - return &SymbianFilesystemFactory::instance(); -} - static Common::String getDefaultConfigFileName() { char configFile[MAXPATHLEN]; strcpy(configFile, Symbian::GetExecutablePath()); @@ -134,33 +130,13 @@ static Common::String getDefaultConfigFileName() { return configFile; } -Common::SeekableReadStream *OSystem_SDL_Symbian::openConfigFileForReading() { - Common::File *confFile = new Common::File(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; -} - -Common::WriteStream *OSystem_SDL_Symbian::openConfigFileForWriting() { - Common::DumpFile *confFile = new Common::DumpFile(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; -} - - OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = { { 0, 0, 320, 145 }, { 0, 145, 150, 55 }, { 150, 145, 170, 55 } }; OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0) { + _RFs = &CEikonEnv::Static()->FsSession(); } void OSystem_SDL_Symbian::initBackend() { @@ -184,6 +160,8 @@ void OSystem_SDL_Symbian::initBackend() { actions->initInstanceMain(this); actions->loadMapping(); initZones(); + + _fsFactory = new SymbianFilesystemFactory(); } OSystem_SDL_Symbian::~OSystem_SDL_Symbian() { @@ -488,6 +466,10 @@ void OSystem_SDL_Symbian::initZones() { } } +RFs& OSystem_SDL_Symbian::FsSession() { + return *_RFs; +} + FILE* symbian_fopen(const char* name, const char* mode) { TSymbianFileEntry* fileEntry = new TSymbianFileEntry; fileEntry->iInputPos = KErrNotFound; @@ -516,22 +498,22 @@ FILE* symbian_fopen(const char* name, const char* mode) { switch(mode[0]) { case 'a': - if (fileEntry->iFileHandle.Open(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { - if (fileEntry->iFileHandle.Create(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Create(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } } break; case 'r': - if (fileEntry->iFileHandle.Open(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } break; case 'w': - if (fileEntry->iFileHandle.Replace(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Replace(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } |