updaed for iOS6

This commit is contained in:
Michael Nguyen
2013-10-28 15:20:35 -07:00
parent 4eb1fd35e0
commit 84ca7457b5
86 changed files with 304 additions and 14535 deletions

View File

@@ -32,12 +32,12 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
NSLog(@"Download Core files failed. Retrying... ");
[self.downloadMessageStatus setText: @"Download Core files failed. Retrying... "];
UIAlertView *noNetworkConnectionAlert = [[UIAlertView alloc] initWithTitle: @"No Network Connection" message: @"Internet connection not found. Download can not continue until it is restored. Restore Wifi or Cellular connection and retry" delegate: self cancelButtonTitle: @"Retry Download" otherButtonTitles: nil];
[self.view addSubview: noNetworkConnectionAlert];
[noNetworkConnectionAlert show];
[noNetworkConnectionAlert release];
UIAlertView *noNetworkConnectionAlert = [[UIAlertView alloc] initWithTitle: @"No Network Connection" message: @"Internet connection not found. Download can not continue until it is restored. Restore Wifi or Cellular connection and retry" delegate: self cancelButtonTitle: @"Retry Download" otherButtonTitles: nil];
[self.view addSubview: noNetworkConnectionAlert];
[noNetworkConnectionAlert show];
[noNetworkConnectionAlert release];
}
}
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
@@ -55,19 +55,19 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
- (void) startDownload: (NSString *) downloadType
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self.downloadMessageStatus performSelectorOnMainThread:@selector(setText:) withObject:[NSString stringWithFormat: @"Please wait while the %@ files are being downloaded.", downloadType] waitUntilDone: NO ];
if ( downloadProgressView != nil )
{
[downloadProgressView removeFromSuperview];
[downloadProgressView release], downloadProgressView = nil;
}
downloadProgressView = [[UIProgressView alloc] initWithProgressViewStyle: UIProgressViewStyleDefault];
[self.downloadProgressView setFrame: CGRectMake(0, 0, 250, 50)];
[self.downloadProgressView setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ];
[self.view addSubview: downloadProgressView];
[self handleRotation: self.interfaceOrientation];
@@ -78,7 +78,7 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
NSError *error = nil;
// make sure Res directory exists
if ( ![[NSFileManager defaultManager] fileExistsAtPath: systemResourceDirectory] )
if ( ![[NSFileManager defaultManager] fileExistsAtPath: systemResourceDirectory] )
[[NSFileManager defaultManager] createDirectoryAtPath:systemResourceDirectory withIntermediateDirectories: YES attributes:nil error: &error];
if (error != nil)
@@ -86,7 +86,7 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
NSLog(@"Error in creating System Directory! %@", [error localizedDescription]);
error = nil;
}
// make sure the User directory exists as well
if ( ![[NSFileManager defaultManager] fileExistsAtPath: userResourceDirectory] )
[[NSFileManager defaultManager] createDirectoryAtPath: userResourceDirectory withIntermediateDirectories: YES attributes:nil error: &error];
@@ -96,10 +96,10 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
NSLog(@"Error in creating User Directory! %@", [error localizedDescription]);
error = nil;
}
// if an error occurred while creating the directory, game can't really run so do something
// TODO: throw out a notification and deal with error
NSURL *url = nil;
NSString *downloadFilename = nil;
// determine which file to download
@@ -119,11 +119,11 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
NSLog( @"Not Implemented for type: %@", downloadType);
}
url = [NSURL URLWithString: [NSString stringWithFormat: @"%@/%@", kDownloadUrlPath, downloadFilename]];
url = [NSURL URLWithString: [NSString stringWithFormat: @"%@/%@", kDownloadUrlPath, downloadFilename]];
NSString *downloadFilePath = [systemResourceDirectory stringByAppendingString: [NSString stringWithFormat: @"/%@", downloadFilename]];
NSLog(@"Downloading %@", [url absoluteURL]);
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setTemporaryFileDownloadPath: [NSString stringWithFormat: @"%@/%@.tmp", systemResourceDirectory, downloadFilename]];
@@ -131,9 +131,9 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
[request setDownloadProgressDelegate: downloadProgressView];
[request setShouldContinueWhenAppEntersBackground: YES];
[request setAllowCompressedResponse: YES];
[request setCompletionBlock:^{
wagicAppDelegate *appDelegate = (wagicAppDelegate *)[[UIApplication sharedApplication] delegate];
wagicAppDelegate *appDelegate = (wagicAppDelegate *)[[UIApplication sharedApplication] delegate];
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
NSLog(@"Saving to %@", downloadFilePath);
[dnc postNotificationName: [NSString stringWithFormat: @"%@Complete", downloadType] object: appDelegate];
@@ -150,11 +150,11 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
// post a notification that a download error has occurred.
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
[dnc postNotificationName:@"fileDownloadFailed" object: downloadType];
}];
[request startAsynchronous];
[pool drain], pool = nil;
}
@@ -166,9 +166,9 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
[downloadProgressView release], downloadProgressView = nil;
if (downloadMessageStatus)
[downloadMessageStatus release], downloadMessageStatus = nil;
[super dealloc];
}
- (id) init
@@ -185,7 +185,7 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
[[self view] setBackgroundColor: [UIColor clearColor]];
// Initialization code
downloadMessageStatus = [[UITextView alloc] initWithFrame: CGRectMake(0, 0, 320, 320)];
downloadMessageStatus = [[UITextView alloc] initWithFrame: CGRectMake(0, 0, 320, 320)];
[self.downloadMessageStatus setBackgroundColor:[UIColor clearColor]];
[downloadMessageStatus setEditable: NO];
[self.view setBackgroundColor:[UIColor clearColor]];
@@ -194,12 +194,12 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
self.downloadMessageStatus.clipsToBounds = YES;
self.downloadMessageStatus.layer.cornerRadius = 10.0f;
[self.downloadMessageStatus setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ];
if (isPhone)
[self.downloadMessageStatus setFont: [UIFont systemFontOfSize: 20]];
else
[self.downloadMessageStatus setFont: [UIFont systemFontOfSize: 35]];
[self.view addSubview: downloadMessageStatus];
}
@@ -209,11 +209,11 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
#pragma mark - Application Lifecycle
- (void) didReceiveMemoryWarning
- (void) didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Relinquish ownership any cached data, images, etc that aren't in use.
}
@@ -287,30 +287,36 @@ static NSString *kDownloadUrlPath = @"http://wagic.googlecode.com/files/";
[appDelegate rotateBackgroundImage: self.interfaceOrientation toInterfaceOrientation: toInterfaceOrientation];
}
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
bool isPhone = (UI_USER_INTERFACE_IDIOM()) == UIUserInterfaceIdiomPhone;
BOOL rotateDevice = !((interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
|| (interfaceOrientation == UIInterfaceOrientationPortrait));
BOOL rotateDevice = UIInterfaceOrientationIsPortrait(interfaceOrientation);
if (isPhone)
return rotateDevice;
return YES;
return YES;
}
-(BOOL)shouldAutorotate {
return YES;
}
-(NSUInteger)supportedInterfaceOrientations {
return [self.navigationController.topViewController supportedInterfaceOrientations];
}
#pragma mark -
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end

