Content-Length: 695628 | pFad | http://github.com/sendilkumarj/cocos2d-html5/commit/0e13960f12b8c8ab2e3bc69ee451ee34a0a22270

96 Refactor #3585: Move ParticleNode’s dependency in CCImage into partic… · sendilkumarj/cocos2d-html5@0e13960 · GitHub
Skip to content

Commit 0e13960

Browse files
committed
Refactor cocos2d#3585: Move ParticleNode’s dependency in CCImage into particle_nodes folder
1 parent bed5caf commit 0e13960

File tree

8 files changed

+78
-70
lines changed

8 files changed

+78
-70
lines changed

HelloHTML5World/build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<file name="compress/base64.js"/>
9898
<file name="compress/gzip.js"/>
9999
<file name="compress/zlib.min.js"/>
100+
<file name="particle_nodes/CCFormatHelper.js"/>
100101
<file name="particle_nodes/CCPNGReader.js"/>
101102
<file name="particle_nodes/CCTIFFReader.js"/>
102103
<file name="particle_nodes/CCParticleSystem.js"/>

cocos2d/CCImage.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,6 @@
2424
THE SOFTWARE.
2525
****************************************************************************/
2626

27-
/**
28-
* Image Format:JPG
29-
* @constant
30-
* @type Number
31-
*/
32-
cc.FMT_JPG = 0;
33-
34-
/**
35-
* Image Format:PNG
36-
* @constant
37-
* @type Number
38-
*/
39-
cc.FMT_PNG = 1;
40-
41-
/**
42-
* Image Format:TIFF
43-
* @constant
44-
* @type Number
45-
*/
46-
cc.FMT_TIFF = 2;
47-
48-
/**
49-
* Image Format:RAWDATA
50-
* @constant
51-
* @type Number
52-
*/
53-
cc.FMT_RAWDATA = 3;
54-
55-
/**
56-
* Image Format:WEBP
57-
* @constant
58-
* @type Number
59-
*/
60-
cc.FMT_WEBP = 4;
61-
62-
/**
63-
* Image Format:UNKNOWN
64-
* @constant
65-
* @type Number
66-
*/
67-
cc.FMT_UNKNOWN = 5;
68-
6927
/**
7028
* Horizontal center and vertical center.
7129
* @constant
@@ -170,33 +128,6 @@ cc.pngReadCallback = function (png_ptr, data, length) {
170128
}
171129
};
172130

173-
cc.getImageFormatByData = function (imgData) {
174-
// if it is a png file buffer.
175-
if (imgData.length > 8) {
176-
if (imgData[0] == 0x89
177-
&& imgData[1] == 0x50
178-
&& imgData[2] == 0x4E
179-
&& imgData[3] == 0x47
180-
&& imgData[4] == 0x0D
181-
&& imgData[5] == 0x0A
182-
&& imgData[6] == 0x1A
183-
&& imgData[7] == 0x0A) {
184-
return cc.FMT_PNG;
185-
}
186-
}
187-
188-
// if it is a tiff file buffer.
189-
if (imgData.length > 2) {
190-
if ((imgData[0] == 0x49 && imgData[1] == 0x49)
191-
|| (imgData[0] == 0x4d && imgData[1] == 0x4d)
192-
|| (imgData[0] == 0xff && imgData[1] == 0xd8)) {
193-
return cc.FMT_TIFF;
194-
}
195-
}
196-
197-
return cc.FMT_UNKNOWN;
198-
};
199-
200131
/**
201132
* Image
202133
* @class

cocos2d/build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<file name="compress/base64.js"/>
9898
<file name="compress/gzip.js"/>
9999
<file name="compress/zlib.min.js"/>
100+
<file name="particle_nodes/CCFormatHelper.js"/>
100101
<file name="particle_nodes/CCPNGReader.js"/>
101102
<file name="particle_nodes/CCTIFFReader.js"/>
102103
<file name="particle_nodes/CCParticleSystem.js"/>

cocos2d/core/platform/CCEGLView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ cc.EGLView = cc.Class.extend(/** @lends cc.EGLView# */{
157157
}
158158
},
159159

