aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/iphone
diff options
context:
space:
mode:
authorJohannes Schickel2012-02-23 02:08:12 +0100
committerJohannes Schickel2012-02-23 02:09:27 +0100
commitab15435ad0aac842ab8321b833cae4e7459df01d (patch)
tree0401f710f1396e37c4b389f353fce74feda64991 /backends/platform/iphone
parente1edb20fed788aafc70f70448957b03b4f8f237d (diff)
downloadscummvm-rg350-ab15435ad0aac842ab8321b833cae4e7459df01d.tar.gz
scummvm-rg350-ab15435ad0aac842ab8321b833cae4e7459df01d.tar.bz2
scummvm-rg350-ab15435ad0aac842ab8321b833cae4e7459df01d.zip
IPHONE: Move overlay visibility status to VideoContext.
Diffstat (limited to 'backends/platform/iphone')
-rw-r--r--backends/platform/iphone/iphone_common.h3
-rw-r--r--backends/platform/iphone/iphone_video.mm12
2 files changed, 8 insertions, 7 deletions
diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h
index 044b279386..2696888f87 100644
--- a/backends/platform/iphone/iphone_common.h
+++ b/backends/platform/iphone/iphone_common.h
@@ -60,6 +60,7 @@ struct VideoContext {
int screenWidth, screenHeight;
// Overlay state
+ bool overlayVisible;
int overlayWidth, overlayHeight;
// Mouse cursor state
@@ -85,7 +86,7 @@ const char *iPhone_getDocumentsDir();
bool iPhone_isHighResDevice();
int iPhone_getScreenHeight();
int iPhone_getScreenWidth();
-void iPhone_enableOverlay(int state);
+void iPhone_enableOverlay(bool state);
void iPhone_showCursor(int state);
void iPhone_setMouseCursor(unsigned short *buffer, int width, int height, int hotspotX, int hotspotY);
diff --git a/backends/platform/iphone/iphone_video.mm b/backends/platform/iphone/iphone_video.mm
index e461691454..a4de970420 100644
--- a/backends/platform/iphone/iphone_video.mm
+++ b/backends/platform/iphone/iphone_video.mm
@@ -37,7 +37,6 @@ static int _overlayTexHeight = 0;
static CGRect _overlayRect;
static int _needsScreenUpdate = 0;
-static int _overlayIsEnabled = 0;
static UITouch *_firstTouch = NULL;
static UITouch *_secondTouch = NULL;
@@ -93,8 +92,8 @@ void iPhone_setMouseCursor(unsigned short *buffer, int width, int height, int ho
[sharedInstance performSelectorOnMainThread:@selector(updateMouseCursor) withObject:nil waitUntilDone: YES];
}
-void iPhone_enableOverlay(int state) {
- _overlayIsEnabled = state;
+void iPhone_enableOverlay(bool state) {
+ _videoContext.overlayVisible = state;
[sharedInstance performSelectorOnMainThread:@selector(clearColorBuffer) withObject:nil waitUntilDone: YES];
}
@@ -272,6 +271,7 @@ const char *iPhone_getDocumentsDir() {
_mouseCursorTexture = 0;
_videoContext.graphicsMode = kGraphicsModeLinear;
+ _videoContext.overlayVisible = false;
_gameScreenVertCoords[0] = _gameScreenVertCoords[1] =
_gameScreenVertCoords[2] = _gameScreenVertCoords[3] =
@@ -363,7 +363,7 @@ const char *iPhone_getDocumentsDir() {
[self updateMainSurface];
- if (_overlayIsEnabled)
+ if (_videoContext.overlayVisible)
[self updateOverlaySurface];
if (_videoContext.mouseIsVisible)
@@ -422,7 +422,7 @@ const char *iPhone_getDocumentsDir() {
CGRect *rect;
int maxWidth, maxHeight;
- if (!_overlayIsEnabled) {
+ if (!_videoContext.overlayVisible) {
rect = &_gameScreenRect;
maxWidth = _videoContext.screenWidth;
maxHeight = _videoContext.screenHeight;
@@ -695,7 +695,7 @@ const char *iPhone_getDocumentsDir() {
CGRect *area;
int width, height, offsetY;
- if (_overlayIsEnabled) {
+ if (_videoContext.overlayVisible) {
area = &_overlayRect;
width = _videoContext.overlayWidth;
height = _videoContext.overlayHeight;