Skip to content

Commit 9ca335e

Browse files
s1ddoks1ddok
authored andcommitted
Merged CCDirector headers
1 parent c46b3ca commit 9ca335e

19 files changed

+75
-140
lines changed

UnitTests/CCNodeTests.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#import <XCTest/XCTest.h>
99
#import "cocos2d.h"
10-
#import "CCDirector_Private.h"
1110

1211
@interface CCNodeTests : XCTestCase
1312

UnitTests/CCPhysicsTests.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#import "cocos2d.h"
1111

1212
#import "CCPhysics+ObjectiveChipmunk.h"
13-
#import "CCDirector_Private.h"
1413
#import "AppDelegate.h"
1514

1615
@interface CCScheduler(Test)

cocos2d-ui/CCTextField.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#import "CCTextField.h"
2626
#import "CCControlSubclass.h"
27-
#import "CCDirector_Private.h"
27+
#import "CCDirector.h"
2828
#import "CCPlatformTextField.h"
2929
#if __CC_PLATFORM_IOS
3030
#import "CCPlatformTextFieldIOS.h"

cocos2d.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@
343343
7A59475419E3731000F65F90 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E0EAD1F0121F522A00B0C81C /* CCConfiguration.h */; };
344344
7A59475619E3731100F65F90 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E2A25110A46CC600D894CE /* CCProtocols.h */; };
345345
7A59475719E3731100F65F90 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5066020F0E38A70D000B500E /* CCScheduler.h */; };
346-
7A59475919E3731100F65F90 /* CCDirector_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = B706B19918209FA000B27A2C /* CCDirector_Private.h */; };
347346
7A59476019E3731400F65F90 /* CCPlatformTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD01E19649E03003D460C /* CCPlatformTextField.h */; };
348347
7A59476219E3731400F65F90 /* CCPlatformTextFieldIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD02119649E03003D460C /* CCPlatformTextFieldIOS.h */; };
349348
7A59476419E3731500F65F90 /* CCPlatformTextFieldMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 571CD02419649E03003D460C /* CCPlatformTextFieldMac.h */; };
@@ -657,7 +656,6 @@
657656
A6A0734917C78EF3004343C8 /* CCResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponder.m; sourceTree = "<group>"; };
658657
A6DC4E0718055DCC00C280A6 /* CCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransition.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
659658
A6DC4E0818055DCC00C280A6 /* CCTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransition.m; sourceTree = "<group>"; };
660-
B706B19918209FA000B27A2C /* CCDirector_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDirector_Private.h; sourceTree = "<group>"; };
661659
B74C2B9917BDA63A00A829C0 /* CCSprite9Slice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite9Slice.h; sourceTree = "<group>"; };
662660
B74C2B9A17BDA63A00A829C0 /* CCSprite9Slice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSprite9Slice.m; sourceTree = "<group>"; };
663661
B750162218124B6000708A2F /* CCControlSubclass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CCControlSubclass.h; path = "cocos2d-ui/CCControlSubclass.h"; sourceTree = "<group>"; };
@@ -923,7 +921,6 @@
923921
50E2A25110A46CC600D894CE /* CCProtocols.h */,
924922
5066020F0E38A70D000B500E /* CCScheduler.h */,
925923
506602100E38A70D000B500E /* CCScheduler.m */,
926-
B706B19918209FA000B27A2C /* CCDirector_Private.h */,
927924
D3903B0C1995288D003AA81A /* CCNoARC.m */,
928925
);
929926
path = cocos2d;
@@ -1554,7 +1551,6 @@
15541551
7A59475419E3731000F65F90 /* CCConfiguration.h in Headers */,
15551552
7A59475619E3731100F65F90 /* CCProtocols.h in Headers */,
15561553
7A59475719E3731100F65F90 /* CCScheduler.h in Headers */,
1557-
7A59475919E3731100F65F90 /* CCDirector_Private.h in Headers */,
15581554
7A59476019E3731400F65F90 /* CCPlatformTextField.h in Headers */,
15591555
7A59476219E3731400F65F90 /* CCPlatformTextFieldIOS.h in Headers */,
15601556
7A59476419E3731500F65F90 /* CCPlatformTextFieldMac.h in Headers */,

cocos2d/CCDirector.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
162162
CCActionManager *_actionManagerFixed;
163163

164164
NSMutableArray *_rendererPool;
165+
166+
@protected
167+
GLKMatrix4 _projectionMatrix;
168+
__weak id<CCDirectorDelegate> _delegate;
169+
__weak NSThread *_runningThread;
165170
}
166171

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