160-
_setResizeCallback: function (callback) {
160+
setResizeCallback: function (callback) {
161161
if (typeof callback == "function" || callback == null) {
162162
this._resizeCallback = callback;
163163
}

cocos2d/jsloader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
'compress/base64.js',
113113
'compress/gzip.js',
114114
'compress/zlib.min.js',
115+
'particle_nodes/CCFormatHelper.js',
115116
'particle_nodes/CCPNGReader.js',
116117
'particle_nodes/CCTIFFReader.js',
117118
'particle_nodes/CCParticleSystem.js',
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* Created by Huabin LING on 1/6/14.
3+
*/
4+
5+
/**
6+
* Image Format:JPG
7+
* @constant
8+
* @type Number
9+
*/
10+
cc.FMT_JPG = 0;
11+
12+
/**
13+
* Image Format:PNG
14+
* @constant
15+
* @type Number
16+
*/
17+
cc.FMT_PNG = 1;
18+
19+
/**
20+
* Image Format:TIFF
21+
* @constant
22+
* @type Number
23+
*/
24+
cc.FMT_TIFF = 2;
25+
26+
/**
27+
* Image Format:RAWDATA
28+
* @constant
29+
* @type Number
30+
*/
31+
cc.FMT_RAWDATA = 3;
32+
33+
/**
34+
* Image Format:WEBP
35+
* @constant
36+
* @type Number
37+
*/
38+
cc.FMT_WEBP = 4;
39+
40+
/**
41+
* Image Format:UNKNOWN
42+
* @constant
43+
* @type Number
44+
*/
45+
cc.FMT_UNKNOWN = 5;
46+
47+
cc.getImageFormatByData = function (imgData) {
48+
// if it is a png file buffer.
49+
if (imgData.length > 8) {
50+
if (imgData[0] == 0x89
51+
&& imgData[1] == 0x50
52+
&& imgData[2] == 0x4E
53+
&& imgData[3] == 0x47
54+
&& imgData[4] == 0x0D
55+
&& imgData[5] == 0x0A
56+
&& imgData[6] == 0x1A
57+
&& imgData[7] == 0x0A) {
58+
return cc.FMT_PNG;
59+
}
60+
}
61+
62+
// if it is a tiff file buffer.
63+
if (imgData.length > 2) {
64+
if ((imgData[0] == 0x49 && imgData[1] == 0x49)
65+
|| (imgData[0] == 0x4d && imgData[1] == 0x4d)
66+
|| (imgData[0] == 0xff && imgData[1] == 0xd8)) {
67+
return cc.FMT_TIFF;
68+
}
69+
}
70+
71+
return cc.FMT_UNKNOWN;
72+
};

template/build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<file name="compress/base64.js"/>
9898
<file name="compress/gzip.js"/>
9999
<file name="compress/zlib.min.js"/>
100+
<file name="particle_nodes/CCFormatHelper.js"/>
100101
<file name="particle_nodes/CCPNGReader.js"/>
101102
<file name="particle_nodes/CCTIFFReader.js"/>
102103
<file name="particle_nodes/CCParticleSystem.js"/>

tools/jsdoc_toolkit/build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
<include name="compress/base64.js"/>
105105
<include name="compress/gzip.js"/>
106106
<include name="compress/zlib.min.js"/>
107+
<include name="particle_nodes/CCFormatHelper.js"/>
107108
<include name="particle_nodes/CCPNGReader.js"/>
108109
<include name="particle_nodes/CCTIFFReader.js"/>
109110
<include name="particle_nodes/CCParticleSystem.js"/>

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sendilkumarj/cocos2d-html5/commit/0e13960f12b8c8ab2e3bc69ee451ee34a0a22270

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy