QQ
authordsc <david.schoonover@gmail.com>
Mon, 16 May 2011 19:38:23 +0000 (12:38 -0700)
committerdsc <david.schoonover@gmail.com>
Mon, 16 May 2011 19:38:23 +0000 (12:38 -0700)
30 files changed:
src/game/Game.h [deleted file]
src/game/QQActive.h [moved from src/game/Active.h with 54% similarity]
src/game/QQDisplayable.h [moved from src/game/Displayable.h with 75% similarity]
src/game/QQGame.h [new file with mode: 0644]
src/game/QQGame.mm [moved from src/game/Game.mm with 72% similarity]
src/game/actor/Actor.h [deleted file]
src/game/actor/Actor.mm [deleted file]
src/game/actor/QQActor.h [new file with mode: 0644]
src/game/actor/QQActor.mm [new file with mode: 0644]
src/game/actor/QQUnit.h [moved from src/game/actor/Unit.h with 78% similarity]
src/game/actor/QQUnit.mm [moved from src/game/actor/Unit.mm with 97% similarity]
src/physics/QQWorld.h [moved from src/physics/World.h with 63% similarity]
src/physics/QQWorld.mm [moved from src/physics/World.mm with 84% similarity]
src/physics/debug/QQGLESDebugDraw.h [moved from src/physics/debug/GLESDebugDraw.h with 97% similarity]
src/physics/debug/QQGLESDebugDraw.mm [moved from src/physics/debug/GLESDebugDraw.mm with 81% similarity]
src/physics/debug/QQPhysicsDebugView.h [moved from src/physics/debug/PhysicsDebugView.h with 94% similarity]
src/physics/debug/QQPhysicsDebugView.mm [moved from src/physics/debug/PhysicsDebugView.mm with 98% similarity]
src/render/animation/QQAnimationContainer.h [moved from src/render/animation/AnimationContainer.h with 90% similarity]
src/render/animation/QQAnimationContainer.mm [moved from src/render/animation/AnimationContainer.mm with 97% similarity]
src/ui/QQAppDelegate.h [moved from src/ui/AppDelegate.h with 55% similarity]
src/ui/QQAppDelegate.mm [moved from src/ui/AppDelegate.mm with 87% similarity]
src/ui/QQViewport.h [moved from src/ui/Viewport.h with 75% similarity]
src/ui/QQViewport.mm [moved from src/ui/Viewport.mm with 87% similarity]
src/ui/iPad/QQAppDelegate_iPad.h [moved from src/ui/iPhone/AppDelegate_iPhone.h with 58% similarity]
src/ui/iPad/QQAppDelegate_iPad.mm [moved from src/ui/iPhone/AppDelegate_iPhone.mm with 62% similarity]
src/ui/iPad/en.lproj/MainWindow_iPad.xib
src/ui/iPhone/QQAppDelegate_iPhone.h [moved from src/ui/iPad/AppDelegate_iPad.h with 57% similarity]
src/ui/iPhone/QQAppDelegate_iPhone.mm [moved from src/ui/iPad/AppDelegate_iPad.mm with 60% similarity]
src/ui/iPhone/en.lproj/MainWindow_iPhone.xib
tanks.xcodeproj/project.pbxproj

diff --git a/src/game/Game.h b/src/game/Game.h
deleted file mode 100644 (file)
index 3232ced..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#import "Sparrow.h"
-
-#import "game/actor/Unit.h"
-#import "physics/World.h"
-
-
-@interface Game : SPStage {
-    
-    long ticks;
-    
-@private
-    Unit*  _unit;
-    World* _world;
-}
-
-@property (nonatomic, retain) World* world;
-
-- (void) onEnterFrame:(SPEnterFrameEvent*)event;
-
-+ (Game*) current;
-
-@end
similarity index 54%
rename from src/game/Active.h
rename to src/game/QQActive.h
index b9514a1..62a0681 100644 (file)
@@ -1,8 +1,8 @@
 
 /**
- * Anything that takes a turn is Active.
+ * Anything that takes a turn is QQActive.
  */
-@protocol Active
+@protocol QQActive
 
 @property (nonatomic, getter=isActive) BOOL active;
 
