[Scummvm-cvs-logs] SF.net SVN: scummvm:[33977] scummvm/branches/branch-0-12-0/backends/ platform/symbian/src
anotherguest at users.sourceforge.net
anotherguest at users.sourceforge.net
Sun Aug 17 23:02:40 CEST 2008
Revision: 33977
http://scummvm.svn.sourceforge.net/scummvm/?rev=33977&view=rev
Author: anotherguest
Date: 2008-08-17 21:02:40 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
Better looking handling for Symbian File Session
Modified Paths:
--------------
scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.cpp
scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.h
Modified: scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.cpp 2008-08-17 20:53:18 UTC (rev 33976)
+++ scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.cpp 2008-08-17 21:02:40 UTC (rev 33977)
@@ -57,7 +57,6 @@
namespace Symbian {
-RFs* gFs;
// Show a simple Symbian Info win with Msg & exit
void FatalError(const char *msg) {
TPtrC8 msgPtr((const TUint8 *)msg);
@@ -128,7 +127,7 @@
{ 150, 145, 170, 55 }
};
OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0) {
- Symbian::gFs = &CEikonEnv::Static()->FsSession();
+ _RFs = &CEikonEnv::Static()->FsSession();
}
void OSystem_SDL_Symbian::initBackend() {
@@ -456,6 +455,10 @@
}
}
+RFs& OSystem_SDL_Symbian::FsSession() {
+ return *_RFs;
+}
+
FILE* symbian_fopen(const char* name, const char* mode) {
TSymbianFileEntry* fileEntry = new TSymbianFileEntry;
fileEntry->iInputPos = KErrNotFound;
@@ -484,22 +487,22 @@
switch(mode[0]) {
case 'a':
- if (fileEntry->iFileHandle.Open(*Symbian::gFs, tempFileName, fileMode) != KErrNone) {
- if (fileEntry->iFileHandle.Create(*Symbian::gFs, 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(*Symbian::gFs, 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(*Symbian::gFs, tempFileName, fileMode) != KErrNone) {
+ if (fileEntry->iFileHandle.Replace(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) {
delete fileEntry;
fileEntry = NULL;
}
Modified: scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.h
===================================================================
--- scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.h 2008-08-17 20:53:18 UTC (rev 33976)
+++ scummvm/branches/branch-0-12-0/backends/platform/symbian/src/SymbianOS.h 2008-08-17 21:02:40 UTC (rev 33977)
@@ -33,6 +33,7 @@
#endif
#define TOTAL_ZONES 3
+class RFs;
class OSystem_SDL_Symbian : public OSystem_SDL {
public:
@@ -62,6 +63,9 @@
// Overloaded from SDL_Commmon
void quit();
+
+ // Returns reference to File session
+ RFs& FsSession();
protected:
//
// The mixer callback function, passed on to OSystem::setSoundCallback().
@@ -131,6 +135,7 @@
} zoneDesc;
static zoneDesc _zones[TOTAL_ZONES];
+ RFs* _RFs;
};
#endif
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