mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1751 from jareguo/master
should not include zip utils and tiled map in core module
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
*/
|
||||
cc.Codec = {name:'Jacob__Codec'};
|
||||
|
||||
cc.Codec.Base64 = require('./base64');
|
||||
cc.Codec.GZip = require('./gzip');
|
||||
|
||||
/**
|
||||
* Unpack a gzipped byte array
|
||||
* @param {Array} input Byte array
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
/**
|
||||
* mixin cc.Codec.Base64
|
||||
*/
|
||||
cc.Codec.Base64 = {name:'Jacob__Codec__Base64'};
|
||||
var Base64 = {name:'Jacob__Codec__Base64'};
|
||||
|
||||
cc.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -22,7 +22,7 @@ cc.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0
|
||||
* //decode string
|
||||
* cc.Codec.Base64.decode("U29tZSBTdHJpbmc="); // => "Some String"
|
||||
*/
|
||||
cc.Codec.Base64.decode = function Jacob__Codec__Base64__decode(input) {
|
||||
Base64.decode = function Jacob__Codec__Base64__decode(input) {
|
||||
var output = [],
|
||||
chr1, chr2, chr3,
|
||||
enc1, enc2, enc3, enc4,
|
||||
@@ -68,7 +68,7 @@ cc.Codec.Base64.decode = function Jacob__Codec__Base64__decode(input) {
|
||||
* //decode string to array
|
||||
* var decodeArr = cc.Codec.Base64.decodeAsArray("U29tZSBTdHJpbmc=");
|
||||
*/
|
||||
cc.Codec.Base64.decodeAsArray = function Jacob__Codec__Base64___decodeAsArray(input, bytes) {
|
||||
Base64.decodeAsArray = function Jacob__Codec__Base64___decodeAsArray(input, bytes) {
|
||||
var dec = this.decode(input),
|
||||
ar = [], i, j, len;
|
||||
for (i = 0, len = dec.length / bytes; i < len; i++) {
|
||||
@@ -80,3 +80,5 @@ cc.Codec.Base64.decodeAsArray = function Jacob__Codec__Base64___decodeAsArray(in
|
||||
|
||||
return ar;
|
||||
};
|
||||
|
||||
module.exports = Base64;
|
||||
|
||||
+49
-47
@@ -9,7 +9,7 @@
|
||||
* @param {Array | String} data The bytestream to decompress
|
||||
* Constructor
|
||||
*/
|
||||
cc.Codec.GZip = function Jacob__GZip(data) {
|
||||
var GZip = function Jacob__GZip(data) {
|
||||
this.data = data;
|
||||
|
||||
this.debug = false;
|
||||
@@ -24,7 +24,7 @@ cc.Codec.GZip = function Jacob__GZip(data) {
|
||||
this.bits = 0;
|
||||
this.nameBuf = [];
|
||||
this.fileout = undefined;
|
||||
this.literalTree = new Array(cc.Codec.GZip.LITERALS);
|
||||
this.literalTree = new Array(GZip.LITERALS);
|
||||
this.distanceTree = new Array(32);
|
||||
this.treepos = 0;
|
||||
this.Places = null;
|
||||
@@ -40,15 +40,15 @@ cc.Codec.GZip = function Jacob__GZip(data) {
|
||||
* @param string The bytestream to decompress. Either an array of Integers between 0 and 255, or a String.
|
||||
* @return {String}
|
||||
*/
|
||||
cc.Codec.GZip.gunzip = function (string) {
|
||||
GZip.gunzip = function (string) {
|
||||
if (string.constructor === Array) {
|
||||
} else if (string.constructor === String) {
|
||||
}
|
||||
var gzip = new cc.Codec.GZip(string);
|
||||
var gzip = new GZip(string);
|
||||
return gzip.gunzip()[0][0];
|
||||
};
|
||||
|
||||
cc.Codec.GZip.HufNode = function () {
|
||||
GZip.HufNode = function () {
|
||||
this.b0 = 0;
|
||||
this.b1 = 0;
|
||||
this.jump = null;
|
||||
@@ -59,14 +59,14 @@ cc.Codec.GZip.HufNode = function () {
|
||||
* @constant
|
||||
* @type Number
|
||||
*/
|
||||
cc.Codec.GZip.LITERALS = 288;
|
||||
GZip.LITERALS = 288;
|
||||
/**
|
||||
* @constant
|
||||
* @type Number
|
||||
*/
|
||||
cc.Codec.GZip.NAMEMAX = 256;
|
||||
GZip.NAMEMAX = 256;
|
||||
|
||||
cc.Codec.GZip.bitReverse = [
|
||||
GZip.bitReverse = [
|
||||
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
|
||||
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
|
||||
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
|
||||
@@ -100,35 +100,35 @@ cc.Codec.GZip.bitReverse = [
|
||||
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
|
||||
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
|
||||
];
|
||||
cc.Codec.GZip.cplens = [
|
||||
GZip.cplens = [
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
|
||||
];
|
||||
cc.Codec.GZip.cplext = [
|
||||
GZip.cplext = [
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99
|
||||
];
|
||||
/* 99==invalid */
|
||||
cc.Codec.GZip.cpdist = [
|
||||
GZip.cpdist = [
|
||||
0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0007, 0x0009, 0x000d,
|
||||
0x0011, 0x0019, 0x0021, 0x0031, 0x0041, 0x0061, 0x0081, 0x00c1,
|
||||
0x0101, 0x0181, 0x0201, 0x0301, 0x0401, 0x0601, 0x0801, 0x0c01,
|
||||
0x1001, 0x1801, 0x2001, 0x3001, 0x4001, 0x6001
|
||||
];
|
||||
cc.Codec.GZip.cpdext = [
|
||||
GZip.cpdext = [
|
||||
0, 0, 0, 0, 1, 1, 2, 2,
|
||||
3, 3, 4, 4, 5, 5, 6, 6,
|
||||
7, 7, 8, 8, 9, 9, 10, 10,
|
||||
11, 11, 12, 12, 13, 13
|
||||
];
|
||||
cc.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
||||
GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
||||
|
||||
|
||||
/**
|
||||
* gunzip
|
||||
* @return {Array}
|
||||
*/
|
||||
cc.Codec.GZip.prototype.gunzip = function () {
|
||||
GZip.prototype.gunzip = function () {
|
||||
this.outputArr = [];
|
||||
|
||||
//convertToByteArray(input);
|
||||
@@ -138,7 +138,7 @@ cc.Codec.GZip.prototype.gunzip = function () {
|
||||
return this.unzipped;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.readByte = function () {
|
||||
GZip.prototype.readByte = function () {
|
||||
this.bits += 8;
|
||||
if (this.bytepos < this.data.length) {
|
||||
//return this.data[this.bytepos++]; // Array
|
||||
@@ -148,11 +148,11 @@ cc.Codec.GZip.prototype.readByte = function () {
|
||||
}
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.byteAlign = function () {
|
||||
GZip.prototype.byteAlign = function () {
|
||||
this.bb = 1;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.readBit = function () {
|
||||
GZip.prototype.readBit = function () {
|
||||
var carry;
|
||||
this.bits++;
|
||||
carry = (this.bb & 1);
|
||||
@@ -165,27 +165,27 @@ cc.Codec.GZip.prototype.readBit = function () {
|
||||
return carry;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.readBits = function (a) {
|
||||
GZip.prototype.readBits = function (a) {
|
||||
var res = 0,
|
||||
i = a;
|
||||
|
||||
while (i--) res = (res << 1) | this.readBit();
|
||||
if (a) res = cc.Codec.GZip.bitReverse[res] >> (8 - a);
|
||||
if (a) res = GZip.bitReverse[res] >> (8 - a);
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.flushBuffer = function () {
|
||||
GZip.prototype.flushBuffer = function () {
|
||||
this.bIdx = 0;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.addBuffer = function (a) {
|
||||
GZip.prototype.addBuffer = function (a) {
|
||||
this.buf32k[this.bIdx++] = a;
|
||||
this.outputArr.push(String.fromCharCode(a));
|
||||
if (this.bIdx === 0x8000) this.bIdx = 0;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.IsPat = function () {
|
||||
GZip.prototype.IsPat = function () {
|
||||
while (1) {
|
||||
if (this.fpos[this.len] >= this.fmax) return -1;
|
||||
if (this.flens[this.fpos[this.len]] === this.len) return this.fpos[this.len]++;
|
||||
@@ -193,7 +193,7 @@ cc.Codec.GZip.prototype.IsPat = function () {
|
||||
}
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.Rec = function () {
|
||||
GZip.prototype.Rec = function () {
|
||||
var curplace = this.Places[this.treepos];
|
||||
var tmp;
|
||||
//if (this.debug) document.write("<br>len:"+this.len+" treepos:"+this.treepos);
|
||||
@@ -234,7 +234,7 @@ cc.Codec.GZip.prototype.Rec = function () {
|
||||
return 0;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.CreateTree = function (currentTree, numval, lengths, show) {
|
||||
GZip.prototype.CreateTree = function (currentTree, numval, lengths, show) {
|
||||
var i;
|
||||
/* Create the Huffman decode tree/table */
|
||||
//if (this.debug) document.write("currentTree "+currentTree+" numval "+numval+" lengths "+lengths+" show "+show);
|
||||
@@ -259,7 +259,7 @@ cc.Codec.GZip.prototype.CreateTree = function (currentTree, numval, lengths, sho
|
||||
return 0;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.DecodeValue = function (currentTree) {
|
||||
GZip.prototype.DecodeValue = function (currentTree) {
|
||||
var len, i,
|
||||
xtreepos = 0,
|
||||
X = currentTree[xtreepos],
|
||||
@@ -298,7 +298,7 @@ cc.Codec.GZip.prototype.DecodeValue = function (currentTree) {
|
||||
return -1;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
GZip.prototype.DeflateLoop = function () {
|
||||
var last, c, type, i, len;
|
||||
do {
|
||||
last = this.readBit();
|
||||
@@ -343,7 +343,7 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
|
||||
Note the bit order!
|
||||
*/
|
||||
j = (cc.Codec.GZip.bitReverse[this.readBits(7)] >> 1);
|
||||
j = (GZip.bitReverse[this.readBits(7)] >> 1);
|
||||
if (j > 23) {
|
||||
j = (j << 1) | this.readBit();
|
||||
/* 48..255 */
|
||||
@@ -376,16 +376,16 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
|
||||
j -= 256 + 1;
|
||||
/* bytes + EOF */
|
||||
len = this.readBits(cc.Codec.GZip.cplext[j]) + cc.Codec.GZip.cplens[j];
|
||||
len = this.readBits(GZip.cplext[j]) + GZip.cplens[j];
|
||||
|
||||
j = cc.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
|
||||
if (cc.Codec.GZip.cpdext[j] > 8) {
|
||||
j = GZip.bitReverse[this.readBits(5)] >> 3;
|
||||
if (GZip.cpdext[j] > 8) {
|
||||
dist = this.readBits(8);
|
||||
dist |= (this.readBits(cc.Codec.GZip.cpdext[j] - 8) << 8);
|
||||
dist |= (this.readBits(GZip.cpdext[j] - 8) << 8);
|
||||
} else {
|
||||
dist = this.readBits(cc.Codec.GZip.cpdext[j]);
|
||||
dist = this.readBits(GZip.cpdext[j]);
|
||||
}
|
||||
dist += cc.Codec.GZip.cpdist[j];
|
||||
dist += GZip.cpdist[j];
|
||||
|
||||
for (j = 0; j < len; j++) {
|
||||
var c = this.buf32k[(this.bIdx - dist) & 0x7fff];
|
||||
@@ -410,10 +410,10 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
// Get the decode tree code lengths
|
||||
|
||||
for (j = 0; j < lenCodes; j++) {
|
||||
ll[cc.Codec.GZip.border[j]] = this.readBits(3);
|
||||
ll[GZip.border[j]] = this.readBits(3);
|
||||
}
|
||||
len = this.distanceTree.length;
|
||||
for (i = 0; i < len; i++) this.distanceTree[i] = new cc.Codec.GZip.HufNode();
|
||||
for (i = 0; i < len; i++) this.distanceTree[i] = new GZip.HufNode();
|
||||
if (this.CreateTree(this.distanceTree, 19, ll, 0)) {
|
||||
this.flushBuffer();
|
||||
return 1;
|
||||
@@ -466,13 +466,13 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
// Can overwrite tree decode tree as it is not used anymore
|
||||
len = this.literalTree.length;
|
||||
for (i = 0; i < len; i++)
|
||||
this.literalTree[i] = new cc.Codec.GZip.HufNode();
|
||||
this.literalTree[i] = new GZip.HufNode();
|
||||
if (this.CreateTree(this.literalTree, literalCodes, ll, 0)) {
|
||||
this.flushBuffer();
|
||||
return 1;
|
||||
}
|
||||
len = this.literalTree.length;
|
||||
for (i = 0; i < len; i++) this.distanceTree[i] = new cc.Codec.GZip.HufNode();
|
||||
for (i = 0; i < len; i++) this.distanceTree[i] = new GZip.HufNode();
|
||||
var ll2 = new Array();
|
||||
for (i = literalCodes; i < ll.length; i++) ll2[i - literalCodes] = ll[i];
|
||||
if (this.CreateTree(this.distanceTree, distCodes, ll2, 0)) {
|
||||
@@ -490,16 +490,16 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
break;
|
||||
}
|
||||
j--;
|
||||
len = this.readBits(cc.Codec.GZip.cplext[j]) + cc.Codec.GZip.cplens[j];
|
||||
len = this.readBits(GZip.cplext[j]) + GZip.cplens[j];
|
||||
|
||||
j = this.DecodeValue(this.distanceTree);
|
||||
if (cc.Codec.GZip.cpdext[j] > 8) {
|
||||
if (GZip.cpdext[j] > 8) {
|
||||
dist = this.readBits(8);
|
||||
dist |= (this.readBits(cc.Codec.GZip.cpdext[j] - 8) << 8);
|
||||
dist |= (this.readBits(GZip.cpdext[j] - 8) << 8);
|
||||
} else {
|
||||
dist = this.readBits(cc.Codec.GZip.cpdext[j]);
|
||||
dist = this.readBits(GZip.cpdext[j]);
|
||||
}
|
||||
dist += cc.Codec.GZip.cpdist[j];
|
||||
dist += GZip.cpdist[j];
|
||||
while (len--) {
|
||||
var c = this.buf32k[(this.bIdx - dist) & 0x7fff];
|
||||
this.addBuffer(c);
|
||||
@@ -516,7 +516,7 @@ cc.Codec.GZip.prototype.DeflateLoop = function () {
|
||||
return 0;
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.unzipFile = function (name) {
|
||||
GZip.prototype.unzipFile = function (name) {
|
||||
var i;
|
||||
this.gunzip();
|
||||
for (i = 0; i < this.unzipped.length; i++) {
|
||||
@@ -526,7 +526,7 @@ cc.Codec.GZip.prototype.unzipFile = function (name) {
|
||||
}
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.nextFile = function () {
|
||||
GZip.prototype.nextFile = function () {
|
||||
// if (this.debug) alert("NEXTFILE");
|
||||
|
||||
this.outputArr = [];
|
||||
@@ -604,7 +604,7 @@ cc.Codec.GZip.prototype.nextFile = function () {
|
||||
var c = this.readByte();
|
||||
if (c === "/" | c === ":") {
|
||||
i = 0;
|
||||
} else if (i < cc.Codec.GZip.NAMEMAX - 1) {
|
||||
} else if (i < GZip.NAMEMAX - 1) {
|
||||
this.nameBuf[i++] = String.fromCharCode(c);
|
||||
}
|
||||
}
|
||||
@@ -633,7 +633,7 @@ cc.Codec.GZip.prototype.nextFile = function () {
|
||||
}
|
||||
};
|
||||
|
||||
cc.Codec.GZip.prototype.skipdir = function () {
|
||||
GZip.prototype.skipdir = function () {
|
||||
var tmp = [];
|
||||
var compSize, size, os, i, c;
|
||||
|
||||
@@ -697,7 +697,7 @@ cc.Codec.GZip.prototype.skipdir = function () {
|
||||
while (c = this.readByte()) {
|
||||
if (c === "7" || c === ":")
|
||||
i = 0;
|
||||
if (i < cc.Codec.GZip.NAMEMAX - 1)
|
||||
if (i < GZip.NAMEMAX - 1)
|
||||
this.nameBuf[i++] = c;
|
||||
}
|
||||
//this.nameBuf[i] = "\0";
|
||||
@@ -729,3 +729,5 @@ cc.Codec.GZip.prototype.skipdir = function () {
|
||||
|
||||
if (this.modeZIP) this.nextFile();
|
||||
};
|
||||
|
||||
module.exports = GZip;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated engine source code (the "Software"), a limited,
|
||||
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
|
||||
to use Cocos Creator solely to develop games on your target platforms. You shall
|
||||
not use Cocos Creator software for developing other software or tools that's
|
||||
used for developing games. You are not granted to publish, distribute,
|
||||
sublicense, and/or sell copies of Cocos Creator.
|
||||
|
||||
The software or tools in this License Agreement are licensed, not sold.
|
||||
Chukong Aipu reserves all rights not expressly granted to you.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
require('./ZipUtils');
|
||||
require('./base64');
|
||||
require('./gzip');
|
||||
require('./zlib.min');
|
||||
Vendored
+2
-2
@@ -46,10 +46,10 @@ nb.prototype.p=function(){var a=this.input,c,b;c=this.A.p();this.c=this.A.c;this
|
||||
var sb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];H&&new Uint8Array(sb);var tb=new (H?Uint8Array:Array)(288),Z,ub;Z=0;for(ub=tb.length;Z<ub;++Z)tb[Z]=143>=Z?8:255>=Z?9:279>=Z?7:8;S(tb);var vb=new (H?Uint8Array:Array)(30),wb,xb;wb=0;for(xb=vb.length;wb<xb;++wb)vb[wb]=5;S(vb);var Ea=8;}).call(window);
|
||||
|
||||
//add for cocos2d-html5
|
||||
var _p = window;
|
||||
_p = window.Zlib = _p["Zlib"];
|
||||
var _p = window.Zlib;
|
||||
_p.Deflate = _p["Deflate"];
|
||||
_p.Deflate.compress = _p.Deflate["compress"];
|
||||
_p.Inflate = _p["Inflate"];
|
||||
_p.Inflate.BufferType = _p.Inflate["BufferType"];
|
||||
_p.Inflate.prototype.decompress = _p.Inflate.prototype["decompress"];
|
||||
module.exports = _p;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
var JS = require('../platform/js');
|
||||
|
||||
var misc = {};
|
||||
var misc = exports;
|
||||
|
||||
misc.propertyDefine = function (ctor, sameNameGetSets, diffNameGetSets) {
|
||||
function define (np, propName, getter, setter) {
|
||||
@@ -128,4 +128,3 @@ misc.isBuiltinClassId = function (id) {
|
||||
return id.startsWith('cc.') || id.startsWith('dragonBones.') || id.startsWith('sp.') || id.startsWith('ccsg.');
|
||||
};
|
||||
|
||||
module.exports = misc;
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
var Zlib = require('../compression/zlib.min');
|
||||
|
||||
/**
|
||||
* A png file reader
|
||||
* @name PNGReader
|
||||
|
||||
@@ -22,12 +22,15 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
require('./CCParticleAsset');
|
||||
require('./CCSGParticleSystem.js');
|
||||
require('./CCSGParticleSystemCanvasRenderCmd.js');
|
||||
require('./CCSGParticleSystemWebGLRenderCmd.js');
|
||||
require('./CCParticleBatchNode.js');
|
||||
require('./CCParticleBatchNodeCanvasRenderCmd.js');
|
||||
require('./CCParticleBatchNodeWebGLRenderCmd.js');
|
||||
|
||||
var BlendFactor = cc.BlendFunc.BlendFactor;
|
||||
/**
|
||||
* !#en Enum for emitter modes
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
var PNGReader = require('./CCPNGReader');
|
||||
var tiffReader = require('./CCTIFFReader');
|
||||
require('../compression/ZipUtils');
|
||||
|
||||
// ideas taken from:
|
||||
// . The ocean spray in your face [Jeff Lander]
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
require('../compression/ZipUtils');
|
||||
var Zlib = require('../compression/zlib.min');
|
||||
|
||||
function uint8ArrayToUint32Array (uint8Arr) {
|
||||
if(uint8Arr.length % 4 !== 0)
|
||||
return null;
|
||||
@@ -35,7 +38,7 @@ function uint8ArrayToUint32Array (uint8Arr) {
|
||||
retArr[i] = uint8Arr[offset] + uint8Arr[offset + 1] * (1 << 8) + uint8Arr[offset + 2] * (1 << 16) + uint8Arr[offset + 3] * (1<<24);
|
||||
}
|
||||
return retArr;
|
||||
};
|
||||
}
|
||||
|
||||
// Bits on the far end of the 32-bit global tile ID (GID's) are used for tile flags
|
||||
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
require('./CCTiledMapAsset');
|
||||
require('./CCTiledLayer');
|
||||
require('./CCTiledObjectGroup');
|
||||
require('./CCSGTMXTiledMap.js');
|
||||
|
||||
/**
|
||||
* !#en The orientation of tiled map.
|
||||
* !#zh Tiled Map 地图方向。
|
||||
|
||||
+9
-25
@@ -26,42 +26,26 @@
|
||||
require('./cocos2d/core');
|
||||
require('./cocos2d/animation');
|
||||
|
||||
require('./cocos2d/particle/CCParticleAsset');
|
||||
if (!(CC_EDITOR && Editor.isMainProcess)) {
|
||||
if (CC_EDITOR && Editor.isMainProcess) {
|
||||
require('./cocos2d/particle/CCParticleAsset');
|
||||
require('./cocos2d/tilemap/CCTiledMapAsset');
|
||||
}
|
||||
else {
|
||||
require('./cocos2d/particle/CCParticleSystem');
|
||||
}
|
||||
|
||||
if (!(CC_EDITOR && Editor.isMainProcess)) {
|
||||
require('./cocos2d/motion-streak/CCMotionStreak');
|
||||
}
|
||||
|
||||
require('./cocos2d/tilemap/CCTiledMapAsset');
|
||||
if (!(CC_EDITOR && Editor.isMainProcess) && !cc.runtime) {
|
||||
require('./cocos2d/tilemap/CCTiledMap');
|
||||
require('./cocos2d/tilemap/CCTiledLayer');
|
||||
require('./cocos2d/tilemap/CCTiledObjectGroup');
|
||||
}
|
||||
|
||||
if (!(CC_EDITOR && Editor.isMainProcess)) {
|
||||
require('./cocos2d/motion-streak/CCMotionStreak');
|
||||
require('./cocos2d/core/components/CCStudioComponent');
|
||||
}
|
||||
|
||||
require('./extensions/spine');
|
||||
|
||||
if (!cc.runtime) {
|
||||
require('./extensions/dragonbones');
|
||||
}
|
||||
|
||||
if (!(CC_EDITOR && Editor.isMainProcess)) {
|
||||
require('./extensions/ccpool/CCNodePool');
|
||||
require('./extensions/ccpool/CCPool');
|
||||
|
||||
if (!CC_JSB) {
|
||||
require('./cocos2d/actions');
|
||||
require('./external/chipmunk/chipmunk');
|
||||
}
|
||||
}
|
||||
|
||||
require('./extensions/spine');
|
||||
require('./extensions/dragonbones');
|
||||
|
||||
if (!CC_EDITOR || !Editor.isMainProcess) {
|
||||
require('./cocos2d/deprecated');
|
||||
}
|
||||
|
||||
@@ -108,21 +108,18 @@ var jsbSkipModules = [
|
||||
gulp.task('build-jsb-dev', function (done) {
|
||||
Engine.buildJsb([
|
||||
'./jsb/index.js',
|
||||
'./extends.js'
|
||||
], './bin/jsb_polyfill.dev.js', jsbSkipModules, done);
|
||||
});
|
||||
|
||||
gulp.task('build-jsb-min', function (done) {
|
||||
Engine.buildJsbMin([
|
||||
'./jsb/index.js',
|
||||
'./extends.js'
|
||||
], './bin/jsb_polyfill.js', jsbSkipModules, done);
|
||||
});
|
||||
|
||||
gulp.task('build-jsb-preview', function (done) {
|
||||
Engine.buildJsbPreview([
|
||||
'./jsb/index.js',
|
||||
'./extends.js'
|
||||
], './bin/jsb_polyfill-for-preview.js', jsbSkipModules, done);
|
||||
});
|
||||
|
||||
@@ -204,7 +201,6 @@ gulp.task('watch-preview', function () {
|
||||
gulp.task('watch-jsb-polyfill', function () {
|
||||
Watch.jsbPolyfill([
|
||||
'./jsb/index.js',
|
||||
'./extends.js'
|
||||
], './bin/jsb_polyfill.dev.js', jsbSkipModules);
|
||||
});
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ if (CC_EDITOR && Editor.isMainProcess) {
|
||||
}
|
||||
else {
|
||||
require('./cocos2d/shaders');
|
||||
require('./cocos2d/compression');
|
||||
require('./CCBoot');
|
||||
require('./cocos2d');
|
||||
}
|
||||
|
||||
@@ -131,3 +131,5 @@ require('./jsb-dragonbones');
|
||||
if (cc.runtime) {
|
||||
require('./versions/jsb-polyfill-runtime');
|
||||
}
|
||||
|
||||
require('../extends');
|
||||
|
||||
+4
-2
@@ -45,13 +45,15 @@
|
||||
{
|
||||
"name": "ParticleSystem",
|
||||
"entries": [
|
||||
"./cocos2d/particle/CCParticleSystem.js"
|
||||
"./cocos2d/particle/CCParticleSystem.js",
|
||||
"./cocos2d/particle/CCParticleAsset.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TiledMap",
|
||||
"entries": [
|
||||
"./cocos2d/tilemap/CCTiledMap.js"
|
||||
"./cocos2d/tilemap/CCTiledMap.js",
|
||||
"./cocos2d/tilemap/CCTiledMapAsset.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user