Abstractions and interfaces around units. (Figured out some of the nuance around...
authordsc <david.schoonover@gmail.com>
Mon, 16 May 2011 16:39:13 +0000 (09:39 -0700)
committerdsc <david.schoonover@gmail.com>
Mon, 16 May 2011 16:39:13 +0000 (09:39 -0700)
34 files changed:
src/game/Active.h [moved from src/tanks/Active.h with 100% similarity]
src/game/Displayable.h [new file with mode: 0644]
src/game/Game.h [new file with mode: 0644]
src/game/Game.mm [new file with mode: 0644]
src/game/actor/Actor.h [moved from src/tanks/unit/Actor.h with 53% similarity]
src/game/actor/Actor.mm [new file with mode: 0644]
src/game/actor/Unit.h [new file with mode: 0644]
src/game/actor/Unit.mm [new file with mode: 0644]
src/main.mm
src/physics/World.h
src/physics/debug/GLESDebugDraw.h [moved from src/ui/GLES-Render.h with 97% similarity]
src/physics/debug/GLESDebugDraw.mm [moved from src/ui/GLES-Render.mm with 99% similarity]
src/physics/debug/PhysicsDebugView.h [moved from src/physics/PhysicsDebugView.h with 100% similarity]
src/physics/debug/PhysicsDebugView.mm [moved from src/physics/PhysicsDebugView.mm with 100% similarity]
src/render/QQSparrowExtensions.h [new file with mode: 0644]
src/render/QQSparrowExtensions.mm [new file with mode: 0644]
src/render/animation/AnimationContainer.h
src/tanks/Displayable.h [deleted file]
src/tanks/Game.h [deleted file]
src/tanks/Game.mm [deleted file]
src/tanks/unit/Actor.mm [deleted file]
src/tanks/unit/Unit.h [deleted file]
src/tanks/unit/Unit.mm [deleted file]
src/ui/AppDelegate.h [moved from src/RootAppDelegate.h with 69% similarity]
src/ui/AppDelegate.mm [moved from src/RootAppDelegate.mm with 72% similarity]
src/ui/Viewport.h
src/ui/Viewport.mm
src/ui/iPad/AppDelegate_iPad.h [moved from src/ui/iPad/RootAppDelegate_iPad.h with 56% similarity]
src/ui/iPad/AppDelegate_iPad.mm [moved from src/ui/iPad/RootAppDelegate_iPad.mm with 60% similarity]
src/ui/iPad/en.lproj/MainWindow_iPad.xib
src/ui/iPhone/AppDelegate_iPhone.h [moved from src/ui/iPhone/RootAppDelegate_iPhone.h with 55% similarity]
src/ui/iPhone/AppDelegate_iPhone.mm [moved from src/ui/iPhone/RootAppDelegate_iPhone.mm with 59% similarity]
src/ui/iPhone/en.lproj/MainWindow_iPhone.xib
tanks.xcodeproj/project.pbxproj

similarity index 100%
rename from src/tanks/Active.h
rename to src/game/Active.h
diff --git a/src/game/Displayable.h b/src/game/Displayable.h
new file mode 100644 (file)
index 0000000..852bf95
--- /dev/null
@@ -0,0 +1,8 @@
+#import "Sparrow.h"
+
+
+@protocol Displayable
+
+@property (nonatomic, retain, readonly) SPDisplayObject* shape;
+
+@end
\ No newline at end of file
diff --git a/src/game/Game.h b/src/game/Game.h
new file mode 100644 (file)
index 0000000..7628110
--- /dev/null
@@ -0,0 +1,19 @@
+#import "Sparrow.h"
+
+#import "game/actor/Unit.h"
+#import "physics/World.h"
+
+
+@interface Game : SPStage {
+@private
+    Unit*  _unit;
+    World* _world;
+}
+
+@property (nonatomic, retain) World* world;
+
+- (void) onEnterFrame:(SPEnterFrameEvent*)event;
+
++ (Game*) current;
+
+@end
diff --git a/src/game/Game.mm b/src/game/Game.mm
new file mode 100644 (file)
index 0000000..d010137
--- /dev/null
@@ -0,0 +1,61 @@
+#import "Game.h"
+#import "game/actor/Unit.h"
+
+
+
+static Game* _currentGame = NULL;
+
+
+
+@interface Game ()
+@property (nonatomic, retain) Unit* unit;
+@end
+
+
+@implementation Game
+@synthesize world = _world;
+@synthesize unit  = _unit;
+
+
+- (id) init {
+    if (_currentGame) {
+        [self release];
+        [NSException raise:@"TooManyGames" format:@"cannot instantiate more than one Game at a time!"];
+    }
+    
+    if ( (self = [super init]) ){
+        _currentGame = self;
+        
+        _world = [[World alloc] init];
+        [self addEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME];
+        
+        _unit = [[Unit alloc] init];
+        // [self addEventListener:@selector(onTouch:) atObject:_unit forType:SP_EVENT_TYPE_TOUCH];
+        // if (_unit.shape) [self addChild:_unit.shape];
+    }
+    return self;
+}
+
+- (void) dealloc {
+    // [self setUnit:nil];
+    // [self setWorld:nil];
+    [_unit release];
+    [_world release];
+    _currentGame = NULL;
+    [super dealloc];
+}
+
+- (void) onEnterFrame:(SPEnterFrameEvent*)event {
+    NSLog(@"Time passed since last frame: %f", event.passedTime);
+    // [world step];
+}
+
++ (Game*) current {
+    if (!_currentGame)
+        [[[Game alloc] init]    // init assigns to singleton, but singleton is a weakref,
+            autorelease];       // XXX: so game will still be released if not retained...
+    return _currentGame;
+}
+
+
+@end
\ No newline at end of file
similarity index 53%
rename from src/tanks/unit/Actor.h
rename to src/game/actor/Actor.h
index 335e918..ab2f513 100644 (file)
@@ -1,19 +1,19 @@
-#import "tanks/Active.h"
-#import "tanks/Displayable.h"
-
+#import "game/Active.h"
+#import "game/Displayable.h"
 #import "physics/World.h"
 
+@class Game;
+
 
 @interface Actor : NSObject <Active, Displayable> {
     
 @private
-    BOOL _active;
-    World* _world;
+    BOOL   _active;
 }
 
+@property (nonatomic, readonly) Game*  game;
 @property (nonatomic, readonly) World* world;
 
-- (id) init:(World*)theWorld;
 
 
 @end
diff --git a/src/game/actor/Actor.mm b/src/game/actor/Actor.mm
new file mode 100644 (file)
index 0000000..ba63e62
--- /dev/null
@@ -0,0 +1,18 @@
+#import "Actor.h"
+#import "game/Game.h"
+
+
+@implementation Actor
+
+@synthesize active;
+
+- (Game*)  game  { return Game.current; }
+- (World*) world { return self.game.world; }
+
+- (SPDisplayObject*) shape { return nil; }
+
+- (void) act {
+    // stub
+}
+
+@end
diff --git a/src/game/actor/Unit.h b/src/game/actor/Unit.h
new file mode 100644 (file)
index 0000000..c6650c2
--- /dev/null
@@ -0,0 +1,21 @@
+#import "Sparrow.h"
+#import "render/QQSparrowExtensions.h"
+
+#import "game/actor/Actor.h"
+#import "physics/World.h"
+
+
+@interface Unit : Actor {
+
+@private
+    SPDisplayObject* _shape;
+}
+
+@property (nonatomic, retain, readwrite) SPDisplayObject* shape;
+
+- (id) initWithFile:(NSString*)fileName atX:(float)x y:(float)y;
+- (id) initWithShape:(SPDisplayObject*)aShape;
+
+- (void) onTouch:(SPTouchEvent*)event;
+
+@end
diff --git a/src/game/actor/Unit.mm b/src/game/actor/Unit.mm
new file mode 100644 (file)
index 0000000..f37dd31
--- /dev/null
@@ -0,0 +1,52 @@
+#import "Sparrow.h"
+#import "Unit.h"
+
+
+@implementation Unit
+
+@synthesize shape = _shape;
+
+- (id) init {
+    return [self initWithShape:[[SPQuad quadWithWidth:32 height:32 color:0xff0000] setPositionX:50 y:50]];
+}
+
+- (id) initWithFile:(NSString*)fileName atX:(float)x y:(float)y {
+    return [self initWithShape:[[[[SPImage alloc] initWithContentsOfFile:fileName] autorelease] setPositionX:x y:y]];
+}
+
+- (id) initWithShape:(SPDisplayObject*)aShape {
+    if ((self = [super init])) {
+        self.shape = aShape;
+        [self.game addEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH];
+    }
+    return self;
+}
+
+- (void) dealloc {
+    [self.game removeEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH];
+    [self.game removeChild:_shape];
+    [_shape release];
+    [super dealloc];
+}
+
+- (void) setShape:(SPDisplayObject*)newShape {
+    if (_shape != newShape) {
+        [self.game removeChild:_shape];
+        [_shape release];
+        _shape = [newShape retain];
+        [self.game addChild:_shape];
+    }
+}
+
+- (void) onTouch:(SPTouchEvent*)event {
+    NSLog(@"%@ onTouch! shape=%@ parent=%@", self, self.shape, self.shape.parent);
+    SPTouch* touch = [[event touchesWithTarget:self.shape.parent] anyObject];
+    if (touch) {
+        SPPoint* touchPosition = [touch locationInSpace:self.shape.parent];
+        self.shape.x = touchPosition.x - self.shape.width / 2.0f;
+        self.shape.y = touchPosition.y - self.shape.height / 2.0f;
+    }
+}
+
+
+@end
index 6b5e5b5..af502d5 100644 (file)
@@ -1,13 +1,6 @@
-//
-//  main.m
-//  tanks
-//
-//  Created by dsc on 4/27/11.
-//  Copyright 2011 lttlst.com. All rights reserved.
-//
-
 #import <UIKit/UIKit.h>
 
+
 int main(int argc, char *argv[])
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
index d9d2b56..c0663fa 100644 (file)
@@ -1,5 +1,5 @@
 #include <Box2D/Box2D.h>
-#import "ui/GLES-Render.h"
+#import "physics/debug/GLESDebugDraw.h"
 
 
 @interface World : NSObject {
similarity index 97%
rename from src/ui/GLES-Render.h
rename to src/physics/debug/GLESDebugDraw.h
index 2551666..6131196 100644 (file)
@@ -18,8 +18,8 @@
 * 3. This notice may not be removed or altered from any source distribution.
 */
 
-#ifndef RENDER_H
-#define RENDER_H
+#ifndef GLES_DEBUG_DRAW_H
+#define GLES_DEBUG_DRAW_H
 
 #import <UIKit/UIKit.h>
 #import <OpenGLES/EAGL.h>
similarity index 99%
rename from src/ui/GLES-Render.mm
rename to src/physics/debug/GLESDebugDraw.mm
index abf5c57..ab02a83 100644 (file)
@@ -18,7 +18,7 @@
 * 3. This notice may not be removed or altered from any source distribution.
 */
 
-#include "GLES-Render.h"
+#include "GLESDebugDraw.h"
 
 
 #include <cstdio>
diff --git a/src/render/QQSparrowExtensions.h b/src/render/QQSparrowExtensions.h
new file mode 100644 (file)
index 0000000..076ee38
--- /dev/null
@@ -0,0 +1,9 @@
+#import "SPDisplayObject.h"
+
+
+@interface SPDisplayObject (QQSparrowExtensions)
+
+- (id) setPositionX:(float)x y:(float)y;
+
+@end
+
diff --git a/src/render/QQSparrowExtensions.mm b/src/render/QQSparrowExtensions.mm
new file mode 100644 (file)
index 0000000..8226e98
--- /dev/null
@@ -0,0 +1,12 @@
+#import "QQSparrowExtensions.h"
+
+
+@implementation SPDisplayObject (QQSparrowExtensions)
+
+- (id) setPositionX:(float)x y:(float)y {
+    self.x = x;
+    self.y = y;
+    return self;
+}
+
+@end
\ No newline at end of file
index 8e7c8c3..4b4d16c 100644 (file)
@@ -1,12 +1,3 @@
-//
-//  AnimationContainer.h
-//  tanks
-//
-//  Created by Doris Chen on 5/12/11.
-//  Copyright 2011 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
 #import "SPTextureAtlas.h"
 
 ////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/tanks/Displayable.h b/src/tanks/Displayable.h
deleted file mode 100644 (file)
index c99f41c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#import "Sparrow.h"
-
-
-@protocol Displayable
-
-@property (nonatomic, readonly) SPDisplayObject* shape;
-
-@end
\ No newline at end of file
diff --git a/src/tanks/Game.h b/src/tanks/Game.h
deleted file mode 100644 (file)
index 0fd6712..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#import "Sparrow.h"
-
-#import "physics/World.h"
-
-
-@interface Game : SPStage
-
-@property (nonatomic, retain) World* world;
-
-- (void) onEnterFrame:(SPEnterFrameEvent*)event;
-
-@end
diff --git a/src/tanks/Game.mm b/src/tanks/Game.mm
deleted file mode 100644 (file)
index aa9a8db..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#import "Game.h"
-#import "tanks/unit/Unit.h"
-
-
-@interface Game ()
-
-@property (nonatomic, retain) Unit* unit;
-
-@end
-
-
-@implementation Game
-
-@synthesize unit;
-@synthesize world;
-
-
-- (id) init {
-    if ( (self = [super init]) ){
-        world = [[[World alloc] init] autorelease];
-        [self addEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME];
-        
-        unit = [[[Unit alloc] init:world] autorelease];
-        [self addEventListener:@selector(onTouch:) atObject:unit forType:SP_EVENT_TYPE_TOUCH];
-        [self addChild:unit.quad];
-    }
-    return self;
-}
-
-- (void) dealloc {
-    [self setUnit:nil];
-    [self setWorld:nil];
-    [super dealloc];
-}
-
-- (void) onEnterFrame:(SPEnterFrameEvent*)event {
-    NSLog(@"Time passed since last frame: %f", event.passedTime);
-    // [world step];
-}
-
-
-
-
-@end
\ No newline at end of file
diff --git a/src/tanks/unit/Actor.mm b/src/tanks/unit/Actor.mm
deleted file mode 100644 (file)
index ddb6457..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#import "Actor.h"
-
-
-@implementation Actor
-
-@synthesize active;
-@synthesize world = _world;
-
-
-- (id) init:(World*)theWorld {
-    if ((self = [super init])) {
-        _world = theWorld; // weakref: does not inc refcount
-    }
-    return self;
-}
-
-- (SPDisplayObject*) shape {
-    return nil;
-}
-
-
-- (void) act {}
-
-@end
diff --git a/src/tanks/unit/Unit.h b/src/tanks/unit/Unit.h
deleted file mode 100644 (file)
index e5ff05e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#import "Sparrow.h"
-#import "tanks/unit/Actor.h"
-#import "physics/World.h"
-
-
-@interface Unit : Actor {
-}
-
-@property (nonatomic, retain) SPQuad* quad;
-
-- (Unit*) initWithWidth:(float)width height:(float)height X:(float)x Y:(float)y color:(int)color;
-- (Unit*) initWithFile:(NSString*)fileName atX:(float)x andY:(float)y;
-
-- (void) onTouch:(SPTouchEvent*)event;
-
-@end
diff --git a/src/tanks/unit/Unit.mm b/src/tanks/unit/Unit.mm
deleted file mode 100644 (file)
index 469e6b7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#import "Unit.h"
-#import "Sparrow.h"
-
-
-@implementation Unit
-
-@synthesize quad;
-
-- (SPDisplayObject*) shape { return quad; }
-
-
-
-- (Unit*) init:(World*)theWorld {
-    if ((self = [super init:theWorld])) {
-        quad = [SPQuad quadWithWidth:32 height:32];
-        quad.color = 0xff0000;
-        quad.x = 0;
-        quad.y = 0;
-    }
-    return self;
-}
-
-- (void) onTouch:(SPTouchEvent*)event {
-    SPTouch* touch = [[event touchesWithTarget:quad.parent] anyObject];
-    if (touch) {
-        SPPoint* touchPosition = [touch locationInSpace:quad.parent];
-        quad.x = touchPosition.x - quad.width / 2.0f;
-        quad.y = touchPosition.y - quad.height / 2.0f;
-    }
-}
-
-
-@end
similarity index 69%
rename from src/RootAppDelegate.h
rename to src/ui/AppDelegate.h
index 13411b4..7e85122 100644 (file)
@@ -1,12 +1,12 @@
 #import "Sparrow.h"
-#import "Game.h"
+#import "game/Game.h"
 
 
-@interface RootAppDelegate : NSObject <UIApplicationDelegate>
+@interface AppDelegate : NSObject <UIApplicationDelegate>
 {
     UIWindow* window;
     SPView* sparrowView;
-    Game* game;
+    Game* _game;
 }
 
 @property (nonatomic, retain) IBOutlet UIWindow* window;
similarity index 72%
rename from src/RootAppDelegate.mm
rename to src/ui/AppDelegate.mm
index 34b7cd9..78f81dc 100644 (file)
@@ -1,19 +1,19 @@
 //
-//  RootAppDelegate.m
+//  AppDelegate.m
 //  tanks
 //
 //  Created by dsc on 4/27/11.
 //  Copyright 2011 lttlst.com. All rights reserved.
 //
 
-#import "RootAppDelegate.h"
-#import "Game.h"
+#import "AppDelegate.h"
+#import "game/Game.h"
 
-@implementation RootAppDelegate
+@implementation AppDelegate
 
 @synthesize window;
 @synthesize sparrowView;
-@synthesize game;
+@synthesize game = _game;
 
 
 - (void) applicationDidFinishLaunching:(UIApplication*)application {
     [SPAudioEngine start];
     if ( sparrowView.frameRate != 60.0f )
         sparrowView.frameRate = 60.0f;
+    // sparrowView.stage = [[[SPStage alloc] init] autorelease];
     
-    game = [[[Game alloc] init] autorelease];
-    sparrowView.stage = game;
+    _game = [[Game alloc] init];
+    sparrowView.stage = _game;
     
     [window makeKeyAndVisible];
     [sparrowView start];
@@ -42,7 +43,8 @@
 }
 
 - (void) dealloc {
-    [self setGame:nil];
+    // [self setGame:nil];
+    [_game release];
     [sparrowView release];
     [window release];
     [super dealloc];
index 1cd86b8..456b5e2 100644 (file)
@@ -1,4 +1,3 @@
-#include <Box2D/Box2D.h>
 #import "Sparrow.h"
 
 #import "physics/World.h"
index 6bca710..f0c4eac 100644 (file)
@@ -1,10 +1,12 @@
 #import <OpenGLES/EAGL.h>
 #import <OpenGLES/ES1/gl.h>
 #import <OpenGLES/ES1/glext.h>
+
 #import "Sparrow.h"
 
 #import "Viewport.h"
-#import "World.h"
+#import "physics/World.h"
+
 
 @implementation Viewport
 
similarity index 56%
rename from src/ui/iPad/RootAppDelegate_iPad.h
rename to src/ui/iPad/AppDelegate_iPad.h
index 36cc1ab..0fa5aee 100644 (file)
@@ -1,5 +1,5 @@
 //
-//  RootAppDelegate_iPad.h
+//  AppDelegate_iPad.h
 //  tanks
 //
 //  Created by dsc on 4/27/11.
@@ -7,9 +7,9 @@
 //
 
 #import <UIKit/UIKit.h>
-#import "RootAppDelegate.h"
+#import "ui/AppDelegate.h"
 
-@interface RootAppDelegate_iPad : RootAppDelegate {
+@interface AppDelegate_iPad : AppDelegate {
     
 }
 
similarity index 60%
rename from src/ui/iPad/RootAppDelegate_iPad.mm
rename to src/ui/iPad/AppDelegate_iPad.mm
index 75c6d5d..ec4518d 100644 (file)
@@ -1,14 +1,14 @@
 //
-//  RootAppDelegate_iPad.m
+//  AppDelegate_iPad.m
 //  tanks
 //
 //  Created by dsc on 4/27/11.
 //  Copyright 2011 lttlst.com. All rights reserved.
 //
 
-#import "RootAppDelegate_iPad.h"
+#import "AppDelegate_iPad.h"
 
-@implementation RootAppDelegate_iPad
+@implementation AppDelegate_iPad
 
 - (void)dealloc
 {
index 68e46d8..eafdb9b 100644 (file)
                                                <reference key="source" ref="250404236"/>
                                                <reference key="destination" ref="607297697"/>
                                        </object>
-                                       <int key="connectionID">14</int>
+                                       <int key="connectionID">15</int>
                                </object>
                        </array>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
                                <string key="2.IBEditorWindowLastContentRect">{{202, 84}, {783, 772}}</string>
                                <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-                               <string key="6.CustomClassName">RootAppDelegate_iPad</string>
+                               <string key="6.CustomClassName">AppDelegate_iPad</string>
                                <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
                        </dictionary>
                        <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
                        <nil key="activeLocalization"/>
                        <dictionary class="NSMutableDictionary" key="localizations"/>
                        <nil key="sourceID"/>
-                       <int key="maxID">14</int>
+                       <int key="maxID">15</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <array class="NSMutableArray" key="referencedPartialClassDescriptions">
                                <object class="IBPartialClassDescription">
-                                       <string key="className">RootAppDelegate</string>
+                                       <string key="className">AppDelegate</string>
                                        <string key="superclassName">NSObject</string>
                                        <dictionary class="NSMutableDictionary" key="outlets">
                                                <string key="sparrowView">SPView</string>
                                        </dictionary>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                                                <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/RootAppDelegate.h</string>
+                                               <string key="minorKey">./Classes/AppDelegate.h</string>
                                        </object>
                                </object>
                                <object class="IBPartialClassDescription">
-                                       <string key="className">RootAppDelegate_iPad</string>
-                                       <string key="superclassName">RootAppDelegate</string>
+                                       <string key="className">AppDelegate_iPad</string>
+                                       <string key="superclassName">AppDelegate</string>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                                                <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/RootAppDelegate_iPad.h</string>
+                                               <string key="minorKey">./Classes/AppDelegate_iPad.h</string>
                                        </object>
                                </object>
                                <object class="IBPartialClassDescription">
similarity index 55%
rename from src/ui/iPhone/RootAppDelegate_iPhone.h
rename to src/ui/iPhone/AppDelegate_iPhone.h
index 57fd121..f18a22d 100644 (file)
@@ -1,5 +1,5 @@
 //
-//  RootAppDelegate_iPhone.h
+//  AppDelegate_iPhone.h
 //  tanks
 //
 //  Created by dsc on 4/27/11.
@@ -7,9 +7,9 @@
 //
 
 #import <UIKit/UIKit.h>
-#import "RootAppDelegate.h"
+#import "ui/AppDelegate.h"
 
-@interface RootAppDelegate_iPhone : RootAppDelegate {
+@interface AppDelegate_iPhone : AppDelegate {
     
 }
 
similarity index 59%
rename from src/ui/iPhone/RootAppDelegate_iPhone.mm
rename to src/ui/iPhone/AppDelegate_iPhone.mm
index 84c85b0..250dd71 100644 (file)
@@ -1,14 +1,14 @@
 //
-//  RootAppDelegate_iPhone.m
+//  AppDelegate_iPhone.m
 //  tanks
 //
 //  Created by dsc on 4/27/11.
 //  Copyright 2011 lttlst.com. All rights reserved.
 //
 
-#import "RootAppDelegate_iPhone.h"
+#import "AppDelegate_iPhone.h"
 
-@implementation RootAppDelegate_iPhone
+@implementation AppDelegate_iPhone
 
 - (void)dealloc
 {
index 7d8d44b..b9ee674 100644 (file)
@@ -43,7 +43,6 @@
                                                <string key="NSFrame">{{51, 229}, {218, 22}}</string>
                                                <reference key="NSSuperview" ref="380026005"/>
                                                <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView"/>
                                                <bool key="IBUIOpaque">NO</bool>
                                                <bool key="IBUIClipsSubviews">YES</bool>
                                                <int key="IBUIContentMode">7</int>
                                                <reference key="source" ref="987256611"/>
                                                <reference key="destination" ref="851352140"/>
                                        </object>
-                                       <int key="connectionID">11</int>
+                                       <int key="connectionID">12</int>
                                </object>
                        </array>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <string key="2.IBEditorWindowLastContentRect">{{520, 376}, {320, 480}}</string>
                                <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
                                <integer value="1" key="2.UIWindow.visibleAtLaunch"/>
-                               <string key="4.CustomClassName">RootAppDelegate_iPhone</string>
+                               <string key="4.CustomClassName">AppDelegate_iPhone</string>
                                <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
                                <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
                                <string key="9.CustomClassName">SPView</string>
                        <nil key="activeLocalization"/>
                        <dictionary class="NSMutableDictionary" key="localizations"/>
                        <nil key="sourceID"/>
-                       <int key="maxID">11</int>
+                       <int key="maxID">12</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <array class="NSMutableArray" key="referencedPartialClassDescriptions">
                                <object class="IBPartialClassDescription">
-                                       <string key="className">RootAppDelegate</string>
+                                       <string key="className">AppDelegate</string>
                                        <string key="superclassName">NSObject</string>
                                        <dictionary class="NSMutableDictionary" key="outlets">
                                                <string key="sparrowView">SPView</string>
                                        </dictionary>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                                                <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/RootAppDelegate.h</string>
+                                               <string key="minorKey">./Classes/AppDelegate.h</string>
                                        </object>
                                </object>
                                <object class="IBPartialClassDescription">
-                                       <string key="className">RootAppDelegate_iPhone</string>
-                                       <string key="superclassName">RootAppDelegate</string>
+                                       <string key="className">AppDelegate_iPhone</string>
+                                       <string key="superclassName">AppDelegate</string>
                                        <object class="IBClassDescriptionSource" key="sourceIdentifier">
                                                <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/RootAppDelegate_iPhone.h</string>
+                                               <string key="minorKey">./Classes/AppDelegate_iPhone.h</string>
                                        </object>
                                </object>
                                <object class="IBPartialClassDescription">
index 3a054df..b865a98 100644 (file)
@@ -8,6 +8,8 @@
 
 /* Begin PBXBuildFile section */
                494DE9971376927C00FDB3D7 /* libBox2D.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 494DE9961376927C00FDB3D7 /* libBox2D.a */; };
+               4995ABB213816CCE00334646 /* Game.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A513812427007A6598 /* Game.h */; };
+               4995ABB313816CD400334646 /* Unit.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A213812427007A6598 /* Unit.h */; };
                499668C713692E2D006E8125 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 499668C613692E2D006E8125 /* UIKit.framework */; };
                499668C913692E2D006E8125 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 499668C813692E2D006E8125 /* Foundation.framework */; };
                499668CB13692E2D006E8125 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 499668CA13692E2D006E8125 /* CoreGraphics.framework */; };
                4996691B136930E8006E8125 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49966916136930E8006E8125 /* QuartzCore.framework */; };
                49DA67D4137847A7004841E9 /* World.h in Headers */ = {isa = PBXBuildFile; fileRef = 49DA67D2137847A7004841E9 /* World.h */; };
                49DA67D5137847A7004841E9 /* World.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49DA67D3137847A7004841E9 /* World.mm */; };
