Permalink
Browse files

Merge branch 'develop' into merge_1.4.1

Backport of bug fixes in develop
  • Loading branch information...
2 parents 5bcbeff + 8136b98 commit ead1ceca272e93dbeaccdd322279a9bd08225036 @DylanSale DylanSale committed May 30, 2012
@@ -83,7 +83,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}
- self.currentProject = [[Project alloc] initWithPath:destPath validFileTypes:[NSArray arrayWithObjects:@"lua", @"plist", nil]];
+ self.currentProject = [[[Project alloc] initWithPath:destPath validFileTypes:[NSArray arrayWithObjects:@"lua", @"plist", nil]] autorelease];
[self showRenderView:YES animated:NO];
[[CodifyScriptExecute sharedInstance] runProject:self.currentProject];
@@ -102,6 +102,18 @@ - (int) orientationFromUIOrientation:(UIInterfaceOrientation)uio
#pragma mark - Internal Initialization
+- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+
+ if(self){
+ supportedOrientations = [[NSMutableSet alloc] initWithCapacity:4];
+ [self addSupportedOrientation:ORIENTATION_ANY];
+ }
+
+ return self;
+}
+
- (void) setup
{
self.showButtons = NO;
@@ -116,8 +128,6 @@ - (void) setup
renderManager = [[RenderManager alloc] init];
physicsManager = [[PhysicsManager alloc] init];
- supportedOrientations = [[NSMutableSet set] retain];
- [self addSupportedOrientation:ORIENTATION_ANY];
if (!aContext)
NSLog(@"Failed to create ES context");
@@ -479,9 +489,7 @@ - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterface
#pragma mark - View preparation
- (void) prepareViewForDisplay
-{
- [self addSupportedOrientation:ORIENTATION_ANY];
-
+{
//Do some basic GL setup
[self startAnimation];
[self initialDrawSetup];
@@ -1139,7 +1147,7 @@ - (void) addSupportedOrientation:(NSUInteger)codeaOrientation
[supportedOrientations addObject:[NSNumber numberWithUnsignedInteger:UIInterfaceOrientationLandscapeRight]];
[supportedOrientations addObject:[NSNumber numberWithUnsignedInteger:UIInterfaceOrientationPortrait]];
[supportedOrientations addObject:[NSNumber numberWithUnsignedInteger:UIInterfaceOrientationPortraitUpsideDown]];
- break;
+ break;
default: //Default to landscape left and right
[supportedOrientations addObject:[NSNumber numberWithUnsignedInteger:UIInterfaceOrientationLandscapeLeft]];
@@ -36,7 +36,7 @@ - (id) init
self = [super init];
if( self )
{
- preloadScripts = [[NSMutableArray array] retain];
+ preloadScripts = [[NSMutableArray alloc] initWithCapacity:31];
/*
//Lua Socket
@@ -51,8 +51,8 @@ - (id) init
*/
//Pre-load classes and sandbox lua files
- [preloadScripts addObject:SCRIPT_STRING("LuaSandbox")];
- [preloadScripts addObject:SCRIPT_STRING("Class")];
+ [preloadScripts addObject:SCRIPT_STRING("LuaSandbox")];
+ [preloadScripts addObject:SCRIPT_STRING("Class")];
//luaSandbox = [[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"LuaSandbox" ofType:@"lua"] usedEncoding:NULL error:NULL] retain];
//luaClasses = [[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Class" ofType:@"lua"] usedEncoding:NULL error:NULL] retain];
@@ -437,7 +437,7 @@ int readData(lua_State *L, NSDictionary* readFromDict)
UIImage *newImage = [UIImage imageWithCGImage:imageRef];
CGDataProviderRelease(provider);
CGImageRelease(imageRef);
- CGColorSpaceRelease(colorSpaceRef);
+ CGColorSpaceRelease(colorSpaceRef);
// Flip image
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:newImage];

0 comments on commit ead1cec

Please sign in to comment.