p2 avatar p2 committed bce8735

Xcode 4 import

Comments (0)

Files changed (12)

 **.pbxuser
 **.mode?v?
 **.perspectivev?
+**.xcworkspace
+**/xcuserdata
 

Classes/EAGLView.m

 			self.contentScaleFactor = [[UIScreen mainScreen] scale];
 		}
 		
-		//renderer = [[ES2Renderer alloc] init];
+		//renderer = [[ES2Renderer alloc] init];			// use OpenGL ES 2 renderer if possible
 		renderer = nil;
 		
 		if (!renderer) {

Classes/ES1Renderer.m

 // Create an ES 1.1 context
 - (id <ESRenderer>) init
 {
-	if (self = [super init]) {
+	if ((self = [super init])) {
 		context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
 		
 		if (!context || ![EAGLContext setCurrentContext:context]) {

Classes/MCBoolInputField.m

 // used by objects unarchived from Interface Builder
 - (id) initWithCoder:(NSCoder *)decode
 {
-	if (self = [super initWithCoder:decode]) {
+	if ((self = [super initWithCoder:decode])) {
 		self.opaque = NO;
 		self.backgroundColor = [UIColor clearColor];
 		
 
 - (id) initWithFrame:(CGRect)frame
 {
-	if (self = [super initWithFrame:frame]) {
+	if ((self = [super initWithFrame:frame])) {
 		[self setDefaultValues];
 	}
 	

Classes/MCGlossyButton.m

 
 - (id) initWithFrame:(CGRect)frame
 {
-    if (self = [super initWithFrame:frame]) {
+    if ((self = [super initWithFrame:frame])) {
 		self.opaque = NO;
 		self.backgroundColor = [UIColor clearColor];
 		
 
 - (id) initWithCoder:(NSCoder *)aDecoder
 {
-	if (self = [super initWithCoder:aDecoder]) {
+	if ((self = [super initWithCoder:aDecoder])) {
 		[self setup];
 	}
 	return self;

Classes/MCSegment.m

 
 - (id) initWithFrame:(CGRect)frame
 {
-    if (self = [super initWithFrame:frame]) {
+    if ((self = [super initWithFrame:frame])) {
 		self.borderWidth = UIEdgeInsetsMake(1.f, 1.f, 1.f, 1.f);
         self.contentOffset = CGSizeMake(3.f, 3.f);
     }
 
 - (id) initWithCoder:(NSCoder *)coder
 {
-    if (self = [super initWithCoder:coder]) {
+    if ((self = [super initWithCoder:coder])) {
 		self.borderWidth = UIEdgeInsetsMake(1.f, 1.f, 1.f, 1.f);
         self.contentOffset = CGSizeMake(3.f, 3.f);
     }

Classes/MCSegmentedInputField.m

 
 - (id) initWithFrame:(CGRect)frame
 {
-	if (self = [super initWithFrame:frame]) {
+	if ((self = [super initWithFrame:frame])) {
 		self.opaque = NO;
 		self.enabled = YES;
 		inset = YES;
 
 - (id) initWithCoder:(NSCoder *)coder
 {
-	if (self = [super initWithCoder:coder]) {
+	if ((self = [super initWithCoder:coder])) {
 		self.opaque = NO;
 		self.backgroundColor = nil;
 		self.enabled = YES;

Classes/PrefViewController.h

 //
 
 #import <UIKit/UIKit.h>
-#import "MCBoolInputFieldDelegate.h";
+#import "MCBoolInputFieldDelegate.h"
 #import "MCSegmentedInputFieldDelegate.h"
 
 #define settingKeySpeed			@"speedSetting"

Classes/PrefViewController.m

 
 - (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
 {
-    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
     }
     return self;
 }

Classes/glmatrix.h

 //  glmatrix.h
 //  MatrixCode
 //
-//  Created by Pascal Pfiffner on 30.05.10.
+//  Created by Pascal Pfiffner on 30.05.10
+//	Based on "glmatrix", Copyright (c) 2003, 2004 Jamie Zawinski <jwz@jwz.org>
 //  Copyright 2010 Institute Of Immunology. All rights reserved.
 //
 

Classes/glmatrix.m

 
 
 
-/* qsort comparator for sorting strips by z position
- */
+// qsort comparator for sorting strips by z position
 static int cmp_strips(const void *aa, const void *bb)
 {
 	const strip *a = *(strip **) aa;
 	
 	// got a target quaternion - must be physical rotation tracking for now
 	if (!quaternionEqualToQuaternion(QuaternionNull, m_config->targetRotation)) {
-		m_config->track_end = m_config->track_start + m_config->track_duration;			// independent of speed
+		m_config->track_end = m_config->track_start + m_config->track_duration;			// independent of "speed" setting
 		
 		m_config->track_linearly = YES;
 		m_config->is_tracking = YES;
 	
 	// no target, so take one of our nice views
 	else if (do_autorotate) {
-		m_config->track_end = m_config->track_start + m_config->auto_track_duration;	// also, is nicer independent from speed
+		m_config->track_end = m_config->track_start + m_config->auto_track_duration;	// this is also nicer if in-dependent from "speed" setting
 		
 		int target_view = (random() % (countof(nice_views) - 1)) + 1;
 		GLfloat t_pitch = nice_views[target_view].x;
 }
 
 
-/* Draw all the visible glyphs in the strip.
- */
+// Draw all the visible glyphs in the strip.
 static void draw_strip(strip *s)
 {
 	// draw strip glyphs
 }
 
 
+// master drawer
 void draw_matrix()
 {
 	// Clear buffers
 	m_config->strips = calloc(numNewStrips, sizeof(strip));
 	m_config->nstrips = numNewStrips;
 	
-	// old strips present?
+	// old strips present? Copy the ones we still need over to the new buffer
 	if (NULL != oldStrips) {
-		
-		// we want more strips than already present; allocate some and copy the old ones over
-		if (numNewStrips > numOldStrips) {
-			m_config->strips = memcpy(m_config->strips, oldStrips, numOldStrips * sizeof(strip));
-		}
-		
-		// we want less strips than we currently have; copy over only the needed ones
-		else {
-			m_config->strips = memcpy(m_config->strips, oldStrips, numNewStrips * sizeof(strip));
-		}
+		m_config->strips = memcpy(m_config->strips, oldStrips, MIN(numOldStrips, numNewStrips) * sizeof(strip));
 		
 		if (NULL == m_config->strips) {
 			fprintf(stderr, "We have a problem here, could not copy the old strips to the new buffer, probably out of memory");

MatrixCode.xcodeproj/project.pbxproj

 			isa = PBXProject;
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MatrixCode" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
+			knownRegions = (
+				en,
+			);
 			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
 			projectDirPath = "";
 			projectRoot = "";
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				COPY_PHASE_STRIP = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
-				CODE_SIGN_IDENTITY = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 					"-DDEBUG",
 				);
 				PREBINDING = NO;
-				SDKROOT = iphoneos4.0;
+				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = Debug;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
-				CODE_SIGN_IDENTITY = "iPhone Distribution: Pascal Pfiffner";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Pascal Pfiffner";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				PREBINDING = NO;
-				PROVISIONING_PROFILE = "6C15BC77-6809-44C4-8E34-014FEBD09225";
-				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "6C15BC77-6809-44C4-8E34-014FEBD09225";
-				SDKROOT = iphoneos4.0;
+				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 			};
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
-				CODE_SIGN_IDENTITY = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				PREBINDING = NO;
-				SDKROOT = iphoneos4.0;
+				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
 			};
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Distribution: Pascal Pfiffner";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Pascal Pfiffner";
 				COPY_PHASE_STRIP = YES;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
-				CODE_SIGN_IDENTITY = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				);
 				PREBINDING = NO;
 				RUN_CLANG_STATIC_ANALYZER = YES;
-				SDKROOT = iphoneos4.0;
+				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = "Debug Plus";
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				CODE_SIGN_IDENTITY = "iPhone Developer: Pascal Pfiffner (6Y8UY5L6U4)";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.