Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged CCDirector headers
  • Loading branch information
s1ddok committed Feb 29, 2016
1 parent 3a7472f commit 5dca56f
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 140 deletions.
1 change: 0 additions & 1 deletion UnitTests/CCNodeTests.m
Expand Up @@ -7,7 +7,6 @@

#import <XCTest/XCTest.h>
#import "cocos2d.h"
#import "CCDirector_Private.h"

@interface CCNodeTests : XCTestCase

Expand Down
1 change: 0 additions & 1 deletion UnitTests/CCPhysicsTests.m
Expand Up @@ -10,7 +10,6 @@
#import "cocos2d.h"

#import "CCPhysics+ObjectiveChipmunk.h"
#import "CCDirector_Private.h"
#import "AppDelegate.h"

@interface CCScheduler(Test)
Expand Down
2 changes: 1 addition & 1 deletion cocos2d-ui/CCTextField.m
Expand Up @@ -24,7 +24,7 @@

#import "CCTextField.h"
#import "CCControlSubclass.h"
#import "CCDirector_Private.h"
#import "CCDirector.h"
#import "CCPlatformTextField.h"
#if __CC_PLATFORM_IOS
#import "CCPlatformTextFieldIOS.h"
Expand Down
4 changes: 0 additions & 4 deletions cocos2d.xcodeproj/project.pbxproj
Expand Up @@ -343,7 +343,6 @@
7A59475419E3731000F65F90 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E0EAD1F0121F522A00B0C81C /* CCConfiguration.h */; };
7A59475619E3731100F65F90 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E2A25110A46CC600D894CE /* CCProtocols.h */; };
7A59475719E3731100F65F90 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5066020F0E38A70D000B500E /* CCScheduler.h */; };
7A59475919E3731100F65F90 /* CCDirector_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = B706B19918209FA000B27A2C /* CCDirector_Private.h */; };
7A59476019E3731400F65F90 /* CCPlatformTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD01E19649E03003D460C /* CCPlatformTextField.h */; };
7A59476219E3731400F65F90 /* CCPlatformTextFieldIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD02119649E03003D460C /* CCPlatformTextFieldIOS.h */; };
7A59476419E3731500F65F90 /* CCPlatformTextFieldMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD02419649E03003D460C /* CCPlatformTextFieldMac.h */; };
Expand Down Expand Up @@ -657,7 +656,6 @@
A6A0734917C78EF3004343C8 /* CCResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponder.m; sourceTree = "<group>"; };
A6DC4E0718055DCC00C280A6 /* CCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransition.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
A6DC4E0818055DCC00C280A6 /* CCTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransition.m; sourceTree = "<group>"; };
B706B19918209FA000B27A2C /* CCDirector_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDirector_Private.h; sourceTree = "<group>"; };
B74C2B9917BDA63A00A829C0 /* CCSprite9Slice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite9Slice.h; sourceTree = "<group>"; };
B74C2B9A17BDA63A00A829C0 /* CCSprite9Slice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSprite9Slice.m; sourceTree = "<group>"; };
B750162218124B6000708A2F /* CCControlSubclass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CCControlSubclass.h; path = "cocos2d-ui/CCControlSubclass.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -923,7 +921,6 @@
50E2A25110A46CC600D894CE /* CCProtocols.h */,
5066020F0E38A70D000B500E /* CCScheduler.h */,
506602100E38A70D000B500E /* CCScheduler.m */,
B706B19918209FA000B27A2C /* CCDirector_Private.h */,
D3903B0C1995288D003AA81A /* CCNoARC.m */,
);
path = cocos2d;
Expand Down Expand Up @@ -1554,7 +1551,6 @@
7A59475419E3731000F65F90 /* CCConfiguration.h in Headers */,
7A59475619E3731100F65F90 /* CCProtocols.h in Headers */,
7A59475719E3731100F65F90 /* CCScheduler.h in Headers */,
7A59475919E3731100F65F90 /* CCDirector_Private.h in Headers */,
7A59476019E3731400F65F90 /* CCPlatformTextField.h in Headers */,
7A59476219E3731400F65F90 /* CCPlatformTextFieldIOS.h in Headers */,
7A59476419E3731500F65F90 /* CCPlatformTextFieldMac.h in Headers */,
Expand Down
71 changes: 71 additions & 0 deletions cocos2d/CCDirector.h
Expand Up @@ -162,6 +162,11 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
CCActionManager *_actionManagerFixed;

