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_video.h | 109 ++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 backends/platform/ios7/ios7_video.h (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h new file mode 100644 index 0000000000..63a570d19d --- /dev/null +++ b/backends/platform/ios7/ios7_video.h @@ -0,0 +1,109 @@ +/* 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_VIDEO_H +#define BACKENDS_PLATFORM_IPHONE_IPHONE_VIDEO_H + +#include +#include +#include + +#include +#include +#include + +#include "ios7_keyboard.h" +#include "ios7_common.h" + +#include "common/list.h" + +@interface iPhoneView : UIView { + VideoContext _videoContext; + + Common::List _events; + NSLock *_eventLock; + SoftKeyboard *_keyboardView; + + EAGLContext *_context; + GLuint _viewRenderbuffer; + GLuint _viewFramebuffer; + GLuint _screenTexture; + GLuint _overlayTexture; + GLuint _mouseCursorTexture; + + GLint _renderBufferWidth; + GLint _renderBufferHeight; + + GLfloat _gameScreenVertCoords[4 * 2]; + GLfloat _gameScreenTexCoords[4 * 2]; + CGRect _gameScreenRect; + + GLfloat _overlayVertCoords[4 * 2]; + GLfloat _overlayTexCoords[4 * 2]; + CGRect _overlayRect; + + GLfloat _mouseVertCoords[4 * 2]; + GLfloat _mouseTexCoords[4 * 2]; + GLint _mouseHotspotX, _mouseHotspotY; + GLint _mouseWidth, _mouseHeight; + GLfloat _mouseScaleX, _mouseScaleY; + + int _scaledShakeOffsetY; + CGFloat _contentScaleFactor; + + UITouch *_firstTouch; + UITouch *_secondTouch; +} + +- (id)initWithFrame:(struct CGRect)frame; + +- (VideoContext *)getVideoContext; + +- (void)createScreenTexture; +- (void)initSurface; +- (void)setViewTransformation; + +- (void)setGraphicsMode; + +- (void)updateSurface; +- (void)updateMainSurface; +- (void)updateOverlaySurface; +- (void)updateMouseSurface; +- (void)clearColorBuffer; + +- (void)notifyMouseMove; +- (void)updateMouseCursorScaling; +- (void)updateMouseCursor; + +- (void)deviceOrientationChanged:(UIDeviceOrientation)orientation; + +- (void)applicationSuspend; + +- (void)applicationResume; + +- (bool)fetchEvent:(InternalEvent *)event; + +@end + +extern iPhoneView *g_iPhoneViewInstance; + +#endif -- cgit v1.2.3 From dd950fdb22dcc3d4be06ed416c09b6fb438144c4 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 8 Dec 2015 11:04:04 +0100 Subject: IOS: Removes a global variable --- backends/platform/ios7/ios7_video.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h index 63a570d19d..09a84b5498 100644 --- a/backends/platform/ios7/ios7_video.h +++ b/backends/platform/ios7/ios7_video.h @@ -104,6 +104,4 @@ @end -extern iPhoneView *g_iPhoneViewInstance; - #endif -- 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_video.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h index 09a84b5498..96a0984882 100644 --- a/backends/platform/ios7/ios7_video.h +++ b/backends/platform/ios7/ios7_video.h @@ -35,6 +35,7 @@ #include "ios7_common.h" #include "common/list.h" +#import "graphics/scaler.h" @interface iPhoneView : UIView { VideoContext _videoContext; @@ -72,6 +73,13 @@ UITouch *_firstTouch; UITouch *_secondTouch; + + uint8_t *_scalerMemorySrc; + uint8_t *_scalerMemoryDst; + size_t _scalerMemorySrcSize; + size_t _scalerMemoryDstSize; + int _scalerScale; + ScalerProc *_scaler; } - (id)initWithFrame:(struct CGRect)frame; -- cgit v1.2.3 From 7324f87b9af3a5f2da9d84dad5f2e6df26e1ddb2 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Thu, 10 Dec 2015 15:49:00 +0100 Subject: IOS: Switches to OpenGL ES 2.0 to ease debugging with Xcode --- backends/platform/ios7/ios7_video.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h index 96a0984882..bed552c7cf 100644 --- a/backends/platform/ios7/ios7_video.h +++ b/backends/platform/ios7/ios7_video.h @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include #include "ios7_keyboard.h" #include "ios7_common.h" @@ -37,6 +37,11 @@ #include "common/list.h" #import "graphics/scaler.h" +typedef struct { + GLfloat x, y; + GLfloat u,v; +} GLVertex; + @interface iPhoneView : UIView { VideoContext _videoContext; @@ -51,19 +56,29 @@ GLuint _overlayTexture; GLuint _mouseCursorTexture; + GLuint _vertexShader; + GLuint _fragmentShader; + + GLuint _vertexBuffer; + + GLuint _screenSizeSlot; + GLuint _textureSlot; + GLuint _shakeSlot; + + GLuint _positionSlot; + GLuint _textureCoordSlot; + GLint _renderBufferWidth; GLint _renderBufferHeight; - GLfloat _gameScreenVertCoords[4 * 2]; - GLfloat _gameScreenTexCoords[4 * 2]; + GLVertex _gameScreenCoords[4]; CGRect _gameScreenRect; - GLfloat _overlayVertCoords[4 * 2]; - GLfloat _overlayTexCoords[4 * 2]; + GLVertex _overlayCoords[4]; CGRect _overlayRect; - GLfloat _mouseVertCoords[4 * 2]; - GLfloat _mouseTexCoords[4 * 2]; + GLVertex _mouseCoords[4]; + GLint _mouseHotspotX, _mouseHotspotY; GLint _mouseWidth, _mouseHeight; GLfloat _mouseScaleX, _mouseScaleY; -- cgit v1.2.3 From cfcd3842ed0b46c1eeb7d1e490a882e5d3f26441 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Thu, 10 Dec 2015 18:44:31 +0100 Subject: IOS: Adds iPhone 6/6+ launch screens --- backends/platform/ios7/ios7_video.h | 1 - 1 file changed, 1 deletion(-) (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h index bed552c7cf..799cd21a94 100644 --- a/backends/platform/ios7/ios7_video.h +++ b/backends/platform/ios7/ios7_video.h @@ -84,7 +84,6 @@ typedef struct { GLfloat _mouseScaleX, _mouseScaleY; int _scaledShakeOffsetY; - CGFloat _contentScaleFactor; UITouch *_firstTouch; UITouch *_secondTouch; -- 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_video.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/platform/ios7/ios7_video.h') diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h index 799cd21a94..ab261a977b 100644 --- a/backends/platform/ios7/ios7_video.h +++ b/backends/platform/ios7/ios7_video.h @@ -88,12 +88,14 @@ typedef struct { UITouch *_firstTouch; UITouch *_secondTouch; +#ifdef ENABLE_IOS7_SCALERS uint8_t *_scalerMemorySrc; uint8_t *_scalerMemoryDst; size_t _scalerMemorySrcSize; size_t _scalerMemoryDstSize; int _scalerScale; ScalerProc *_scaler; +#endif } - (id)initWithFrame:(struct CGRect)frame; -- cgit v1.2.3