Skip to content

Commit e85e0e2

Browse files
authored
Merge pull request #3300 from pandamicro/develop
Draft implementation of v3.12 renderer
2 parents 4f4667e + 00d7ea6 commit e85e0e2

File tree

72 files changed

+1671
-4169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1671
-4169
lines changed

CCBoot.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -1857,19 +1857,27 @@ var _initSys = function () {
18571857
}
18581858

18591859
if (_supportWebGL && sys.os === sys.OS_ANDROID) {
1860+
var browserVer = parseFloat(sys.browserVersion);
18601861
switch (sys.browserType) {
18611862
case sys.BROWSER_TYPE_MOBILE_QQ:
18621863
case sys.BROWSER_TYPE_BAIDU:
18631864
case sys.BROWSER_TYPE_BAIDU_APP:
18641865
// QQ & Baidu Brwoser 6.2+ (using blink kernel)
1865-
var browserVer = parseFloat(sys.browserVersion);
18661866
if (browserVer >= 6.2) {
18671867
_supportWebGL = true;
18681868
}
18691869
else {
18701870
_supportWebGL = false;
18711871
}
18721872
break;
1873+
case sys.BROWSER_TYPE_CHROME:
1874+
// Chrome on android supports WebGL from v.30
1875+
if(browserVer >= 30.0) {
1876+
_supportWebGL = true;
1877+
} else {
1878+
_supportWebGL = false;
1879+
}
1880+
break;
18731881
case sys.BROWSER_TYPE_ANDROID:
18741882
// Android 5+ default browser
18751883
if (sys.osMainVersion && sys.osMainVersion >= 5) {
@@ -2323,7 +2331,10 @@ cc.game = /** @lends cc.game# */{
23232331
if (this._paused) return;
23242332
this._paused = true;
23252333
// Pause audio engine
2326-
cc.audioEngine && cc.audioEngine._pausePlaying();
2334+
if (cc.audioEngine) {
2335+
cc.audioEngine.stopAllEffects();
2336+
cc.audioEngine.pauseMusic();
2337+
}
23272338
// Pause main loop
23282339
if (this._intervalId)
23292340
window.cancelAnimationFrame(this._intervalId);
@@ -2337,7 +2348,9 @@ cc.game = /** @lends cc.game# */{
23372348
if (!this._paused) return;
23382349
this._paused = false;
23392350
// Resume audio engine
2340-
cc.audioEngine && cc.audioEngine._resumePlaying();
2351+
if (cc.audioEngine) {
2352+
cc.audioEngine.resumeMusic();
2353+
}
23412354
// Resume main loop
23422355
this._runMainLoop();
23432356
},

cocos2d/actions/CCActionCamera.js

-293
This file was deleted.

cocos2d/audio/CCAudio.js

+1
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ cc.Audio.WebAudio.prototype = {
810810
for(var i=0; i<ap[p].length; i++){
811811
list[i].stop();
812812
}
813+
list.length = 0;
813814
}
814815
},
815816

cocos2d/clipping-nodes/CCClippingNodeCanvasRenderCmd.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@
174174
this._clipElemType = !(!this._cangodhelpme() && node._stencil instanceof cc.DrawNode);
175175
if (!node._stencil || !node._stencil.visible) {
176176
if (this.inverted)
177-
cc.Node.CanvasRenderCmd.prototype.visit.call(this, parentCmd); // draw everything
177+
this.originVisit(parentCmd); // draw everything
178178
return;
179179
}
180180

181181
this._syncStatus(parentCmd);
182182
cc.renderer.pushRenderCommand(this._rendererSaveCmd);
183183
if(this._clipElemType){
184184
// Draw everything first using node visit function
185-
cc.Node.CanvasRenderCmd.prototype.visit.call(this, parentCmd);
185+
this.originVisit(parentCmd);
186186
}else{
187187
node._stencil.visit(this);
188188
}

0 commit comments

Comments
 (0)