similarity index 75%
rename from src/game/Displayable.h
rename to src/game/QQDisplayable.h
index 852bf95..ef6f1ef 100644 (file)
@@ -1,7 +1,7 @@
 #import "Sparrow.h"
 
 
-@protocol Displayable
+@protocol QQDisplayable
 
 @property (nonatomic, retain, readonly) SPDisplayObject* shape;
 
diff --git a/src/game/QQGame.h b/src/game/QQGame.h
new file mode 100644 (file)
index 0000000..0857ebc
--- /dev/null
@@ -0,0 +1,22 @@
+#import "Sparrow.h"
+
+#import "game/actor/QQUnit.h"
+#import "physics/QQWorld.h"
+
+
+@interface QQGame : SPStage {
+    
+    long ticks;
+    
+@private
+    QQUnit*  _unit;
+    QQWorld* _world;
+}
+
+@property (nonatomic, retain) QQWorld* world;
+
+- (void) onEnterFrame:(SPEnterFrameEvent*)event;
+
++ (QQGame*) current;
+
+@end
similarity index 72%
rename from src/game/Game.mm
rename to src/game/QQGame.mm
index 9f8aa0b..a43d26a 100644 (file)
@@ -1,18 +1,18 @@
-#import "Game.h"
-#import "game/actor/Unit.h"
+#import "QQGame.h"
+#import "game/actor/QQUnit.h"
 
 
 
-static Game* _currentGame = NULL;
+static QQGame* _currentGame = NULL;
 
 
 
-@interface Game ()
-@property (nonatomic, retain) Unit* unit;
+@interface QQGame ()
+@property (nonatomic, retain) QQUnit* unit;
 @end
 
 
-@implementation Game
+@implementation QQGame
 @synthesize world = _world;
 @synthesize unit  = _unit;
 
@@ -20,17 +20,17 @@ static Game* _currentGame = NULL;
 - (id) init {
     if (_currentGame) {
         [self release];
-        [NSException raise:@"TooManyGames" format:@"cannot instantiate more than one Game at a time!"];
+        [NSException raise:@"TooManyGames" format:@"cannot instantiate more than one QQGame at a time!"];
     }
     
     if ( (self = [super init]) ){
         _currentGame = self;
         ticks = 0l;
         
-        _world = [[World alloc] init];
+        _world = [[QQWorld alloc] init];
         [self addEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME];
         
-        _unit = [[Unit alloc] init];
+        _unit = [[QQUnit alloc] init];
         // [self addEventListener:@selector(onTouch:) atObject:_unit forType:SP_EVENT_TYPE_TOUCH];
         // if (_unit.shape) [self addChild:_unit.shape];
     }
@@ -53,9 +53,9 @@ static Game* _currentGame = NULL;
     [self.world step];
 }
 
