aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ios7/ios7_osys_main.cpp
diff options
context:
space:
mode:
authorVincent Bénony2015-12-11 14:24:29 +0100
committerVincent Bénony2016-01-06 16:17:38 +0100
commitc99456ecff9ae645385ea5a8aa423d0115dce08e (patch)
tree7e1e06045bf88f054d7521655d12ee12ede76a64 /backends/platform/ios7/ios7_osys_main.cpp
parent8d9b13059b82ea4b8a38203c34c4939abc0feb25 (diff)
downloadscummvm-rg350-c99456ecff9ae645385ea5a8aa423d0115dce08e.tar.gz
scummvm-rg350-c99456ecff9ae645385ea5a8aa423d0115dce08e.tar.bz2
scummvm-rg350-c99456ecff9ae645385ea5a8aa423d0115dce08e.zip
IOS: Brings support for FluidSynth
Diffstat (limited to 'backends/platform/ios7/ios7_osys_main.cpp')
-rw-r--r--backends/platform/ios7/ios7_osys_main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 76739423c1..cb712b9c38 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <pthread.h>
+#include <string.h>
#include <sys/time.h>
@@ -80,7 +81,7 @@ OSystem_iOS7::OSystem_iOS7() :
_screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false),
_gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false),
_mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0),
- _mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) {
+ _lastErrorMessage(NULL), _mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) {
_queuedInputEvent.type = Common::EVENT_INVALID;
_touchpadModeEnabled = !iOS7_isBigDevice();
#ifdef IPHONE_OFFICIAL
@@ -275,8 +276,9 @@ Audio::Mixer *OSystem_iOS7::getMixer() {
return _mixer;
}
-OSystem *OSystem_iOS7_create() {
- return new OSystem_iOS7();
+OSystem_iOS7 *OSystem_iOS7::sharedInstance() {
+ static OSystem_iOS7 *instance = new OSystem_iOS7();
+ return instance;
}
Common::String OSystem_iOS7::getDefaultConfigFileName() {
@@ -318,6 +320,11 @@ void OSystem_iOS7::logMessage(LogMessageType::Type type, const char *message) {
else
output = stderr;
+ if (type == LogMessageType::kError) {
+ free(_lastErrorMessage);
+ _lastErrorMessage = strdup(message);
+ }
+
fputs(message, output);
fflush(output);
}
@@ -353,7 +360,7 @@ void iOS7_main(int argc, char **argv) {
chdir("/var/mobile/");
#endif
- g_system = OSystem_iOS7_create();
+ g_system = OSystem_iOS7::sharedInstance();
assert(g_system);
// Invoke the actual ScummVM main entry point: