[Scummvm-cvs-logs] scummvm master -> 1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419

vinterstum oystein at geheb.com
Sun Jun 5 06:05:14 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1d3be279fc IPHONE: Fixed a COMI crash and some minor gfx glitches


Commit: 1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419
    https://github.com/scummvm/scummvm/commit/1d3be279fce1f9af7e4db3ec1e8b3b9e18acb419
Author: Oystein Eftevaag (oystein at geheb.com)
Date: 2011-06-04T21:03:15-07:00

Commit Message:
IPHONE: Fixed a COMI crash and some minor gfx glitches

Changed paths:
    backends/platform/iphone/iphone_video.h
    backends/platform/iphone/iphone_video.m
    backends/platform/iphone/osys_video.cpp



diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h
index 8e0ffc1..223f025 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 006603d..04d25ce 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 263cbd2..fa425b1 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 {






More information about the Scummvm-git-logs mailing list