NSMutableArray *_rendererPool;

@protected
GLKMatrix4 _projectionMatrix;
__weak id<CCDirectorDelegate> _delegate;
__weak NSThread *_runningThread;
}

// Undocumented members (considered private)
Expand Down Expand Up @@ -217,6 +222,12 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
/// @see projection
@property(nonatomic, readonly) GLKMatrix4 projectionMatrix;

/// Rect of the visible screen area in GL coordinates.
@property(nonatomic, readonly) CGRect viewportRect;

/* Sets the glViewport*/
-(void) setViewport;

/// The current global shader values values.
@property(nonatomic, readonly) NSMutableDictionary *globalShaderUniforms;
/** Whether or not to display statistics in the view's lower left corner. From top to bottom the numbers are:
Expand Down Expand Up @@ -343,6 +354,13 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
*/
-(void) popToRootSceneWithTransition:(CCTransition *)transition;

/* Pops out all scenes from the queue until it reaches `level`.
If level is 0, it will end the director.
If level is 1, it will pop all scenes until it reaches to root scene.
If level is <= than the current stack level, it won't do anything.
*/
-(void) popToSceneStackLevel:(NSUInteger)level;

// purposefully undocumented: is the same as calling presentScene:
-(void) replaceScene: (CCScene*) scene;

Expand All @@ -366,6 +384,13 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
*/
- (void)popSceneWithTransition:(CCTransition *)transition;

- (void)startTransition:(CCTransition *)transition;

/* Draw the scene.
This method is called every frame. Don't call it manually.
*/
-(void) drawScene;

/** @name Animating the Active Scene */

/** The animation interval is the time per frame. Typically specified as `1.0 / 60.0` where the latter number defines
Expand Down Expand Up @@ -436,7 +461,53 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
/** Removes all the cocos2d resources that have been previously loaded and automatically cached, textures for instance. */
-(void) purgeCachedData;

#pragma mark Internal stuff

/* Whether or not the replaced scene will receive the cleanup message.
If the new scene is pushed, then the old scene won't receive the "cleanup" message.
If the new scene replaces the old one, the it will receive the "cleanup" message.
*/
@property (nonatomic, readonly) BOOL sendCleanupToScene;

/* This object will be visited after the main scene is visited.
This object MUST implement the "visit" selector.
Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)
*/
@property (nonatomic, readwrite, strong) id notificationNode;

/* CCScheduler associated with this director
*/
@property (nonatomic,readwrite,strong) CCScheduler *scheduler;

/* CCActionManager associated with this director
*/
@property (nonatomic,readwrite,strong) CCActionManager *actionManager;

/* CCFixedActionManager associated with this director
*/
@property (nonatomic,readwrite,strong) CCActionManager *actionManagerFixed;

/// XXX: missing description
-(float) getZEye;

/// Get a renderer object to use for rendering.
/// This method is thread safe.
-(CCRenderer *)rendererFromPool;

/// Return a renderer to a pool after rendering.
/// This method is thread safe.
-(void)poolRenderer:(CCRenderer *)renderer;

/// Add a block to be called when the GPU finishes rendering a frame.
/// This is used to pool rendering resources (renderers, buffers, textures, etc) without stalling the GPU pipeline.
-(void)addFrameCompletionHandler:(dispatch_block_t)handler;

-(void) createStatsLabel;

@end

// optimization. Should only be used to read it. Never to write it.
extern NSUInteger __ccNumberOfDraws;

// optimization. Should only be used to read it. Never to write it.
extern CGFloat __ccContentScaleFactor;
2 changes: 0 additions & 2 deletions cocos2d/CCDirector.m
Expand Up @@ -64,8 +64,6 @@
#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink
#endif

#import "CCDirector_Private.h"

#pragma mark -
#pragma mark Director - global variables (optimization)

Expand Down
111 changes: 0 additions & 111 deletions cocos2d/CCDirector_Private.h