-               49E834441380CB61007A6598 /* GLES-Render.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834421380CB61007A6598 /* GLES-Render.h */; };
-               49E834451380CB61007A6598 /* GLES-Render.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834431380CB61007A6598 /* GLES-Render.mm */; };
-               49E834501380E234007A6598 /* Displayable.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E8344F1380E234007A6598 /* Displayable.h */; };
-               49E834531380EBB2007A6598 /* Actor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834511380EBB2007A6598 /* Actor.h */; };
-               49E834541380EBB2007A6598 /* Actor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834521380EBB2007A6598 /* Actor.mm */; };
-               49E8345613810618007A6598 /* Active.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E8345513810618007A6598 /* Active.h */; };
+               49E834A713812427007A6598 /* Active.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E8349E13812427007A6598 /* Active.h */; };
+               49E834A813812427007A6598 /* Actor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A013812427007A6598 /* Actor.h */; };
+               49E834A913812427007A6598 /* Actor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834A113812427007A6598 /* Actor.mm */; };
+               49E834AB13812427007A6598 /* Unit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834A313812427007A6598 /* Unit.mm */; };
+               49E834AC13812427007A6598 /* Displayable.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A413812427007A6598 /* Displayable.h */; };
+               49E834AE13812427007A6598 /* Game.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834A613812427007A6598 /* Game.mm */; };
+               49E834BE13812555007A6598 /* AppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834B013812555007A6598 /* AppDelegate.h */; };
+               49E834BF13812555007A6598 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834B113812555007A6598 /* AppDelegate.mm */; };
+               49E834C013812555007A6598 /* AppDelegate_iPad.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834B313812555007A6598 /* AppDelegate_iPad.h */; };
+               49E834C113812555007A6598 /* AppDelegate_iPad.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834B413812555007A6598 /* AppDelegate_iPad.mm */; };
+               49E834C213812555007A6598 /* MainWindow_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49E834B513812555007A6598 /* MainWindow_iPad.xib */; };
+               49E834C313812555007A6598 /* AppDelegate_iPhone.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834B813812555007A6598 /* AppDelegate_iPhone.h */; };
+               49E834C413812555007A6598 /* AppDelegate_iPhone.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834B913812555007A6598 /* AppDelegate_iPhone.mm */; };
+               49E834C513812555007A6598 /* MainWindow_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49E834BA13812555007A6598 /* MainWindow_iPhone.xib */; };
+               49E834C613812555007A6598 /* Viewport.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834BC13812555007A6598 /* Viewport.h */; };
+               49E834C713812555007A6598 /* Viewport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834BD13812555007A6598 /* Viewport.mm */; };
+               49E834CD13814F7D007A6598 /* GLESDebugDraw.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834C913814F7D007A6598 /* GLESDebugDraw.h */; };
+               49E834CE13814F7D007A6598 /* GLESDebugDraw.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834CA13814F7D007A6598 /* GLESDebugDraw.mm */; };
+               49E834D3138166A6007A6598 /* QQSparrowExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834D1138166A6007A6598 /* QQSparrowExtensions.h */; };
+               49E834D4138166A6007A6598 /* QQSparrowExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49E834D2138166A6007A6598 /* QQSparrowExtensions.mm */; };
                49F2D9C413764666000B6B8C /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2D9B013764666000B6B8C /* main.mm */; };