View File

@@ -86,7 +86,7 @@ void InteractiveButton::Render()
{
renderer->RenderQuad(buttonImage.get(), buttonXOffset - buttonImage.get()->mWidth/2, buttonYOffset + mainFontHeight/2, 0, pspIconsSize, pspIconsSize);
}
mainFont->SetColor(ARGB(255, 200, 200, 200));
mainFont->SetColor(ARGB(255, 0, 0, 0));
mainFont->DrawString(detailedInfoString, buttonXOffset, buttonYOffset);
}

View File

@@ -285,6 +285,8 @@
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; };
75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; };
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; };
CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9A477612B514BA00C9F38A /* EAGLView.m */; };
CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9A477812B514BA00C9F38A /* EAGLViewController.m */; };
@@ -576,6 +578,8 @@
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; };
8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
CE8B8A231299C22900A3CDEF /* DebugRoutines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugRoutines.h; sourceTree = "<group>"; };
CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = SimplePopup.cpp; sourceTree = "<group>"; };
@@ -1076,6 +1080,8 @@
128FB96A149537A600ED4EE6 /* Images */ = {
isa = PBXGroup;
children = (
75D209D1181D54FD009916AC /* Default-568h@2x.png */,
75D209D2181D54FD009916AC /* wagic-80x80.png */,
12211ED21494916D00641703 /* Default-Landscape.png */,
12211ED31494916D00641703 /* Default-Portrait.png */,
12211ED01494823E00641703 /* Default@2x.png */,
@@ -1761,7 +1767,9 @@
12B8123C1404B9E20092E303 /* zfs.vcxproj.filters in Resources */,
129654D6148AA23A0031100B /* modrules.xml in Resources */,
128ED37C148BAE7B00C58E83 /* README.txt in Resources */,
75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */,
12211ECB1494811D00641703 /* Default.png in Resources */,
75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */,
12211ECD149481B600641703 /* Default-Landscape~ipad.png in Resources */,
12211ECF149481C400641703 /* Default-Portrait~ipad.png in Resources */,
12211ED11494823F00641703 /* Default@2x.png in Resources */,