225+
/// Rect of the visible screen area in GL coordinates.
226+
@property(nonatomic, readonly) CGRect viewportRect;
227+
228+
/* Sets the glViewport*/
229+
-(void) setViewport;
230+
220231
/// The current global shader values values.
221232
@property(nonatomic, readonly) NSMutableDictionary *globalShaderUniforms;
222233
/** Whether or not to display statistics in the view's lower left corner. From top to bottom the numbers are:
@@ -343,6 +354,13 @@ typedef NS_ENUM(NSUInteger, CCDirectorProjection) {
343354
*/
344355
-(void) popToRootSceneWithTransition:(CCTransition *)transition;
345356

357+
/* Pops out all scenes from the queue until it reaches `level`.
358+
If level is 0, it will end the director.
359+
If level is 1, it will pop all scenes until it reaches to root scene.
360+
If level is <= than the current stack level, it won't do anything.
361+
*/
362+
-(void) popToSceneStackLevel:(NSUInteger)level;
363+
346364
// purposefully undocumented: is the same as calling presentScene:
347365
-(void) replaceScene: (CCScene*) scene;
348366

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

387+
- (void)startTransition:(CCTransition *)transition;
388+
389+
/* Draw the scene.
390+
This method is called every frame. Don't call it manually.
391+
*/
392+
-(void) drawScene;
393+
369394
/** @name Animating the Active Scene */
370395

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

464+
#pragma mark Internal stuff
465+
466+
/* Whether or not the replaced scene will receive the cleanup message.
467+
If the new scene is pushed, then the old scene won't receive the "cleanup" message.
468+
If the new scene replaces the old one, the it will receive the "cleanup" message.
469+
*/
470+
@property (nonatomic, readonly) BOOL sendCleanupToScene;
471+
472+
/* This object will be visited after the main scene is visited.
473+
This object MUST implement the "visit" selector.
474+
Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)
475+
*/
476+
@property (nonatomic, readwrite, strong) id notificationNode;
477+
478+
/* CCScheduler associated with this director
479+
*/
480+
@property (nonatomic,readwrite,strong) CCScheduler *scheduler;
481+
482+
/* CCActionManager associated with this director
483+
*/
484+
@property (nonatomic,readwrite,strong) CCActionManager *actionManager;
485+
486+
/* CCFixedActionManager associated with this director
487+
*/
488+
@property (nonatomic,readwrite,strong) CCActionManager *actionManagerFixed;
489+
490+
/// XXX: missing description
491+
-(float) getZEye;
492+
493+
/// Get a renderer object to use for rendering.
494+
/// This method is thread safe.
495+
-(CCRenderer *)rendererFromPool;
496+
497+
/// Return a renderer to a pool after rendering.
498+
/// This method is thread safe.
499+
-(void)poolRenderer:(CCRenderer *)renderer;
500+
501+
/// Add a block to be called when the GPU finishes rendering a frame.
502+
/// This is used to pool rendering resources (renderers, buffers, textures, etc) without stalling the GPU pipeline.
503+
-(void)addFrameCompletionHandler:(dispatch_block_t)handler;
504+
505+
-(void) createStatsLabel;
506+
439507
@end
440508

509+
// optimization. Should only be used to read it. Never to write it.
510+
extern NSUInteger __ccNumberOfDraws;
511+
441512
// optimization. Should only be used to read it. Never to write it.
442513
extern CGFloat __ccContentScaleFactor;

cocos2d/CCDirector.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink
6565
#endif
6666

67-
#import "CCDirector_Private.h"
68-
6967
#pragma mark -
7068
#pragma mark Director - global variables (optimization)
7169

cocos2d/CCDirector_Private.h

Lines changed: 0 additions & 111 deletions
This file was deleted.

cocos2d/CCNode.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#if CC_PHYSICS
4141
#import "CCPhysics+ObjectiveChipmunk.h"
4242
#endif
43-
#import "CCDirector_Private.h"
4443
#import "CCRenderer_Private.h"
4544

4645
#if CC_NODE_RENDER_SUBPIXEL

cocos2d/CCRenderTexture.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#import "Support/CCFileUtils.h"
3434
#import "Support/CGPointExtension.h"
3535

36-
#import "CCDirector_Private.h"
3736
#import "CCRenderer_Private.h"
3837
#import "CCRenderTexture_Private.h"
3938
#import "CCRenderDispatch.h"

cocos2d/CCRenderer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#import "cocos2d.h"
2828
#import "CCRenderer_Private.h"
2929
#import "CCCache.h"
30-
#import "CCDirector_Private.h"
30+
#import "CCDirector.h"
3131
#import "CCRenderDispatch.h"
3232

3333
#if __CC_METAL_SUPPORTED_AND_ENABLED

0 commit comments

Comments
 (0)