-               49F2D9C513764666000B6B8C /* RootAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2D9B513764666000B6B8C /* RootAppDelegate.mm */; };
-               49F2D9C613764666000B6B8C /* Game.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2D9B813764666000B6B8C /* Game.mm */; };
-               49F2D9C713764666000B6B8C /* MainWindow_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49F2D9BB13764666000B6B8C /* MainWindow_iPad.xib */; };
-               49F2D9C813764666000B6B8C /* RootAppDelegate_iPad.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2D9BE13764666000B6B8C /* RootAppDelegate_iPad.mm */; };
-               49F2D9C913764666000B6B8C /* MainWindow_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 49F2D9C013764666000B6B8C /* MainWindow_iPhone.xib */; };
-               49F2D9CA13764666000B6B8C /* RootAppDelegate_iPhone.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2D9C313764666000B6B8C /* RootAppDelegate_iPhone.mm */; };
-               49F2D9CD13764710000B6B8C /* RootAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2D9B413764666000B6B8C /* RootAppDelegate.h */; };
-               49F2D9CE13764710000B6B8C /* Game.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2D9B713764666000B6B8C /* Game.h */; };
-               49F2D9CF13764710000B6B8C /* RootAppDelegate_iPad.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2D9BD13764666000B6B8C /* RootAppDelegate_iPad.h */; };
-               49F2D9D013764710000B6B8C /* RootAppDelegate_iPhone.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2D9C213764666000B6B8C /* RootAppDelegate_iPhone.h */; };
                49F2D9D713764A9B000B6B8C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 49F2D9D413764A9B000B6B8C /* InfoPlist.strings */; };
                49F2DA8213764ED6000B6B8C /* SPAVSound.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2DA2613764ED5000B6B8C /* SPAVSound.h */; };
                49F2DA8313764ED6000B6B8C /* SPAVSound.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F2DA2713764ED5000B6B8C /* SPAVSound.m */; };
                49F2DADD13764ED6000B6B8C /* SPUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2DA8013764ED6000B6B8C /* SPUtils.h */; };
                49F2DADE13764ED6000B6B8C /* SPUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 49F2DA8113764ED6000B6B8C /* SPUtils.m */; };
                49F2DADF13764ED6000B6B8C /* Sparrow.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2DA1D13764ED5000B6B8C /* Sparrow.h */; };
