aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/gph/gph-backend.cpp
diff options
context:
space:
mode:
authorDavid-John Willis2011-05-08 22:43:09 +0100
committerDavid-John Willis2011-06-11 17:07:08 +0100
commit64b8587507ee3cec2c38d505d2310f81b0b97ff0 (patch)
treec3157e71976f2c4e5f488e0c5ce43e165f42278a /backends/platform/gph/gph-backend.cpp
parent181ea053f47420089b8aada5a2fdbc7b5e292bc8 (diff)
downloadscummvm-rg350-64b8587507ee3cec2c38d505d2310f81b0b97ff0.tar.gz
scummvm-rg350-64b8587507ee3cec2c38d505d2310f81b0b97ff0.tar.bz2
scummvm-rg350-64b8587507ee3cec2c38d505d2310f81b0b97ff0.zip
GPH: Cleanup and some WIP refactoring.
Diffstat (limited to 'backends/platform/gph/gph-backend.cpp')
-rw-r--r--backends/platform/gph/gph-backend.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index cb52da441d..ae3466b836 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -56,8 +56,15 @@
/* Dump console info to files. */
#define DUMP_STDOUT
+OSystem_GPH::OSystem_GPH()
+ :
+ OSystem_POSIX() {
+}
+
void OSystem_GPH::initBackend() {
+ assert(!_inited);
+
// Create the events manager
if (_eventSource == 0)
_eventSource = new GPHEventSource();
@@ -81,7 +88,7 @@ void OSystem_GPH::initBackend() {
char workDirName[PATH_MAX+1];
if (getcwd(workDirName, PATH_MAX) == NULL) {
- error("Could not obtain current working directory");
+ error("Could not obtain current working directory.");
} else {
printf("Current working directory: %s\n", workDirName);
}
@@ -155,7 +162,8 @@ void OSystem_GPH::initBackend() {
/* Trigger autosave every 4 minutes - On low batts 5 mins is about your warning time. */
ConfMan.registerDefault("autosave_period", 4 * 60);
- /* Make sure that aspect ratio correction is enabled on the 1st run to stop users asking me what the 'wasted space' is ;-). */
+ /* Make sure that aspect ratio correction is enabled on the 1st run to stop
+ users asking me what the 'wasted space' at the bottom is ;-). */
ConfMan.registerDefault("aspect_ratio", true);
/* Make sure SDL knows that we have a joystick we want to use. */
@@ -164,10 +172,10 @@ void OSystem_GPH::initBackend() {
/* Now setup any device specific user options (Left handed mode, that sort of thing). */
// GPH::setOptions();
- printf("%s\n", "Passing to OSystem::SDL initBackend.");
-
/* Pass to POSIX method to do the heavy lifting */
OSystem_POSIX::initBackend();
+
+ _inited = true;
}
void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
@@ -176,7 +184,7 @@ void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority)
char workDirName[PATH_MAX+1];
if (getcwd(workDirName, PATH_MAX) == NULL) {
- error("Error: Could not obtain current working directory");
+ error("Error: Could not obtain current working directory.");
}
Common::FSNode workdirNode(workDirName);
@@ -215,5 +223,5 @@ void OSystem_GPH::quit() {
fclose(stderr);
#endif /* DUMP_STDOUT */
- OSystem_SDL::quit();
+ OSystem_POSIX::quit();
}