[Scummvm-cvs-logs] SF.net SVN: scummvm:[36329] scummvm/branches/branch-0-13-0

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Sat Feb 14 16:21:52 CET 2009


Revision: 36329
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36329&view=rev
Author:   vinterstum
Date:     2009-02-14 15:21:52 +0000 (Sat, 14 Feb 2009)

Log Message:
-----------
Updated iPhone backend to be more compatible with the standard unofficial SDK

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_main.m
    scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.h
    scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.m
    scummvm/branches/branch-0-13-0/backends/platform/iphone/osys_iphone.cpp
    scummvm/branches/branch-0-13-0/configure

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_main.m
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_main.m	2009-02-14 14:33:26 UTC (rev 36328)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_main.m	2009-02-14 15:21:52 UTC (rev 36329)
@@ -51,7 +51,7 @@
     ];
 
     UIApplicationUseLegacyEvents(1);
-    int returnCode = UIApplicationMain(argc, argv, [iPhoneMain class]);
+    int returnCode = UIApplicationMain(argc, argv, nil, @"iPhoneMain");
     [ autoreleasePool release ];
     return returnCode;
 }
@@ -69,22 +69,24 @@
 	[[NSAutoreleasePool alloc] init];
 
 	iphone_main(gArgc, gArgv);
-	[UIApp terminate];
+	exit(0);
 }
 
 - (iPhoneView*) getView {
 	return _view;
 }
 
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+	CGRect  rect = [[UIScreen mainScreen] bounds];
+
 	// hide the status bar
-	[UIHardware _setStatusBarHeight:0.0f];
-	[self setStatusBarHidden:YES animated:NO];
+    [application setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
+    [application setStatusBarHidden:YES animated:YES];
 
-	_window = [[UIWindow alloc] initWithContentRect:  [UIHardware fullScreenApplicationContentRect]];
+	_window = [[UIWindow alloc] initWithFrame:rect];
 	[_window retain];
 
-	_view = [[iPhoneView alloc] initWithFrame:  [UIHardware fullScreenApplicationContentRect]];
+	_view = [[iPhoneView alloc] initWithFrame: rect];	
 	[_window setContentView: _view];
 
 	[_window orderFront: self];
@@ -93,23 +95,23 @@
 	[NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil];
 }
 
