From 0b847325e1b57ad2feec943ae715236cf393d13b Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Sun, 12 Feb 2006 00:33:04 +0000 Subject: 'Changed Symbian configuration handling so it is using the basepath of the application installation as a path for Savegames, ini files etc *Updated list.h so it also compiles for Symbian codewarrior and gcce compilers svn-id: r20586 --- base/engine.cpp | 2 +- base/gameDetector.cpp | 15 ++++++++++++++- base/main.cpp | 15 ++++++++++++--- common/config-manager.cpp | 3 ++- common/list.h | 4 ++-- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/base/engine.cpp b/base/engine.cpp index c60611cdda..5da4b9ac43 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -193,7 +193,7 @@ void NORETURN CDECL error(const char *s, ...) { #endif #ifdef __SYMBIAN32__ - SymbianFatalError(buf_output); + Symbian::FatalError(buf_output); #endif // Finally exit. quit() will terminate the program if g_system iss present if (g_system) diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index b274a3a9c5..ec33954e8c 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -46,6 +46,10 @@ #else #define DEFAULT_SAVE_PATH ".scummvm" #endif +#else if defined(__SYMBIAN32__) +#include +#include +#define DEFAULT_SAVE_PATH "Savegames" #endif // DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :) @@ -199,8 +203,17 @@ GameDetector::GameDetector() { ConfMan.registerDefault("savepath", savePath); } } +#else if defined(__SYMBIAN32__) + strcpy(savePath, Symbian::GetExecutablePath()); + strcat(savePath, DEFAULT_SAVE_PATH); + struct stat sb; + if (stat(savePath, &sb) == -1) + if (errno == ENOENT)// create the dir if it does not exist + if (mkdir(savePath, 0755) != 0) + error("mkdir for '%s' failed!", savePath); + ConfMan.registerDefault("savepath", savePath); // this should be enough... #endif -#endif +#endif // #ifdef DEFAULT_SAVE_PATH _dumpScripts = false; diff --git a/base/main.cpp b/base/main.cpp index 1857467f0d..ec24f0fc68 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -131,6 +131,11 @@ const char *gScummVMFeatures = "" "FluidSynth " #endif +#ifdef __SYMBIAN32__ +// we want a list of compiled in engines visible in the program, +// because we also release special builds with only one engine +#include "backends/epoc/src/main_features.inl" +#endif ; #if defined(__amigaos4__) @@ -142,9 +147,6 @@ const char* stackCookie = "$STACK: 655360\0"; #include #define STDOUT_FILE TEXT("stdout.txt") #define STDERR_FILE TEXT("stderr.txt") -#elif defined(__SYMBIAN32__) // Symbian does not like any output to the console through any *print* function -#define STDOUT_FILE SYMBIAN32_DOC_DIR "scummvm.stdout.txt" -#define STDERR_FILE SYMBIAN32_DOC_DIR "scummvm.stderr.txt" #endif #if defined(QTOPIA) @@ -340,6 +342,13 @@ extern "C" int main(int argc, char *argv[]) { // Code copied from SDL_main #if (defined(WIN32) && defined(NO_CONSOLE)) || defined(__SYMBIAN32__) // Symbian does not like any output to the console through any *print* function +#if defined(__SYMBIAN32__) + char STDOUT_FILE[255], STDERR_FILE[255]; // shhh, don't tell anybody :) + strcpy(STDOUT_FILE, Symbian::GetExecutablePath()); + strcpy(STDERR_FILE, Symbian::GetExecutablePath()); + strcat(STDOUT_FILE, "scummvm.stdout.txt"); + strcat(STDERR_FILE, "scummvm.stderr.txt"); +#endif /* Flush the output in case anything is queued */ fclose(stdout); diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 128db8035b..ee49a4babf 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -109,7 +109,8 @@ void ConfigManager::loadDefaultConfigFile() { #elif defined(__PSP__) strcpy(configFile, "ms0:/" DEFAULT_CONFIG_FILE); #elif defined (__SYMBIAN32__) - strcpy(configFile, SYMBIAN32_DOC_DIR DEFAULT_CONFIG_FILE); + strcpy(configFile, Symbian::GetExecutablePath()); + strcat(configFile, DEFAULT_CONFIG_FILE); #else strcpy(configFile, DEFAULT_CONFIG_FILE); #endif diff --git a/common/list.h b/common/list.h index 8fb59a12a9..6d93636798 100644 --- a/common/list.h +++ b/common/list.h @@ -55,7 +55,7 @@ public: friend class List; NodeBase *_node; -#ifndef PALMOS_MODE +#if !defined (PALMOS_MODE) && !defined (__WINSCW__) explicit Iterator(NodeBase *node) : _node(node) {} #else Iterator(NodeBase *node) : _node(node) {} @@ -72,7 +72,7 @@ public: } // Postfix inc Iterator operator++(int) { -#ifndef PALMOS_MODE +#if !defined (PALMOS_MODE) && !defined (__SYMBIAN32__) Iterator tmp(_node); #else Iterator tmp(_node); -- cgit v1.2.3