-               49F2DB341376632E000B6B8C /* Unit.h in Headers */ = {isa = PBXBuildFile; fileRef = 49F2DB321376632E000B6B8C /* Unit.h */; };
-               49F2DB351376632E000B6B8C /* Unit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49F2DB331376632E000B6B8C /* Unit.mm */; };
                4B8B2A3213784D2D00CA4076 /* tank-pink.png in Resources */ = {isa = PBXBuildFile; fileRef = 4B8B2A3113784D2D00CA4076 /* tank-pink.png */; };
                4B8B2A50137D098500CA4076 /* AnimationContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B2A4E137D098500CA4076 /* AnimationContainer.h */; };
-               4B8B2A51137D098500CA4076 /* AnimationContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B2A4F137D098500CA4076 /* AnimationContainer.m */; };
+               4B8B2A51137D098500CA4076 /* AnimationContainer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B2A4F137D098500CA4076 /* AnimationContainer.mm */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
                494DE9961376927C00FDB3D7 /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libBox2D.a; sourceTree = SOURCE_ROOT; };
-               496D95E91379865A00C1D33E /* PhysicsDebugView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhysicsDebugView.h; sourceTree = "<group>"; };
-               496D95EA1379865A00C1D33E /* PhysicsDebugView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PhysicsDebugView.mm; sourceTree = "<group>"; };
-               496D95F7137A358100C1D33E /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = "<group>"; };
-               496D95F8137A358100C1D33E /* Viewport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Viewport.mm; sourceTree = "<group>"; };
                499668C213692E2D006E8125 /* Tanks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tanks.app; sourceTree = BUILT_PRODUCTS_DIR; };
                499668C613692E2D006E8125 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
                499668C813692E2D006E8125 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
                49966916136930E8006E8125 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
                49DA67D2137847A7004841E9 /* World.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = World.h; sourceTree = "<group>"; };
                49DA67D3137847A7004841E9 /* World.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = World.mm; sourceTree = "<group>"; };
-               49E834421380CB61007A6598 /* GLES-Render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GLES-Render.h"; sourceTree = "<group>"; };
-               49E834431380CB61007A6598 /* GLES-Render.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "GLES-Render.mm"; sourceTree = "<group>"; };
-               49E8344F1380E234007A6598 /* Displayable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Displayable.h; sourceTree = "<group>"; };
-               49E834511380EBB2007A6598 /* Actor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Actor.h; sourceTree = "<group>"; };
-               49E834521380EBB2007A6598 /* Actor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Actor.mm; sourceTree = "<group>"; };
-               49E8345513810618007A6598 /* Active.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Active.h; sourceTree = "<group>"; };
+               49E8349E13812427007A6598 /* Active.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Active.h; sourceTree = "<group>"; };
+               49E834A013812427007A6598 /* Actor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Actor.h; sourceTree = "<group>"; };
+               49E834A113812427007A6598 /* Actor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Actor.mm; sourceTree = "<group>"; };
+               49E834A213812427007A6598 /* Unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unit.h; sourceTree = "<group>"; };
+               49E834A313812427007A6598 /* Unit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Unit.mm; sourceTree = "<group>"; };
+               49E834A413812427007A6598 /* Displayable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Displayable.h; sourceTree = "<group>"; };
+               49E834A513812427007A6598 /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Game.h; sourceTree = "<group>"; };
+               49E834A613812427007A6598 /* Game.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Game.mm; sourceTree = "<group>"; };
+               49E834B013812555007A6598 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+               49E834B113812555007A6598 /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
+               49E834B313812555007A6598 /* AppDelegate_iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_iPad.h; sourceTree = "<group>"; };
+               49E834B413812555007A6598 /* AppDelegate_iPad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate_iPad.mm; sourceTree = "<group>"; };
+               49E834B613812555007A6598 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow_iPad.xib; sourceTree = "<group>"; };
+               49E834B813812555007A6598 /* AppDelegate_iPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate_iPhone.h; sourceTree = "<group>"; };
+               49E834B913812555007A6598 /* AppDelegate_iPhone.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate_iPhone.mm; sourceTree = "<group>"; };
+               49E834BB13812555007A6598 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow_iPhone.xib; sourceTree = "<group>"; };
+               49E834BC13812555007A6598 /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = "<group>"; };
+               49E834BD13812555007A6598 /* Viewport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Viewport.mm; sourceTree = "<group>"; };
+               49E834C913814F7D007A6598 /* GLESDebugDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLESDebugDraw.h; sourceTree = "<group>"; };
+               49E834CA13814F7D007A6598 /* GLESDebugDraw.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GLESDebugDraw.mm; sourceTree = "<group>"; };
+               49E834CB13814F7D007A6598 /* PhysicsDebugView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhysicsDebugView.h; sourceTree = "<group>"; };
+               49E834CC13814F7D007A6598 /* PhysicsDebugView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PhysicsDebugView.mm; sourceTree = "<group>"; };
+               49E834D1138166A6007A6598 /* QQSparrowExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQSparrowExtensions.h; sourceTree = "<group>"; };
+               49E834D2138166A6007A6598 /* QQSparrowExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QQSparrowExtensions.mm; sourceTree = "<group>"; };
                49F2D99B137645DF000B6B8C /* box2d-ios.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "box2d-ios.xcodeproj"; path = "libs/box2d/box2d-ios.xcodeproj"; sourceTree = "<group>"; };
                49F2D9B013764666000B6B8C /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
                49F2D9B213764666000B6B8C /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prefix.pch; sourceTree = "<group>"; };
-               49F2D9B413764666000B6B8C /* RootAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootAppDelegate.h; sourceTree = "<group>"; };
-               49F2D9B513764666000B6B8C /* RootAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootAppDelegate.mm; sourceTree = "<group>"; };
-               49F2D9B713764666000B6B8C /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Game.h; sourceTree = "<group>"; };
-               49F2D9B813764666000B6B8C /* Game.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Game.mm; sourceTree = "<group>"; };
-               49F2D9BC13764666000B6B8C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow_iPad.xib; sourceTree = "<group>"; };
-               49F2D9BD13764666000B6B8C /* RootAppDelegate_iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootAppDelegate_iPad.h; sourceTree = "<group>"; };
-               49F2D9BE13764666000B6B8C /* RootAppDelegate_iPad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootAppDelegate_iPad.mm; sourceTree = "<group>"; };
-               49F2D9C113764666000B6B8C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow_iPhone.xib; sourceTree = "<group>"; };
-               49F2D9C213764666000B6B8C /* RootAppDelegate_iPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootAppDelegate_iPhone.h; sourceTree = "<group>"; };
-               49F2D9C313764666000B6B8C /* RootAppDelegate_iPhone.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootAppDelegate_iPhone.mm; sourceTree = "<group>"; };
                49F2D9D513764A9B000B6B8C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
                49F2D9D613764A9B000B6B8C /* tanks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "tanks-Info.plist"; sourceTree = "<group>"; };
                49F2DA1D13764ED5000B6B8C /* Sparrow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparrow.h; sourceTree = "<group>"; };
                49F2DA7F13764ED6000B6B8C /* SPPoolObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPPoolObject.m; sourceTree = "<group>"; };
                49F2DA8013764ED6000B6B8C /* SPUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUtils.h; sourceTree = "<group>"; };
                49F2DA8113764ED6000B6B8C /* SPUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUtils.m; sourceTree = "<group>"; };
-               49F2DB321376632E000B6B8C /* Unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unit.h; sourceTree = "<group>"; };
-               49F2DB331376632E000B6B8C /* Unit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Unit.mm; sourceTree = "<group>"; };
                4B8B2A3113784D2D00CA4076 /* tank-pink.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "tank-pink.png"; path = "textures/tank-pink.png"; sourceTree = "<group>"; };
                4B8B2A4E137D098500CA4076 /* AnimationContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationContainer.h; path = animation/AnimationContainer.h; sourceTree = "<group>"; };
-               4B8B2A4F137D098500CA4076 /* AnimationContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AnimationContainer.m; path = animation/AnimationContainer.m; sourceTree = "<group>"; };
+               4B8B2A4F137D098500CA4076 /* AnimationContainer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AnimationContainer.mm; path = animation/AnimationContainer.mm; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                        name = Frameworks;
                        sourceTree = "<group>";
                };
-               49F2D99C137645DF000B6B8C /* Products */ = {
+               49E8349D13812427007A6598 /* game */ = {
                        isa = PBXGroup;
                        children = (
-                               49F2D9A3137645E0000B6B8C /* libBox2D.a */,
+                               49E8349F13812427007A6598 /* actor */,
+                               49E8349E13812427007A6598 /* Active.h */,
+                               49E834A413812427007A6598 /* Displayable.h */,
+                               49E834A513812427007A6598 /* Game.h */,
+                               49E834A613812427007A6598 /* Game.mm */,
                        );
-                       name = Products;
+                       path = game;
                        sourceTree = "<group>";
                };
-               49F2D9AE13764666000B6B8C /* src */ = {
+               49E8349F13812427007A6598 /* actor */ = {
                        isa = PBXGroup;
                        children = (
-                               49F2D9B013764666000B6B8C /* main.mm */,
-                               49F2D9B113764666000B6B8C /* physics */,
-                               49F2D9B213764666000B6B8C /* prefix.pch */,
-                               49F2D9B313764666000B6B8C /* render */,
-                               49F2D9B613764666000B6B8C /* tanks */,
-                               49F2D9B913764666000B6B8C /* ui */,
+                               49E834A013812427007A6598 /* Actor.h */,
+                               49E834A113812427007A6598 /* Actor.mm */,
+                               49E834A213812427007A6598 /* Unit.h */,
+                               49E834A313812427007A6598 /* Unit.mm */,
                        );
-                       path = src;
+                       path = actor;
                        sourceTree = "<group>";
                };
-               49F2D9B113764666000B6B8C /* physics */ = {
+               49E834AF13812555007A6598 /* ui */ = {
                        isa = PBXGroup;
                        children = (
-                               49DA67D2137847A7004841E9 /* World.h */,
-                               49DA67D3137847A7004841E9 /* World.mm */,
-                               496D95E91379865A00C1D33E /* PhysicsDebugView.h */,
-                               496D95EA1379865A00C1D33E /* PhysicsDebugView.mm */,
+                               49E834B213812555007A6598 /* iPad */,
+                               49E834B713812555007A6598 /* iPhone */,
+                               49E834B013812555007A6598 /* AppDelegate.h */,
+                               49E834B113812555007A6598 /* AppDelegate.mm */,
+                               49E834BC13812555007A6598 /* Viewport.h */,
+                               49E834BD13812555007A6598 /* Viewport.mm */,
                        );
-                       path = physics;
+                       path = ui;
                        sourceTree = "<group>";
                };
-               49F2D9B313764666000B6B8C /* render */ = {
+               49E834B213812555007A6598 /* iPad */ = {
                        isa = PBXGroup;
                        children = (
-                               4B8B2A4D137D090D00CA4076 /* animation */,
+                               49E834B313812555007A6598 /* AppDelegate_iPad.h */,
+                               49E834B413812555007A6598 /* AppDelegate_iPad.mm */,
+                               49E834B513812555007A6598 /* MainWindow_iPad.xib */,
                        );
-                       path = render;
+                       path = iPad;
                        sourceTree = "<group>";
                };
-               49F2D9B613764666000B6B8C /* tanks */ = {
+               49E834B713812555007A6598 /* iPhone */ = {
                        isa = PBXGroup;
                        children = (
-                               49E8345513810618007A6598 /* Active.h */,
-                               49E8344F1380E234007A6598 /* Displayable.h */,
-                               49F2DB311376632E000B6B8C /* unit */,
-                               49F2D9B713764666000B6B8C /* Game.h */,
-                               49F2D9B813764666000B6B8C /* Game.mm */,
+                               49E834B813812555007A6598 /* AppDelegate_iPhone.h */,
+                               49E834B913812555007A6598 /* AppDelegate_iPhone.mm */,
+                               49E834BA13812555007A6598 /* MainWindow_iPhone.xib */,
                        );
-                       path = tanks;
+                       path = iPhone;
                        sourceTree = "<group>";
                };
-               49F2D9B913764666000B6B8C /* ui */ = {
+               49E834C813814F7C007A6598 /* debug */ = {
                        isa = PBXGroup;
                        children = (
-                               49E834421380CB61007A6598 /* GLES-Render.h */,
-                               49E834431380CB61007A6598 /* GLES-Render.mm */,
-                               49F2D9BA13764666000B6B8C /* iPad */,
-                               49F2D9BF13764666000B6B8C /* iPhone */,
-                               496D95F7137A358100C1D33E /* Viewport.h */,
-                               496D95F8137A358100C1D33E /* Viewport.mm */,
+                               49E834C913814F7D007A6598 /* GLESDebugDraw.h */,
+                               49E834CA13814F7D007A6598 /* GLESDebugDraw.mm */,
+                               49E834CB13814F7D007A6598 /* PhysicsDebugView.h */,
+                               49E834CC13814F7D007A6598 /* PhysicsDebugView.mm */,
                        );
-                       path = ui;
+                       path = debug;
                        sourceTree = "<group>";
                };
-               49F2D9BA13764666000B6B8C /* iPad */ = {
+               49F2D99C137645DF000B6B8C /* Products */ = {
                        isa = PBXGroup;
                        children = (
-                               49F2D9BB13764666000B6B8C /* MainWindow_iPad.xib */,
-                               49F2D9BD13764666000B6B8C /* RootAppDelegate_iPad.h */,
-                               49F2D9BE13764666000B6B8C /* RootAppDelegate_iPad.mm */,
+                               49F2D9A3137645E0000B6B8C /* libBox2D.a */,
                        );
-                       path = iPad;
+                       name = Products;
                        sourceTree = "<group>";
                };
-               49F2D9BF13764666000B6B8C /* iPhone */ = {
+               49F2D9AE13764666000B6B8C /* src */ = {
                        isa = PBXGroup;
                        children = (
-                               49F2D9C013764666000B6B8C /* MainWindow_iPhone.xib */,
-                               49F2D9C213764666000B6B8C /* RootAppDelegate_iPhone.h */,
-                               49F2D9C313764666000B6B8C /* RootAppDelegate_iPhone.mm */,
+                               49E8349D13812427007A6598 /* game */,
+                               49F2D9B113764666000B6B8C /* physics */,
+                               49F2D9B313764666000B6B8C /* render */,
+                               49E834AF13812555007A6598 /* ui */,
+                               49F2D9B013764666000B6B8C /* main.mm */,
+                               49F2D9B213764666000B6B8C /* prefix.pch */,
                        );
-                       path = iPhone;
+                       path = src;
+                       sourceTree = "<group>";
+               };
+               49F2D9B113764666000B6B8C /* physics */ = {
+                       isa = PBXGroup;
+                       children = (
+                               49E834C813814F7C007A6598 /* debug */,
+                               49DA67D2137847A7004841E9 /* World.h */,
+                               49DA67D3137847A7004841E9 /* World.mm */,
+                       );
+                       path = physics;
+                       sourceTree = "<group>";
+               };
+               49F2D9B313764666000B6B8C /* render */ = {
+                       isa = PBXGroup;
+                       children = (
+                               4B8B2A4D137D090D00CA4076 /* animation */,
+                               49E834D1138166A6007A6598 /* QQSparrowExtensions.h */,
+                               49E834D2138166A6007A6598 /* QQSparrowExtensions.mm */,
+                       );
+                       path = render;
                        sourceTree = "<group>";
                };
                49F2D9D313764A9B000B6B8C /* etc */ = {
                        name = libs;
                        sourceTree = "<group>";
                };
-               49F2DB311376632E000B6B8C /* unit */ = {
-                       isa = PBXGroup;
-                       children = (
-                               49F2DB321376632E000B6B8C /* Unit.h */,
-                               49F2DB331376632E000B6B8C /* Unit.mm */,
-                               49E834511380EBB2007A6598 /* Actor.h */,
-                               49E834521380EBB2007A6598 /* Actor.mm */,
-                       );
-                       path = unit;
-                       sourceTree = "<group>";
-               };
                4B8B2A3313784D3400CA4076 /* textures */ = {
                        isa = PBXGroup;
                        children = (
                        isa = PBXGroup;
                        children = (
                                4B8B2A4E137D098500CA4076 /* AnimationContainer.h */,
-                               4B8B2A4F137D098500CA4076 /* AnimationContainer.m */,
+                               4B8B2A4F137D098500CA4076 /* AnimationContainer.mm */,
                        );
                        name = animation;
                        sourceTree = "<group>";
                                49F2DADB13764ED6000B6B8C /* SPPoolObject.h in Headers */,
                                49F2DADD13764ED6000B6B8C /* SPUtils.h in Headers */,
                                49F2DADF13764ED6000B6B8C /* Sparrow.h in Headers */,
-                               49F2D9CD13764710000B6B8C /* RootAppDelegate.h in Headers */,
-                               49F2D9CF13764710000B6B8C /* RootAppDelegate_iPad.h in Headers */,
-                               49F2D9D013764710000B6B8C /* RootAppDelegate_iPhone.h in Headers */,
-                               49F2D9CE13764710000B6B8C /* Game.h in Headers */,
-                               49F2DB341376632E000B6B8C /* Unit.h in Headers */,
                                49DA67D4137847A7004841E9 /* World.h in Headers */,
-                               49E834441380CB61007A6598 /* GLES-Render.h in Headers */,
-                               49E834501380E234007A6598 /* Displayable.h in Headers */,
-                               49E834531380EBB2007A6598 /* Actor.h in Headers */,
-                               49E8345613810618007A6598 /* Active.h in Headers */,
                                4B8B2A50137D098500CA4076 /* AnimationContainer.h in Headers */,
+                               49E834A713812427007A6598 /* Active.h in Headers */,
+                               49E834A813812427007A6598 /* Actor.h in Headers */,
+                               49E834AC13812427007A6598 /* Displayable.h in Headers */,
+                               4995ABB213816CCE00334646 /* Game.h in Headers */,
+                               4995ABB313816CD400334646 /* Unit.h in Headers */,
+                               49E834BE13812555007A6598 /* AppDelegate.h in Headers */,
+                               49E834C013812555007A6598 /* AppDelegate_iPad.h in Headers */,
+                               49E834C313812555007A6598 /* AppDelegate_iPhone.h in Headers */,
+                               49E834C613812555007A6598 /* Viewport.h in Headers */,
+                               49E834CD13814F7D007A6598 /* GLESDebugDraw.h in Headers */,
+                               49E834D3138166A6007A6598 /* QQSparrowExtensions.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               49F2D9C713764666000B6B8C /* MainWindow_iPad.xib in Resources */,
-                               49F2D9C913764666000B6B8C /* MainWindow_iPhone.xib in Resources */,
                                49F2D9D713764A9B000B6B8C /* InfoPlist.strings in Resources */,
                                4B8B2A3213784D2D00CA4076 /* tank-pink.png in Resources */,
+                               49E834C213812555007A6598 /* MainWindow_iPad.xib in Resources */,
+                               49E834C513812555007A6598 /* MainWindow_iPhone.xib in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                49F2DADA13764ED6000B6B8C /* SPNSExtensions.m in Sources */,
                                49F2DADC13764ED6000B6B8C /* SPPoolObject.m in Sources */,
                                49F2DADE13764ED6000B6B8C /* SPUtils.m in Sources */,
-                               49F2D9C513764666000B6B8C /* RootAppDelegate.mm in Sources */,
-                               49F2D9C813764666000B6B8C /* RootAppDelegate_iPad.mm in Sources */,
-                               49F2D9CA13764666000B6B8C /* RootAppDelegate_iPhone.mm in Sources */,
                                49DA67D5137847A7004841E9 /* World.mm in Sources */,
-                               49F2D9C613764666000B6B8C /* Game.mm in Sources */,
-                               49F2DB351376632E000B6B8C /* Unit.mm in Sources */,
-                               49E834451380CB61007A6598 /* GLES-Render.mm in Sources */,
-                               49E834541380EBB2007A6598 /* Actor.mm in Sources */,
-                               4B8B2A51137D098500CA4076 /* AnimationContainer.m in Sources */,
+                               4B8B2A51137D098500CA4076 /* AnimationContainer.mm in Sources */,
                                49F2D9C413764666000B6B8C /* main.mm in Sources */,
+                               49E834A913812427007A6598 /* Actor.mm in Sources */,
+                               49E834AB13812427007A6598 /* Unit.mm in Sources */,
+                               49E834AE13812427007A6598 /* Game.mm in Sources */,
+                               49E834BF13812555007A6598 /* AppDelegate.mm in Sources */,
+                               49E834C113812555007A6598 /* AppDelegate_iPad.mm in Sources */,
+                               49E834C413812555007A6598 /* AppDelegate_iPhone.mm in Sources */,
+                               49E834C713812555007A6598 /* Viewport.mm in Sources */,
+                               49E834CE13814F7D007A6598 /* GLESDebugDraw.mm in Sources */,
+                               49E834D4138166A6007A6598 /* QQSparrowExtensions.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
 /* End PBXTargetDependency section */
 
 /* Begin PBXVariantGroup section */
-               49F2D9BB13764666000B6B8C /* MainWindow_iPad.xib */ = {
+               49E834B513812555007A6598 /* MainWindow_iPad.xib */ = {
                        isa = PBXVariantGroup;
                        children = (
-                               49F2D9BC13764666000B6B8C /* en */,
+                               49E834B613812555007A6598 /* en */,
                        );
                        name = MainWindow_iPad.xib;
                        sourceTree = "<group>";
                };
-               49F2D9C013764666000B6B8C /* MainWindow_iPhone.xib */ = {
+               49E834BA13812555007A6598 /* MainWindow_iPhone.xib */ = {
                        isa = PBXVariantGroup;
                        children = (
-                               49F2D9C113764666000B6B8C /* en */,
+                               49E834BB13812555007A6598 /* en */,
                        );
                        name = MainWindow_iPhone.xib;
                        sourceTree = "<group>";
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                GCC_PREFIX_HEADER = src/prefix.pch;
                                INFOPLIST_FILE = "etc/tanks-Info.plist";
                                LIBRARY_SEARCH_PATHS = (
                                        "\"$(SRCROOT)\"",
                                );
                                PRODUCT_NAME = "$(TARGET_NAME)";
-                               USER_HEADER_SEARCH_PATHS = "src libs libs/**";
+                               USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/src\" \"$(SRCROOT)/libs\" \"$(SRCROOT)/libs/**\"";
                        };
                        name = Debug;
                };
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                COPY_PHASE_STRIP = YES;
-                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
                                GCC_PREFIX_HEADER = src/prefix.pch;
                                INFOPLIST_FILE = "etc/tanks-Info.plist";
                                LIBRARY_SEARCH_PATHS = (
                                        "\"$(SRCROOT)\"",
                                );
                                PRODUCT_NAME = "$(TARGET_NAME)";
-                               USER_HEADER_SEARCH_PATHS = "src libs libs/**";
+                               USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/src\" \"$(SRCROOT)/libs\" \"$(SRCROOT)/libs/**\"";
                                VALIDATE_PRODUCT = YES;
                        };
                        name = Release;