-- (void)applicationSuspend:(GSEventRef)event {
+- (void)applicationSuspend:(struct __GSEvent *)event {
 	[self setApplicationBadge:NSLocalizedString(@"ON", nil)];
 	[_view applicationSuspend];
 }
 
-- (void)applicationResume:(GSEventRef)event {
+- (void)applicationResume:(struct __GSEvent *)event {
 	[self removeApplicationBadge];
 	[_view applicationResume];
 	
 	// Workaround, need to "hide" and unhide the statusbar to properly remove it,
 	// since the Springboard has put it back without apparently flagging our application.
-	[self setStatusBarHidden:NO animated:NO]; // hide status bar
-	[UIHardware _setStatusBarHeight:0.0f];
-	[self setStatusBarHidden:YES animated:NO]; // hide status bar
+    [self setStatusBarHidden:YES animated:YES];
+    [self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
+    [self setStatusBarHidden:YES animated:YES];
 }
 
-- (void)deviceOrientationChanged:(GSEvent *)event {
+- (void)deviceOrientationChanged:(struct __GSEvent *)event {
 	int screenOrientation = GSEventDeviceOrientation(event);
 	[_view deviceOrientationChanged: screenOrientation];
 }

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.h
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.h	2009-02-14 14:33:26 UTC (rev 36328)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.h	2009-02-14 15:21:52 UTC (rev 36329)
@@ -27,7 +27,6 @@
 #define _IPHONE_VIDEO__H
 
 #import <UIKit/UIKit.h>
-#import <GraphicsServices/GraphicsServices.h>
 #import <Foundation/Foundation.h>
 #import <CoreSurface/CoreSurface.h>
 

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.m
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.m	2009-02-14 14:33:26 UTC (rev 36328)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/iphone_video.m	2009-02-14 15:21:52 UTC (rev 36329)
@@ -27,11 +27,9 @@
 #include "iphone_common.h"
 
 #import <UIKit/UIKit.h>
-#import <UIKit/UIView-Geometry.h>
 #import <GraphicsServices/GraphicsServices.h>
 #import <Foundation/Foundation.h>
 #import <CoreSurface/CoreSurface.h>
-#import <UIKit/UIKeyboardLayoutQWERTY.h>
 #import <QuartzCore/QuartzCore.h>
 
 static iPhoneView *sharedInstance = nil;
@@ -278,10 +276,10 @@
 	];
 }
 
-- (void)mouseDown:(GSEvent*)event {
+- (void)mouseDown:(struct __GSEvent *)event {
 	//printf("mouseDown()\n");
-	CGRect rect = GSEventGetLocationInWindow(event);
-	CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+	CGPoint point = GSEventGetLocationInWindow(event);
+	point = [self convertPoint:point fromView:nil];
 	
 	if (!getLocalMouseCoords(&point))
 		return;
@@ -300,10 +298,10 @@
 	//printf("touchesBegan()\n");	
 }
 	
-- (void)mouseUp:(GSEvent*)event {
+- (void)mouseUp:(struct __GSEvent *)event {
 	//printf("mouseUp()\n");
-	CGRect rect = GSEventGetLocationInWindow(event);
-	CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+	CGPoint point = GSEventGetLocationInWindow(event);
+	point = [self convertPoint:point fromView:nil];
 	
 	if (!getLocalMouseCoords(&point))
 		return;
@@ -318,10 +316,10 @@
 	];
 }
 
-- (void)mouseDragged:(GSEvent*)event {
+- (void)mouseDragged:(struct __GSEvent *)event {
 	//printf("mouseDragged()\n");
-	CGRect rect = GSEventGetLocationInWindow(event);
-	CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+	CGPoint point = GSEventGetLocationInWindow(event);
+	point = [self convertPoint:point fromView:nil];
 	
 	if (!getLocalMouseCoords(&point))
 		return;
@@ -336,10 +334,10 @@
 	];
 }
 
-- (void)mouseEntered:(GSEvent*)event {
+- (void)mouseEntered:(struct __GSEvent *)event {
 	//printf("mouseEntered()\n");
-	CGRect rect = GSEventGetLocationInWindow(event);
-	CGPoint point = CGPointMake(rect.origin.x, rect.origin.y);
+	CGPoint point = GSEventGetLocationInWindow(event);
+	point = [self convertPoint:point fromView:nil];
 
 	
 	if (!getLocalMouseCoords(&point))
@@ -355,7 +353,7 @@
 	];
 }
 
-- (void)mouseExited:(GSEvent*)event {
+- (void)mouseExited:(struct __GSEvent *)event {
 	//printf("mouseExited().\n");
 	// [self addEvent:
 	//	[[NSDictionary alloc] initWithObjectsAndKeys:
@@ -365,7 +363,7 @@
 	// ];
 }
 
-- (void)mouseMoved:(GSEvent*)event
+- (void)mouseMoved:(struct __GSEvent *)event
 {
 	//printf("mouseMoved()\n");
 	// struct CGPoint point = GSEventGetLocationInWindow(event);
@@ -411,7 +409,7 @@
 	];
 }
 
-- (void)view:(UIView *)view handleTapWithCount:(int)count event:(GSEvent *)event fingerCount:(int)fingerCount{
+- (void)view:(UIView *)view handleTapWithCount:(int)count event:(struct __GSEvent *)event fingerCount:(int)fingerCount{
 	//printf("handleTapWithCount(%i, %i)\n", count, fingerCount);
 }
 

Modified: scummvm/branches/branch-0-13-0/backends/platform/iphone/osys_iphone.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/iphone/osys_iphone.cpp	2009-02-14 14:33:26 UTC (rev 36328)
+++ scummvm/branches/branch-0-13-0/backends/platform/iphone/osys_iphone.cpp	2009-02-14 15:21:52 UTC (rev 36329)
@@ -180,7 +180,7 @@
 	const byte *b = colors;
 
 	for (uint i = start; i < start + num; ++i) {
-		_palette[i] = Graphics::RGBToColor<ColorMasks<565> >(b[0], b[1], b[2]);
+		_palette[i] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(b[0], b[1], b[2]);
 		b += 4;
 	}
 

Modified: scummvm/branches/branch-0-13-0/configure
===================================================================
--- scummvm/branches/branch-0-13-0/configure	2009-02-14 14:33:26 UTC (rev 36328)
+++ scummvm/branches/branch-0-13-0/configure	2009-02-14 15:21:52 UTC (rev 36329)
@@ -1765,7 +1765,7 @@
 		;;
 	iphone)
 		OBJCFLAGS="$OBJCFLAGS --std=c99"
-		LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework CoreSurface -framework LayerKit -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio"
+		LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreSurface -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio"
 		DEFINES="$DEFINES -DIPHONE_BACKEND"
 		MODULES="$MODULES backends/platform/iphone"
 		;;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list