diff options
Diffstat (limited to 'backends/platform/iphone/osys_main.cpp')
-rw-r--r-- | backends/platform/iphone/osys_main.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 2bdc09c9ce..f3e0d97b97 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -55,26 +55,28 @@ SoundProc OSystem_IPHONE::s_soundCallback = NULL; void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : - _mixer(NULL), _gameScreenRaw(NULL), - _overlayVisible(false), _gameScreenConverted(NULL), - _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), + _mixer(NULL), _lastMouseTap(0), _queuedEventTime(0), _mouseNeedTextureUpdate(false), _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0), - _overlayHeight(0), _overlayWidth(0), _overlayBuffer(0), _mouseCursorPaletteEnabled(false), - _currentGraphicsMode(kGraphicsModeLinear) { + _mouseCursorPaletteEnabled(false) { _queuedInputEvent.type = Common::EVENT_INVALID; _touchpadModeEnabled = !iPhone_isHighResDevice(); _fsFactory = new POSIXFilesystemFactory(); + initVideoContext(); } OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); delete _mixer; - free(_gameScreenRaw); - free(_gameScreenConverted); + // Prevent accidental freeing of the screen texture here. This needs to be + // checked since we might use the screen texture as framebuffer in the case + // of hi-color games for example. + if (_framebuffer.pixels == _videoContext->screenTexture.pixels) + _framebuffer.free(); + _mouseBuffer.free(); } int OSystem_IPHONE::timerHandler(int t) { @@ -120,6 +122,9 @@ void OSystem_IPHONE::setFeatureState(Feature f, bool enable) { _mouseCursorPaletteEnabled = enable; } break; + case kFeatureAspectRatioCorrection: + _videoContext->asprectRatioCorrection = enable; + break; default: break; @@ -130,6 +135,8 @@ bool OSystem_IPHONE::getFeatureState(Feature f) { switch (f) { case kFeatureCursorPalette: return _mouseCursorPaletteEnabled; + case kFeatureAspectRatioCorrection: + return _videoContext->asprectRatioCorrection; default: return false; |