From 699c3504814300415ca983fbef2ed172fa9020de Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Mon, 7 Dec 2015 11:34:11 +0100 Subject: IOS: Renames iOS7 classes to avoid confusion --- backends/platform/ios7/ios7_common.h | 117 +++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 backends/platform/ios7/ios7_common.h (limited to 'backends/platform/ios7/ios7_common.h') diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h new file mode 100644 index 0000000000..abc1180143 --- /dev/null +++ b/backends/platform/ios7/ios7_common.h @@ -0,0 +1,117 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H +#define BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H + +#include "graphics/surface.h" + +enum InputEvent { + kInputMouseDown, + kInputMouseUp, + kInputMouseDragged, + kInputMouseSecondDragged, + kInputMouseSecondDown, + kInputMouseSecondUp, + kInputOrientationChanged, + kInputKeyPressed, + kInputApplicationSuspended, + kInputApplicationResumed, + kInputSwipe, + kInputTap +}; + +enum ScreenOrientation { + kScreenOrientationPortrait, + kScreenOrientationLandscape, + kScreenOrientationFlippedLandscape +}; + +enum UIViewSwipeDirection { + kUIViewSwipeUp = 1, + kUIViewSwipeDown = 2, + kUIViewSwipeLeft = 4, + kUIViewSwipeRight = 8 +}; + +enum UIViewTapDescription { + kUIViewTapSingle = 1, + kUIViewTapDouble = 2 +}; + +enum GraphicsModes { + kGraphicsModeLinear = 0, + kGraphicsModeNone = 1 +}; + +struct VideoContext { + VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false), + overlayWidth(), overlayHeight(), mouseX(), mouseY(), + mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(), + mouseIsVisible(), graphicsMode(kGraphicsModeLinear), shakeOffsetY() { + } + + // Game screen state + bool asprectRatioCorrection; + uint screenWidth, screenHeight; + Graphics::Surface screenTexture; + + // Overlay state + bool overlayVisible; + uint overlayWidth, overlayHeight; + Graphics::Surface overlayTexture; + + // Mouse cursor state + uint mouseX, mouseY; + int mouseHotspotX, mouseHotspotY; + uint mouseWidth, mouseHeight; + bool mouseIsVisible; + Graphics::Surface mouseTexture; + + // Misc state + GraphicsModes graphicsMode; + int shakeOffsetY; +}; + +struct InternalEvent { + InternalEvent() : type(), value1(), value2() {} + InternalEvent(InputEvent t, int v1, int v2) : type(t), value1(v1), value2(v2) {} + + InputEvent type; + int value1, value2; +}; + +// On the ObjC side + +extern int iOS7_argc; +extern char **iOS7_argv; + +void iOS7_updateScreen(); +bool iOS7_fetchEvent(InternalEvent *event); +bool iOS7_isHighResDevice(); + +void iOS7_main(int argc, char **argv); +const char *iOS7_getDocumentsDir(); + +uint getSizeNextPOT(uint size); + +#endif -- cgit v1.2.3 From c813e5d87e7e2bb8a23e86ed04f689390dac1b60 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 8 Dec 2015 10:38:47 +0100 Subject: IOS: Move declarations in the common header file --- backends/platform/ios7/ios7_common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'backends/platform/ios7/ios7_common.h') diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h index abc1180143..fe79e6d6cc 100644 --- a/backends/platform/ios7/ios7_common.h +++ b/backends/platform/ios7/ios7_common.h @@ -111,6 +111,7 @@ bool iOS7_isHighResDevice(); void iOS7_main(int argc, char **argv); const char *iOS7_getDocumentsDir(); +bool iOS7_touchpadModeEnabled(); uint getSizeNextPOT(uint size); -- cgit v1.2.3 From 14a0a3d032059ab489a9f5f535972449ba036010 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 8 Dec 2015 12:17:46 +0100 Subject: IOS: Better resolution handling --- backends/platform/ios7/ios7_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/ios7/ios7_common.h') diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h index fe79e6d6cc..73db72a068 100644 --- a/backends/platform/ios7/ios7_common.h +++ b/backends/platform/ios7/ios7_common.h @@ -107,7 +107,7 @@ extern char **iOS7_argv; void iOS7_updateScreen(); bool iOS7_fetchEvent(InternalEvent *event); -bool iOS7_isHighResDevice(); +bool iOS7_isBigDevice(); void iOS7_main(int argc, char **argv); const char *iOS7_getDocumentsDir(); -- cgit v1.2.3 From 80afba232a30b7d80d9331f597aee208d80cd2e1 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 9 Dec 2015 17:49:54 +0100 Subject: IOS: Implements scalers --- backends/platform/ios7/ios7_common.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'backends/platform/ios7/ios7_common.h') diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h index 73db72a068..b7a47eda8a 100644 --- a/backends/platform/ios7/ios7_common.h +++ b/backends/platform/ios7/ios7_common.h @@ -60,14 +60,24 @@ enum UIViewTapDescription { enum GraphicsModes { kGraphicsModeLinear = 0, - kGraphicsModeNone = 1 + kGraphicsModeNone = 1, + + kGraphicsMode2xSaI, + kGraphicsModeSuper2xSaI, + kGraphicsModeSuperEagle, + kGraphicsModeAdvMame2x, + kGraphicsModeAdvMame3x, + kGraphicsModeHQ2x, + kGraphicsModeHQ3x, + kGraphicsModeTV2x, + kGraphicsModeDotMatrix }; struct VideoContext { VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false), overlayWidth(), overlayHeight(), mouseX(), mouseY(), mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(), - mouseIsVisible(), graphicsMode(kGraphicsModeLinear), shakeOffsetY() { + mouseIsVisible(), graphicsMode(kGraphicsModeNone), shakeOffsetY() { } // Game screen state -- cgit v1.2.3 From aa77c0c92ddf76fb2284d3df5a75a36bacf0a976 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 08:41:45 +0100 Subject: IOS: Disable scalers --- backends/platform/ios7/ios7_common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/platform/ios7/ios7_common.h') diff --git a/backends/platform/ios7/ios7_common.h b/backends/platform/ios7/ios7_common.h index b7a47eda8a..a32a59a541 100644 --- a/backends/platform/ios7/ios7_common.h +++ b/backends/platform/ios7/ios7_common.h @@ -25,6 +25,9 @@ #include "graphics/surface.h" +// #define ENABLE_IOS7_SCALERS + + enum InputEvent { kInputMouseDown, kInputMouseUp, -- cgit v1.2.3