-+ (Game*) current {
++ (QQGame*) current {
     if (!_currentGame)
-        [[[Game alloc] init]    // init assigns to singleton, but singleton is a weakref,
+        [[[QQGame alloc] init]    // init assigns to singleton, but singleton is a weakref,
             autorelease];       // XXX: so game will still be released if not retained...
     return _currentGame;
 }
diff --git a/src/game/actor/Actor.h b/src/game/actor/Actor.h
deleted file mode 100644 (file)
index ab2f513..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#import "game/Active.h"
-#import "game/Displayable.h"
-#import "physics/World.h"
-
-@class Game;
-
-
-@interface Actor : NSObject <Active, Displayable> {
-    
-@private
-    BOOL   _active;
-}
-
-@property (nonatomic, readonly) Game*  game;
-@property (nonatomic, readonly) World* world;
-
-
-
-@end
diff --git a/src/game/actor/Actor.mm b/src/game/actor/Actor.mm
deleted file mode 100644 (file)
index ba63e62..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#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/QQActor.h b/src/game/actor/QQActor.h
new file mode 100644 (file)
index 0000000..abe284c
--- /dev/null
@@ -0,0 +1,19 @@
+#import "game/QQActive.h"
+#import "game/QQDisplayable.h"
+#import "physics/QQWorld.h"
+
+@class QQGame;
+
+
+@interface QQActor : NSObject <QQActive, QQDisplayable> {
+    
+@private
+    BOOL _active;
+}
+
+@property (nonatomic, readonly) QQGame*  game;
+@property (nonatomic, readonly) QQWorld* world;
+
+
+
+@end
diff --git a/src/game/actor/QQActor.mm b/src/game/actor/QQActor.mm
new file mode 100644 (file)
index 0000000..944b26c
--- /dev/null
@@ -0,0 +1,18 @@
+#import "QQActor.h"
+#import "game/QQGame.h"
+
+
+@implementation QQActor
+
+@synthesize active;
+
+- (QQGame*)  game  { return QQGame.current; }
+- (QQWorld*) world { return self.game.world; }
+
+- (SPDisplayObject*) shape { return nil; }
+
+- (void) act {
+    // stub
+}
+
+@end
similarity index 78%
rename from src/game/actor/Unit.h
rename to src/game/actor/QQUnit.h
index c6650c2..710e1e9 100644 (file)
@@ -1,11 +1,11 @@
 #import "Sparrow.h"
 #import "render/QQSparrowExtensions.h"
 
-#import "game/actor/Actor.h"
-#import "physics/World.h"
+#import "game/actor/QQActor.h"
+#import "physics/QQWorld.h"
 
 
-@interface Unit : Actor {
+@interface QQUnit : QQActor {
 
 @private
     SPDisplayObject* _shape;
similarity index 97%
rename from src/game/actor/Unit.mm
rename to src/game/actor/QQUnit.mm
index f37dd31..0ea8b62 100644 (file)
@@ -1,8 +1,8 @@
 #import "Sparrow.h"
-#import "Unit.h"
+#import "QQUnit.h"
 
 
-@implementation Unit
+@implementation QQUnit
 
 @synthesize shape = _shape;
 
similarity index 63%
rename from src/physics/World.h
rename to src/physics/QQWorld.h
index c0663fa..6087703 100644 (file)
@@ -1,8 +1,8 @@
 #include <Box2D/Box2D.h>
-#import "physics/debug/GLESDebugDraw.h"
+#import "physics/debug/QQGLESDebugDraw.h"
 
 
-@interface World : NSObject {
+@interface QQWorld : NSObject {
 
 @private
     float _timestep;
@@ -10,7 +10,7 @@
     int _positionIterations;
     
     b2World* _world;
-    GLESDebugDraw debugDraw;
+    QQGLESDebugDraw debugDraw;
 }
 
 @property (nonatomic, readonly) b2World* world;
@@ -19,9 +19,9 @@
 @property (nonatomic, assign) int positionIterations;
 
 
-- (World*) init;
-- (World*) initWithTimestep:(float)hz;
-- (World*) initWithTimestep:(float)hz gravityX:(float)x y:(float)y;
+- (QQWorld*) init;
+- (QQWorld*) initWithTimestep:(float)hz;
+- (QQWorld*) initWithTimestep:(float)hz gravityX:(float)x y:(float)y;
 
 - (void) setGravityX:(float)x y:(float)y;
 
similarity index 84%
rename from src/physics/World.mm
rename to src/physics/QQWorld.mm
index 0beb32b..e6c3d71 100644 (file)
@@ -1,8 +1,8 @@
-#import "World.h"
+#import "QQWorld.h"
 
 
 
-@implementation World
+@implementation QQWorld
 
 @synthesize world = _world;
 @synthesize timestep = _timestep;
 @synthesize positionIterations = _positionIterations;
 
 
-- (World*) init {
+- (QQWorld*) init {
     return [self initWithTimestep:60.0f];
 }
 
-- (World*) initWithTimestep:(float)hz {
+- (QQWorld*) initWithTimestep:(float)hz {
     return [self initWithTimestep:hz gravityX:0.0f y:0.0f];
 }
 
-- (World*) initWithTimestep:(float)hz gravityX:(float)x y:(float)y {
+- (QQWorld*) initWithTimestep:(float)hz gravityX:(float)x y:(float)y {
     if ((self = [super init])) {
         _timestep = 1.0f/hz;
         _velocityIterations = 10;
similarity index 97%
rename from src/physics/debug/GLESDebugDraw.h
rename to src/physics/debug/QQGLESDebugDraw.h
index 6131196..058ac90 100644 (file)
@@ -32,7 +32,7 @@ struct b2AABB;
 
 // This class implements debug drawing callbacks that are invoked
 // inside b2World::Step.
-class GLESDebugDraw : public b2DebugDraw
+class QQGLESDebugDraw : public b2DebugDraw
 {
 public:
        void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);
similarity index 81%
rename from src/physics/debug/GLESDebugDraw.mm
rename to src/physics/debug/QQGLESDebugDraw.mm
index ab02a83..674f60e 100644 (file)
@@ -18,7 +18,7 @@
 * 3. This notice may not be removed or altered from any source distribution.
 */
 
-#include "GLESDebugDraw.h"
+#include "QQGLESDebugDraw.h"
 
 
 #include <cstdio>
 
 #include <cstring>
 
-void GLESDebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
+void QQGLESDebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
 {
        glColor4f(color.r, color.g, color.b,1);
        glVertexPointer(2, GL_FLOAT, 0, vertices);
        glDrawArrays(GL_LINE_LOOP, 0, vertexCount);
 }
 
-void GLESDebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
+void QQGLESDebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
 {
        glVertexPointer(2, GL_FLOAT, 0, vertices);
        
@@ -44,7 +44,7 @@ void GLESDebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount,
        glDrawArrays(GL_LINE_LOOP, 0, vertexCount);
 }
 
-void GLESDebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color)
+void QQGLESDebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color)
 {
        const float32 k_segments = 16.0f;
        int vertexCount=16;
@@ -66,7 +66,7 @@ void GLESDebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Col
        glDrawArrays(GL_TRIANGLE_FAN, 0, vertexCount);
 }
 
-void GLESDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
+void QQGLESDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
 {
        const float32 k_segments = 16.0f;
        int vertexCount=16;
@@ -92,7 +92,7 @@ void GLESDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const
        DrawSegment(center,center+radius*axis,color);
 }
 
-void GLESDebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color)
+void QQGLESDebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color)
 {
        glColor4f(color.r, color.g, color.b,1);
        GLfloat                         glVertices[] = {
@@ -102,7 +102,7 @@ void GLESDebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Colo
        glDrawArrays(GL_LINES, 0, 2);
 }
 
-void GLESDebugDraw::DrawTransform(const b2Transform& xf)
+void QQGLESDebugDraw::DrawTransform(const b2Transform& xf)
 {
        b2Vec2 p1 = xf.position, p2;
        const float32 k_axisScale = 0.4f;
@@ -114,7 +114,7 @@ void GLESDebugDraw::DrawTransform(const b2Transform& xf)
        DrawSegment(p1,p2,b2Color(0,1,0));
 }
 
-void GLESDebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& color)
+void QQGLESDebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& color)
 {
        glColor4f(color.r, color.g, color.b,1);
        glPointSize(size);
@@ -126,13 +126,13 @@ void GLESDebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& colo
        glPointSize(1.0f);
 }
 
-void GLESDebugDraw::DrawString(int x, int y, const char *string, ...)
+void QQGLESDebugDraw::DrawString(int x, int y, const char *string, ...)
 {
 
        /* Unsupported as yet. Could replace with bitmap font renderer at a later date */
 }
 
-void GLESDebugDraw::DrawAABB(b2AABB* aabb, const b2Color& c)
+void QQGLESDebugDraw::DrawAABB(b2AABB* aabb, const b2Color& c)
 {
        
        glColor4f(c.r, c.g, c.b,1);
similarity index 94%
rename from src/physics/debug/PhysicsDebugView.h
rename to src/physics/debug/QQPhysicsDebugView.h
index 57209d7..a8f63b6 100644 (file)
@@ -5,14 +5,14 @@
 
 #include <Box2D/Box2D.h>
 
-#import "physics/PhysicsView.h"
+#import "physics/QQPhysicsView.h"
 
 /*
 This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
 The view content is basically an EAGL surface you render your OpenGL scene into.
 Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
 */
-@interface PhysicsDebugView : PhysicsView {}
+@interface QQPhysicsDebugView : QQPhysicsView {}
 
 @property (nonatomic, readonly, getter=isRunning) BOOL running;
 @property (nonatomic, assign) NSTimeInterval animationInterval;
similarity index 98%
rename from src/physics/debug/PhysicsDebugView.mm
rename to src/physics/debug/QQPhysicsDebugView.mm
index be4444b..6c48262 100644 (file)
@@ -1,7 +1,7 @@
 #import <QuartzCore/QuartzCore.h>
 #import <OpenGLES/EAGLDrawable.h>
 
-#import "PhysicsDebugView.h"
+#import "QQPhysicsDebugView.h"
 
 
 #define USE_DEPTH_BUFFER 0
 
 
 // A class extension to declare private methods
-@interface PhysicsDebugView () {
+@interface QQPhysicsDebugView () {
 
 @private
-    World* _world;
+    QQWorld* _world;
     BOOL _running;
     
     NSTimer* animationTimer;
@@ -60,7 +60,7 @@
 
 
 
-@implementation PhysicsDebugView
+@implementation QQPhysicsDebugView
 
 @synthesize world = _world;
 @synthesize running = _running;
similarity index 90%
rename from src/render/animation/AnimationContainer.h
rename to src/render/animation/QQAnimationContainer.h
index 4b4d16c..80c0f84 100644 (file)
@@ -1,7 +1,7 @@
 #import "SPTextureAtlas.h"
 
 ////////////////////////////////////////////////////////////////////////////////////
-@interface AnimationContainer : NSObject <NSXMLParserDelegate> {
+@interface QQAnimationContainer : NSObject <NSXMLParserDelegate> {
 }
 
 ////////////////////////////////////////////////////////////////////////////////////
similarity index 97%
rename from src/render/animation/AnimationContainer.mm
rename to src/render/animation/QQAnimationContainer.mm
index 9f278ec..321929e 100644 (file)
@@ -1,11 +1,11 @@
-#import "AnimationContainer.h"
+#import "QQAnimationContainer.h"
 
 #import "SPMovieClip.h"
 
 
 ////////////////////////////////////////////////////////////////////////////////////
 // private method
-@interface AnimationContainer()
+@interface QQAnimationContainer()
 
 -(void)parseContentXml:(NSString *)contentPath;
 
@@ -13,7 +13,7 @@
 
 
 ////////////////////////////////////////////////////////////////////////////////////
-@implementation AnimationContainer
+@implementation QQAnimationContainer
 
 ////////////////////////////////////////////////////////////////////////////////////
 @synthesize mAnimationLookup;
similarity index 55%
rename from src/ui/AppDelegate.h
rename to src/ui/QQAppDelegate.h
index 7e85122..f868fe1 100644 (file)
@@ -1,16 +1,16 @@
 #import "Sparrow.h"
-#import "game/Game.h"
+#import "game/QQGame.h"
 
 
-@interface AppDelegate : NSObject <UIApplicationDelegate>
+@interface QQAppDelegate : NSObject <UIApplicationDelegate>
 {
     UIWindow* window;
     SPView* sparrowView;
-    Game* _game;
+    QQGame* _game;
 }
 
 @property (nonatomic, retain) IBOutlet UIWindow* window;
 @property (nonatomic, retain) IBOutlet SPView* sparrowView;
-@property (nonatomic, retain) Game* game;
+@property (nonatomic, retain) QQGame* game;
 
 @end
\ No newline at end of file
similarity index 87%
rename from src/ui/AppDelegate.mm
rename to src/ui/QQAppDelegate.mm
index 78f81dc..7eaeb17 100644 (file)
@@ -1,15 +1,15 @@
 //
-//  AppDelegate.m
+//  QQAppDelegate.m
 //  tanks
 //
 //  Created by dsc on 4/27/11.
 //  Copyright 2011 lttlst.com. All rights reserved.
 //
 
-#import "AppDelegate.h"
-#import "game/Game.h"
+#import "QQAppDelegate.h"
+#import "game/QQGame.h"
 
-@implementation AppDelegate
+@implementation QQAppDelegate
 
 @synthesize window;
 @synthesize sparrowView;
@@ -25,7 +25,7 @@
         sparrowView.frameRate = 60.0f;
    &