diff options
Diffstat (limited to 'backends/platform/ios7')
-rw-r--r-- | backends/platform/ios7/ios7_common.h | 4 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_events.cpp | 12 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_main.cpp | 9 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_main.h | 3 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 13 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_video.mm | 26 |
6 files changed, 32 insertions, 35 deletions
diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h index 12740d4ae9..3609387efd 100644 --- a/backends/platform/ios7/ios7_common.h +++ b/backends/platform/ios7/ios7_common.h @@ -62,7 +62,6 @@ enum UIViewTapDescription { }; enum GraphicsModes { - kGraphicsModeLinear = 0, kGraphicsModeNone = 1, kGraphicsMode2xSaI, @@ -80,7 +79,7 @@ struct VideoContext { VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false), overlayWidth(), overlayHeight(), mouseX(), mouseY(), mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(), - mouseIsVisible(), graphicsMode(kGraphicsModeNone), shakeOffsetY() { + mouseIsVisible(), graphicsMode(kGraphicsModeNone), filtering(false), shakeOffsetY() { } // Game screen state @@ -102,6 +101,7 @@ struct VideoContext { // Misc state GraphicsModes graphicsMode; + bool filtering; int shakeOffsetY; }; diff --git a/backends/platform/ios7/ios7_osys_events.cpp b/backends/platform/ios7/ios7_osys_events.cpp index 3621c084db..da467cf5d6 100644 --- a/backends/platform/ios7/ios7_osys_events.cpp +++ b/backends/platform/ios7/ios7_osys_events.cpp @@ -91,16 +91,16 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) { if (!handleEvent_secondMouseUp(event, internalEvent.value1, internalEvent.value2)) return false; break; - + case kInputKeyPressed: handleEvent_keyPressed(event, internalEvent.value1); break; - + case kInputSwipe: if (!handleEvent_swipe(event, internalEvent.value1, internalEvent.value2)) return false; break; - + case kInputTap: if (!handleEvent_tap(event, (UIViewTapDescription) internalEvent.value1, internalEvent.value2)) return false; @@ -109,7 +109,7 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) { default: break; } - + return true; } return false; @@ -499,14 +499,14 @@ bool OSystem_iOS7::handleEvent_swipe(Common::Event &event, int direction, int to } break; } - + event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode; event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0; event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; event.kbd.flags = _queuedInputEvent.kbd.flags = 0; _queuedEventTime = getMillis() + kQueuedInputEventDelay; - + return true; } else if (touches == 2) { diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp index 25d9cbed15..3a627478f9 100644 --- a/backends/platform/ios7/ios7_osys_main.cpp +++ b/backends/platform/ios7/ios7_osys_main.cpp @@ -52,8 +52,7 @@ const OSystem::GraphicsMode OSystem_iOS7::s_supportedGraphicsModes[] = { - { "none", "No filtering", kGraphicsModeNone }, - { "linear", "Linear filtering", kGraphicsModeLinear }, + { "none", "Normal", kGraphicsModeNone }, #ifdef ENABLE_IOS7_SCALERS #ifdef USE_SCALERS @@ -171,6 +170,7 @@ void OSystem_iOS7::initBackend() { bool OSystem_iOS7::hasFeature(Feature f) { switch (f) { case kFeatureCursorPalette: + case kFeatureFilteringMode: return true; default: @@ -187,6 +187,9 @@ void OSystem_iOS7::setFeatureState(Feature f, bool enable) { _mouseCursorPaletteEnabled = enable; } break; + case kFeatureFilteringMode: + _videoContext->filtering = enable; + break; case kFeatureAspectRatioCorrection: _videoContext->asprectRatioCorrection = enable; break; @@ -200,6 +203,8 @@ bool OSystem_iOS7::getFeatureState(Feature f) { switch (f) { case kFeatureCursorPalette: return _mouseCursorPaletteEnabled; + case kFeatureFilteringMode: + return _videoContext->filtering; case kFeatureAspectRatioCorrection: return _videoContext->asprectRatioCorrection; diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h index 174c160bd6..0f89cf7aa5 100644 --- a/backends/platform/ios7/ios7_osys_main.h +++ b/backends/platform/ios7/ios7_osys_main.h @@ -123,6 +123,9 @@ public: static OSystem_iOS7 *sharedInstance(); virtual void initBackend(); + + virtual void engineInit(); + virtual void engineDone(); virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 6784cf46f5..1ec0defd7e 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -61,6 +61,18 @@ void OSystem_iOS7::fatalError() { } } +void OSystem_iOS7::engineInit() { + EventsBaseBackend::engineInit(); + // Prevent the device going to sleep during game play (and in particular cut scenes) + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; +} + +void OSystem_iOS7::engineDone() { + EventsBaseBackend::engineDone(); + // Allow the device going to sleep if idle while in the Launcher + [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; +} + void OSystem_iOS7::initVideoContext() { _videoContext = [[iOS7AppDelegate iPhoneView] getVideoContext]; } @@ -76,7 +88,6 @@ int OSystem_iOS7::getDefaultGraphicsMode() const { bool OSystem_iOS7::setGraphicsMode(int mode) { switch (mode) { case kGraphicsModeNone: - case kGraphicsModeLinear: case kGraphicsMode2xSaI: case kGraphicsModeSuper2xSaI: case kGraphicsModeSuperEagle: diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 5c0434d43e..5baa83e8e8 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -442,26 +442,7 @@ uint getSizeNextPOT(uint size) { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, tex); printOpenGLError(); - GLint filter = GL_LINEAR; - - switch (_videoContext.graphicsMode) { - case kGraphicsModeNone: - filter = GL_NEAREST; - break; - - case kGraphicsModeLinear: - case kGraphicsMode2xSaI: - case kGraphicsModeSuper2xSaI: - case kGraphicsModeSuperEagle: - case kGraphicsModeAdvMame2x: - case kGraphicsModeAdvMame3x: - case kGraphicsModeHQ2x: - case kGraphicsModeHQ3x: - case kGraphicsModeTV2x: - case kGraphicsModeDotMatrix: - filter = GL_LINEAR; - break; - } + GLint filter = _videoContext.filtering ? GL_LINEAR : GL_NEAREST; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); printOpenGLError(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); printOpenGLError(); @@ -478,9 +459,6 @@ uint getSizeNextPOT(uint size) { int scalerScale = 1; switch (_videoContext.graphicsMode) { - case kGraphicsModeLinear: - break; - case kGraphicsModeNone: break; #ifdef USE_SCALERS @@ -931,7 +909,7 @@ uint getSizeNextPOT(uint size) { CGPoint point = [touch locationInView:self]; if (![self getMouseCoords:point eventX:&x eventY:&y]) return; - + [self addEvent:InternalEvent(kInputMouseSecondDragged, x, y)]; } } |