aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOystein Eftevaag2011-06-04 23:34:12 -0400
committerOystein Eftevaag2011-06-05 00:03:15 -0400
commit1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419 (patch)
tree13aefb24dc241c58683d0816f12ec908ed331bee
parent66c982b38ce9463daad621f8129dd97e0bb1a6ce (diff)
downloadscummvm-rg350-1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419.tar.gz
scummvm-rg350-1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419.tar.bz2
scummvm-rg350-1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419.zip
IPHONE: Fixed a COMI crash and some minor gfx glitches
-rw-r--r--backends/platform/iphone/iphone_video.h1
-rw-r--r--backends/platform/iphone/iphone_video.m18
-rw-r--r--backends/platform/iphone/osys_video.cpp3
3 files changed, 15 insertions, 7 deletions
diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h
index 8e0ffc19cb..223f025978 100644
--- a/backends/platform/iphone/iphone_video.h
+++ b/backends/platform/iphone/iphone_video.h
@@ -67,6 +67,7 @@
- (void)updateMainSurface;
- (void)updateOverlaySurface;
- (void)updateMouseSurface;
+- (void)clearColorBuffer;
-(void)updateMouseCursor;
diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m
index 006603df64..04d25cebf8 100644
--- a/backends/platform/iphone/iphone_video.m
+++ b/backends/platform/iphone/iphone_video.m
@@ -85,6 +85,8 @@ void iPhone_setMouseCursor(short* buffer, int width, int height) {
void iPhone_enableOverlay(int state) {
_overlayIsEnabled = state;
+
+ [sharedInstance performSelectorOnMainThread:@selector(clearColorBuffer) withObject:nil waitUntilDone: YES];
}
int iPhone_getScreenHeight() {
@@ -478,12 +480,7 @@ bool getLocalMouseCoords(CGPoint *point) {
glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError();
- // The color buffer is triple-buffered, so we clear it multiple times right away to avid doing any glClears later.
- int clearCount = 5;
- while (clearCount-- > 0) {
- glClear(GL_COLOR_BUFFER_BIT); printOpenGLError();
- [_context presentRenderbuffer:GL_RENDERBUFFER_OES];
- }
+ [self clearColorBuffer];
if (_keyboardView != nil) {
[_keyboardView removeFromSuperview];
@@ -535,6 +532,15 @@ bool getLocalMouseCoords(CGPoint *point) {
}
}
+- (void)clearColorBuffer {
+ // The color buffer is triple-buffered, so we clear it multiple times right away to avid doing any glClears later.
+ int clearCount = 5;
+ while (clearCount-- > 0) {
+ glClear(GL_COLOR_BUFFER_BIT); printOpenGLError();
+ [_context presentRenderbuffer:GL_RENDERBUFFER_OES];
+ }
+}
+
- (id)getEvent {
if (_events == nil || [_events count] == 0) {
return nil;
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index 263cbd2bcc..fa425b108a 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -349,6 +349,7 @@ void OSystem_IPHONE::showOverlay() {
//printf("showOverlay()\n");
_overlayVisible = true;
dirtyFullOverlayScreen();
+ updateScreen();
iPhone_enableOverlay(true);
}
@@ -368,7 +369,7 @@ void OSystem_IPHONE::clearOverlay() {
void OSystem_IPHONE::grabOverlay(OverlayColor *buf, int pitch) {
//printf("grabOverlay()\n");
- int h = _screenHeight;
+ int h = _overlayHeight;
OverlayColor *src = _overlayBuffer;
do {