Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
2youyou2 committed Dec 26, 2017
1 parent a8abf93 commit 5e78d1d
Show file tree
Hide file tree
Showing 35 changed files with 96 additions and 8,943 deletions.
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files.exclude": {
".git": true,
"node_modules": true,
".github": true
},
"search.exclude": {
".git": true,
"node_modules": true,
".github": true,
"bin": true
}
}
74 changes: 36 additions & 38 deletions cocos2d/core/CCDirector.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
// They are needed in case the director is run again

if (this._runningScene) {
this._runningScene.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
this._runningScene.performRecursive(_ccsg.Node.performType.onExit);
this._runningScene.performRecursive(_ccsg.Node.performType.cleanup);
// this._runningScene.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
// this._runningScene.performRecursive(_ccsg.Node.performType.onExit);
// this._runningScene.performRecursive(_ccsg.Node.performType.cleanup);

cc.renderer.clearRenderCommands();
}
Expand Down Expand Up @@ -583,12 +583,9 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
}
this.emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH, scene);

var sgScene = scene;

// Run an Entity Scene
if (scene instanceof cc.Scene) {
this._scene = scene;
sgScene = scene._sgNode;

// Re-attach or replace persist nodes
CC_BUILD && CC_DEBUG && console.time('AttachPersist');
Expand All @@ -614,15 +611,15 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
// Run or replace rendering scene
if ( !this._runningScene ) {
//start scene
this.pushScene(sgScene);
this.pushScene(scene);
this.startAnimation();
}
else {
//replace scene
var i = this._scenesStack.length;
this._scenesStack[Math.max(i - 1, 0)] = sgScene;
this._scenesStack[Math.max(i - 1, 0)] = scene;
this._sendCleanupToScene = true;
this._nextScene = sgScene;
this._nextScene = scene;
}

if (this._nextScene) {
Expand Down Expand Up @@ -890,7 +887,8 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* @method setClearColor
* @param {Color} clearColor
*/
setClearColor: null,
setClearColor: function () {
},
/**
* Sets the default values based on the CCConfiguration info
*/
Expand All @@ -910,34 +908,34 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* Starts the registered next scene
*/
setNextScene: function () {
var runningIsTransition = false, newIsTransition = false;
if (cc.TransitionScene) {
runningIsTransition = this._runningScene ? this._runningScene instanceof cc.TransitionScene : false;
newIsTransition = this._nextScene ? this._nextScene instanceof cc.TransitionScene : false;
}

// If it is not a transition, call onExit/cleanup
if (!newIsTransition) {
var locRunningScene = this._runningScene;
if (locRunningScene) {
locRunningScene.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
locRunningScene.performRecursive(_ccsg.Node.performType.onExit);
}

// issue #709. the root node (scene) should receive the cleanup message too
// otherwise it might be leaked.
if (this._sendCleanupToScene && locRunningScene)
locRunningScene.performRecursive(_ccsg.Node.performType.cleanup);
}
// var runningIsTransition = false, newIsTransition = false;
// if (cc.TransitionScene) {
// runningIsTransition = this._runningScene ? this._runningScene instanceof cc.TransitionScene : false;
// newIsTransition = this._nextScene ? this._nextScene instanceof cc.TransitionScene : false;
// }

// // If it is not a transition, call onExit/cleanup
// if (!newIsTransition) {
// var locRunningScene = this._runningScene;
// if (locRunningScene) {
// locRunningScene.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
// locRunningScene.performRecursive(_ccsg.Node.performType.onExit);
// }

// // issue #709. the root node (scene) should receive the cleanup message too
// // otherwise it might be leaked.
// if (this._sendCleanupToScene && locRunningScene)
// locRunningScene.performRecursive(_ccsg.Node.performType.cleanup);
// }

this._runningScene = this._nextScene;
cc.renderer.childrenOrderDirty = true;

this._nextScene = null;
if ((!runningIsTransition) && (this._runningScene !== null)) {
this._runningScene.performRecursive(_ccsg.Node.performType.onEnter);
this._runningScene.performRecursive(_ccsg.Node.performType.onEnterTransitionDidFinish);
}
// if ((!runningIsTransition) && (this._runningScene !== null)) {
// this._runningScene.performRecursive(_ccsg.Node.performType.onEnter);
// this._runningScene.performRecursive(_ccsg.Node.performType.onEnterTransitionDidFinish);
// }
},

/**
Expand Down Expand Up @@ -1154,11 +1152,11 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
// pop stack until reaching desired level
while (c > level) {
var current = locScenesStack.pop();
if (current.running) {
current.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
current.performRecursive(_ccsg.Node.performType.onExit);
}
current.performRecursive(_ccsg.Node.performType.cleanup);
// if (current.running) {
// current.performRecursive(_ccsg.Node.performType.onExitTransitionDidStart);
// current.performRecursive(_ccsg.Node.performType.onExit);
// }
// current.performRecursive(_ccsg.Node.performType.cleanup);
c--;
}
this._nextScene = locScenesStack[locScenesStack.length - 1];
Expand Down
77 changes: 0 additions & 77 deletions cocos2d/core/CCDirectorCanvas.js

This file was deleted.

Loading

0 comments on commit 5e78d1d

Please sign in to comment.