Skip to content

Commit

Permalink
Merge branch 'develop' into merge_1.4.1
Browse files Browse the repository at this point in the history
Backport of bug fixes in develop
  • Loading branch information
DylanSale committed May 30, 2012
2 parents 5bcbeff + 8136b98 commit ead1cec
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CodeaTemplate/CodeaTemplate/CodifyAppDelegate.m
Expand Up @@ -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];

Expand Down
20 changes: 14 additions & 6 deletions CodeaTemplate/Codify/BasicRendererViewController.mm
Expand Up @@ -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;
Expand All @@ -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");
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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]];
Expand Down
6 changes: 3 additions & 3 deletions CodeaTemplate/Codify/CodifyScriptExecute.m
Expand Up @@ -36,7 +36,7 @@ - (id) init
self = [super init];
if( self )
{
preloadScripts = [[NSMutableArray array] retain];
preloadScripts = [[NSMutableArray alloc] initWithCapacity:31];

/*
//Lua Socket
Expand All @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion CodeaTemplate/Codify/Persistence.m
Expand Up @@ -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];
Expand Down

0 comments on commit ead1cec

Please sign in to comment.