This file was deleted.

1 change: 0 additions & 1 deletion cocos2d/CCNode.m
Expand Up @@ -40,7 +40,6 @@
#if CC_PHYSICS
#import "CCPhysics+ObjectiveChipmunk.h"
#endif
#import "CCDirector_Private.h"
#import "CCRenderer_Private.h"

#if CC_NODE_RENDER_SUBPIXEL
Expand Down
1 change: 0 additions & 1 deletion cocos2d/CCRenderTexture.m
Expand Up @@ -33,7 +33,6 @@
#import "Support/CCFileUtils.h"
#import "Support/CGPointExtension.h"

#import "CCDirector_Private.h"
#import "CCRenderer_Private.h"
#import "CCRenderTexture_Private.h"
#import "CCRenderDispatch.h"
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/CCRenderer.m
Expand Up @@ -27,7 +27,7 @@
#import "cocos2d.h"
#import "CCRenderer_Private.h"
#import "CCCache.h"
#import "CCDirector_Private.h"
#import "CCDirector.h"
#import "CCRenderDispatch.h"

#if __CC_METAL_SUPPORTED_AND_ENABLED
Expand Down
5 changes: 0 additions & 5 deletions cocos2d/CCResponder.m
Expand Up @@ -29,17 +29,12 @@

#import "CCResponder.h"
#import "CCDirector.h"
#import "CCDirector_Private.h"

// -----------------------------------------------------------------

@implementation CCResponder
{

}

// -----------------------------------------------------------------

- (id)init
{
self = [super init];
Expand Down
1 change: 0 additions & 1 deletion cocos2d/CCScene.m
Expand Up @@ -30,7 +30,6 @@
#import "CCScene.h"
#import "Support/CGPointExtension.h"
#import "CCDirector.h"
#import "CCDirector_Private.h"
#if CC_LIGHTING
#import "CCLightCollection.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/CCTransition.m
Expand Up @@ -28,7 +28,7 @@
#import "objc/message.h"

#import "CCTransition.h"
#import "CCDirector_Private.h"
#import "CCDirector.h"

// -----------------------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions cocos2d/Platforms/Mac/CCDirectorMac.m
Expand Up @@ -41,8 +41,6 @@
#import "../../CCShader.h"
#import "../../ccFPSImages.h"


#import "CCDirector_Private.h"
#import "CCRenderer_Private.h"
#import "CCRenderDispatch.h"

Expand Down
3 changes: 0 additions & 3 deletions cocos2d/Platforms/Mac/CCGLView.m
Expand Up @@ -39,9 +39,6 @@
#import "../../ccConfig.h"
#import "../../ccMacros.h"

#import "CCDirector_Private.h"


@interface CCGLViewFence : NSObject

/// Is the fence ready to be inserted?
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/Platforms/iOS/CCAppDelegate.m
Expand Up @@ -29,7 +29,7 @@
#import "CCAppDelegate.h"
#import "CCTexture.h"
#import "CCFileUtils.h"
#import "CCDirector_Private.h"
#import "CCDirector.h"
#import "CCScheduler.h"
#import "CCGLView.h"

Expand Down
2 changes: 0 additions & 2 deletions cocos2d/Platforms/iOS/CCDirectorIOS.m
Expand Up @@ -53,8 +53,6 @@
#import "../../Support/CCProfiling.h"
#endif

#import "CCDirector_Private.h"

#pragma mark -
#pragma mark Director

Expand Down
1 change: 0 additions & 1 deletion cocos2d/Platforms/iOS/CCGLView.m
Expand Up @@ -78,7 +78,6 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
#import "../../CCConfiguration.h"
#import "CCScene.h"

#import "CCDirector_Private.h"
#import "CCRenderDispatch.h"


Expand Down
1 change: 0 additions & 1 deletion cocos2d/Platforms/iOS/CCMetalView.m
Expand Up @@ -11,7 +11,6 @@
#import "../../CCConfiguration.h"
#import "CCScene.h"

#import "CCDirector_Private.h"
#import "CCMetalSupport_Private.h"


Expand Down

0 comments on commit 5dca56f

Please sign in to comment.