2007-11-13 08:06:15 +00:00
|
|
|
/* 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.
|
2014-02-18 02:34:21 +01:00
|
|
|
*
|
2007-11-13 08:06:15 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:21 +01:00
|
|
|
*
|
2007-11-13 08:06:15 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-02-19 21:44:37 +01:00
|
|
|
#ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H
|
|
|
|
#define BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H
|
|
|
|
|
2012-02-23 21:20:24 +01:00
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
2007-11-13 08:06:15 +00:00
|
|
|
enum InputEvent {
|
|
|
|
kInputMouseDown,
|
|
|
|
kInputMouseUp,
|
|
|
|
kInputMouseDragged,
|
2009-04-18 13:52:30 +00:00
|
|
|
kInputMouseSecondDragged,
|
|
|
|
kInputMouseSecondDown,
|
|
|
|
kInputMouseSecondUp,
|
2007-11-18 17:58:53 +00:00
|
|
|
kInputOrientationChanged,
|
2007-11-25 09:37:15 +00:00
|
|
|
kInputKeyPressed,
|
|
|
|
kInputApplicationSuspended,
|
2008-01-02 00:07:16 +00:00
|
|
|
kInputApplicationResumed,
|
|
|
|
kInputSwipe
|
2007-11-13 08:06:15 +00:00
|
|
|
};
|
|
|
|
|
2007-12-31 00:22:37 +00:00
|
|
|
enum ScreenOrientation {
|
|
|
|
kScreenOrientationPortrait,
|
|
|
|
kScreenOrientationLandscape,
|
|
|
|
kScreenOrientationFlippedLandscape
|
|
|
|
};
|
|
|
|
|
2012-02-19 21:18:17 +01:00
|
|
|
enum UIViewSwipeDirection {
|
2008-01-02 00:07:16 +00:00
|
|
|
kUIViewSwipeUp = 1,
|
|
|
|
kUIViewSwipeDown = 2,
|
|
|
|
kUIViewSwipeLeft = 4,
|
|
|
|
kUIViewSwipeRight = 8
|
2012-02-19 21:18:17 +01:00
|
|
|
};
|
2008-01-02 00:07:16 +00:00
|
|
|
|
2012-02-22 02:30:44 +01:00
|
|
|
enum GraphicsModes {
|
2012-02-20 02:32:10 +01:00
|
|
|
kGraphicsModeLinear = 0,
|
|
|
|
kGraphicsModeNone = 1
|
2012-02-22 02:30:44 +01:00
|
|
|
};
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2012-02-23 02:04:40 +01:00
|
|
|
struct VideoContext {
|
2012-02-24 22:43:02 +01:00
|
|
|
VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false),
|
2012-02-23 20:59:26 +01:00
|
|
|
overlayWidth(), overlayHeight(), mouseX(), mouseY(),
|
|
|
|
mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(),
|
|
|
|
mouseIsVisible(), graphicsMode(kGraphicsModeLinear), shakeOffsetY() {
|
|
|
|
}
|
|
|
|
|
2012-02-23 02:04:40 +01:00
|
|
|
// Game screen state
|
2012-02-24 22:43:02 +01:00
|
|
|
bool asprectRatioCorrection;
|
2012-02-23 02:26:54 +01:00
|
|
|
uint screenWidth, screenHeight;
|
2012-02-23 21:20:24 +01:00
|
|
|
Graphics::Surface screenTexture;
|
2012-02-23 02:04:40 +01:00
|
|
|
|
|
|
|
// Overlay state
|
2012-02-23 02:08:12 +01:00
|
|
|
bool overlayVisible;
|
2012-02-23 02:26:54 +01:00
|
|
|
uint overlayWidth, overlayHeight;
|
2012-02-23 21:20:24 +01:00
|
|
|
Graphics::Surface overlayTexture;
|
2012-02-23 02:04:40 +01:00
|
|
|
|
|
|
|
// Mouse cursor state
|
2012-02-23 02:26:54 +01:00
|
|
|
uint mouseX, mouseY;
|
2012-02-23 02:04:40 +01:00
|
|
|
int mouseHotspotX, mouseHotspotY;
|
2012-02-23 02:26:54 +01:00
|
|
|
uint mouseWidth, mouseHeight;
|
2012-02-23 02:04:40 +01:00
|
|
|
bool mouseIsVisible;
|
2012-02-24 00:55:52 +01:00
|
|
|
Graphics::Surface mouseTexture;
|
2012-02-23 02:04:40 +01:00
|
|
|
|
|
|
|
// Misc state
|
|
|
|
GraphicsModes graphicsMode;
|
|
|
|
int shakeOffsetY;
|
|
|
|
};
|
|
|
|
|
2012-04-02 00:02:31 +02:00
|
|
|
struct InternalEvent {
|
|
|
|
InternalEvent() : type(), value1(), value2() {}
|
|
|
|
InternalEvent(InputEvent t, int v1, int v2) : type(t), value1(v1), value2(v2) {}
|
|
|
|
|
|
|
|
InputEvent type;
|
|
|
|
int value1, value2;
|
|
|
|
};
|
|
|
|
|
2007-11-13 08:06:15 +00:00
|
|
|
// On the ObjC side
|
2012-02-23 03:13:09 +01:00
|
|
|
void iPhone_updateScreen();
|
2012-04-02 00:02:31 +02:00
|
|
|
bool iPhone_fetchEvent(InternalEvent *event);
|
2012-02-19 21:18:17 +01:00
|
|
|
const char *iPhone_getDocumentsDir();
|
2010-06-03 03:22:10 +00:00
|
|
|
bool iPhone_isHighResDevice();
|
2010-09-29 00:19:13 +00:00
|
|
|
|
|
|
|
uint getSizeNextPOT(uint size);
|
2009-05-24 15:17:42 +00:00
|
|
|
|
2012-02-19 21:44:37 +01:00
|
|
|
#endif
|