Skip to content

Commit 351170a

Browse files
committed
Merge branch 'develop' into effects
2 parents 8b12673 + 7e19f0d commit 351170a

File tree

23 files changed

+933
-389
lines changed

23 files changed

+933
-389
lines changed

CCRendererGLSupport.m

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
/*
2+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
3+
*
4+
* Copyright (c) 2014 Cocos2D Authors
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#import "CCRenderer_private.h"
26+
27+
#import "CCRenderDispatch.h"
28+
29+
30+
static const CCGraphicsBufferType CCGraphicsBufferGLTypes[] = {
31+
GL_ARRAY_BUFFER,
32+
GL_ELEMENT_ARRAY_BUFFER,
33+
};
34+
35+
36+
@interface CCGraphicsBufferGLBasic : CCGraphicsBuffer @end
37+
@implementation CCGraphicsBufferGLBasic {
38+
@public
39+
GLuint _buffer;
40+
GLenum _type;
41+
}
42+
43+
-(instancetype)initWithCapacity:(NSUInteger)capacity elementSize:(size_t)elementSize type:(CCGraphicsBufferType)type;
44+
{
45+
if((self = [super initWithCapacity:capacity elementSize:elementSize type:type])){
46+
glGenBuffers(1, &_buffer);
47+
_type = CCGraphicsBufferGLTypes[type];
48+
49+
[self setup];
50+
}
51+
52+
return self;
53+
}
54+
55+
-(void)setup
56+
{
57+
_ptr = calloc(_capacity, _elementSize);
58+
}
59+
60+
-(void)destroy
61+
{
62+
free(_ptr);
63+
_ptr = NULL;
64+
65+
GLuint buffer = _buffer;
66+
CCRenderDispatch(YES, ^{glDeleteBuffers(1, &buffer);});
67+
}
68+
69+
-(void)resize:(size_t)newCapacity;
70+
{
71+
_ptr = realloc(_ptr, newCapacity*_elementSize);
72+
_capacity = newCapacity;
73+
}
74+
75+
-(void)prepare;
76+
{
77+
_count = 0;
78+
}
79+
80+
-(void)commit;
81+
{
82+
GLenum type = (GLenum)_type;
83+
glBindBuffer(type, _buffer);
84+
glBufferData(type, (GLsizei)(_count*_elementSize), _ptr, GL_STREAM_DRAW);
85+
glBindBuffer(type, 0);
86+
}
87+
88+
@end
89+
90+
91+
#if __CC_PLATFORM_IOS
92+
93+
@interface CCGraphicsBufferGLUnsynchronized : CCGraphicsBufferGLBasic @end
94+
@implementation CCGraphicsBufferGLUnsynchronized {
95+
GLvoid *(*_mapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
96+
GLvoid (*_flushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
97+
GLboolean (*_unmapBuffer)(GLenum target);
98+
}
99+
100+
#define BUFFER_ACCESS_WRITE (GL_MAP_WRITE_BIT_EXT | GL_MAP_UNSYNCHRONIZED_BIT_EXT | GL_MAP_INVALIDATE_BUFFER_BIT_EXT | GL_MAP_FLUSH_EXPLICIT_BIT_EXT)
101+
#define BUFFER_ACCESS_READ (GL_MAP_READ_BIT_EXT)
102+
103+
-(instancetype)initWithCapacity:(NSUInteger)capacity elementSize:(size_t)elementSize type:(CCGraphicsBufferType)type
104+
{
105+
if((self = [super initWithCapacity:capacity elementSize:elementSize type:type])){
106+
// TODO Does Android look up GL functions by name like Windows/Linux?
107+
_mapBufferRange = glMapBufferRangeEXT;
108+
_flushMappedBufferRange = glFlushMappedBufferRangeEXT;
109+
_unmapBuffer = glUnmapBufferOES;
110+
}
111+
112+
return self;
113+
}
114+
115+
-(void)setup
116+
{
117+
glBindBuffer(_type, _buffer);
118+
glBufferData(_type, _capacity*_elementSize, NULL, GL_STREAM_DRAW);
119+
glBindBuffer(_type, 0);
120+
CC_CHECK_GL_ERROR_DEBUG();
121+
}
122+
123+
-(void)destroy
124+
{
125+
GLuint buffer = _buffer;
126+
CCRenderDispatch(YES, ^{glDeleteBuffers(1, &buffer);});
127+
}
128+
129+
-(void)resize:(size_t)newCapacity
130+
{
131+
// This is a little tricky.
132+
// Need to resize the existing GL buffer object without creating a new name.
133+
134+
// Make the buffer readable.
135+
glBindBuffer(_type, _buffer);
136+
GLsizei oldLength = (GLsizei)(_count*_elementSize);
137+
_flushMappedBufferRange(_type, 0, oldLength);
138+
_unmapBuffer(_type);
139+
void *oldBufferPtr = _mapBufferRange(_type, 0, oldLength, BUFFER_ACCESS_READ);
140+
141+
// Copy the old contents into a temp buffer.
142+
GLsizei newLength = (GLsizei)(newCapacity*_elementSize);
143+
void *tempBufferPtr = malloc(newLength);
144+
memcpy(tempBufferPtr, oldBufferPtr, oldLength);
145+
146+
// Copy that into a new GL buffer.
147+
_unmapBuffer(_type);
148+
glBufferData(_type, newLength, tempBufferPtr, GL_STREAM_DRAW);
149+
void *newBufferPtr = _mapBufferRange(_type, 0, newLength, BUFFER_ACCESS_WRITE);
150+
151+
// Cleanup.
152+
free(tempBufferPtr);
153+
glBindBuffer(_type, 0);
154+
CC_CHECK_GL_ERROR_DEBUG();
155+
156+
// Update values.
157+
_ptr = newBufferPtr;
158+
_capacity = newCapacity;
159+
}
160+
161+
-(void)prepare
162+
{
163+
_count = 0;
164+
165+
GLenum target = (GLenum)_type;
166+
glBindBuffer(_type, _buffer);
167+
_ptr = _mapBufferRange(target, 0, (GLsizei)(_capacity*_elementSize), BUFFER_ACCESS_WRITE);
168+
glBindBuffer(target, 0);
169+
CC_CHECK_GL_ERROR_DEBUG();
170+
}
171+
172+
-(void)commit
173+
{
174+
glBindBuffer(_type, _buffer);
175+
_flushMappedBufferRange(_type, 0, (GLsizei)(_count*_elementSize));
176+
_unmapBuffer(_type);
177+
glBindBuffer(_type, 0);
178+
CC_CHECK_GL_ERROR_DEBUG();
179+
180+
_ptr = NULL;
181+
}
182+
183+
@end
184+
185+
#endif
186+
187+
188+
@interface CCGraphicsBufferBindingsGL : NSObject <CCGraphicsBufferBindings> @end
189+
@implementation CCGraphicsBufferBindingsGL {
190+
GLuint _vao;
191+
}
192+
193+
-(instancetype)initWithVertexBuffer:(CCGraphicsBufferGLBasic *)vertexBuffer indexBuffer:(CCGraphicsBufferGLBasic *)indexBuffer
194+
{
195+
NSAssert([vertexBuffer isKindOfClass:[CCGraphicsBufferGLBasic class]], @"Wrong kind of buffer!");
196+
NSAssert([indexBuffer isKindOfClass:[CCGraphicsBufferGLBasic class]], @"Wrong kind of buffer!");
197+
198+
if((self = [super init])){
199+
CCGL_DEBUG_PUSH_GROUP_MARKER("CCGraphicsBufferBindingsGL: Creating VAO");
200+
201+
glGenVertexArrays(1, &_vao);
202+
glBindVertexArray(_vao);
203+
204+
glEnableVertexAttribArray(CCShaderAttributePosition);
205+
glEnableVertexAttribArray(CCShaderAttributeTexCoord1);
206+
glEnableVertexAttribArray(CCShaderAttributeTexCoord2);
207+
glEnableVertexAttribArray(CCShaderAttributeColor);
208+
209+
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer->_buffer);
210+
glVertexAttribPointer(CCShaderAttributePosition, 4, GL_FLOAT, GL_FALSE, sizeof(CCVertex), (void *)offsetof(CCVertex, position));
211+
glVertexAttribPointer(CCShaderAttributeTexCoord1, 2, GL_FLOAT, GL_FALSE, sizeof(CCVertex), (void *)offsetof(CCVertex, texCoord1));
212+
glVertexAttribPointer(CCShaderAttributeTexCoord2, 2, GL_FLOAT, GL_FALSE, sizeof(CCVertex), (void *)offsetof(CCVertex, texCoord2));
213+
glVertexAttribPointer(CCShaderAttributeColor, 4, GL_FLOAT, GL_FALSE, sizeof(CCVertex), (void *)offsetof(CCVertex, color));
214+
215+
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer->_buffer);
216+
217+
glBindVertexArray(0);
218+
glBindBuffer(GL_ARRAY_BUFFER, 0);
219+
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
220+
221+
CCGL_DEBUG_POP_GROUP_MARKER();
222+
}
223+
224+
return self;
225+
}
226+
227+
-(void)dealloc
228+
{
229+
GLuint vao = _vao;
230+
CCRenderDispatch(YES, ^{glDeleteVertexArraysOES(1, &vao);});
231+
}
232+
233+
-(void)bind:(BOOL)bind
234+
{
235+
CCGL_DEBUG_INSERT_EVENT_MARKER("CCGraphicsBufferBindingsGL: Bind VAO");
236+
glBindVertexArray(bind ? _vao : 0);
237+
}
238+
239+
@end
240+
241+
242+
@interface CCRenderCommandDrawGL : CCRenderCommandDraw @end
243+
@implementation CCRenderCommandDrawGL
244+
245+
static const CCRenderCommandDrawMode GLDrawModes[] = {
246+
GL_TRIANGLES,
247+
GL_LINES,
248+
};
249+
250+
-(void)invokeOnRenderer:(CCRenderer *)renderer
251+
{
252+
CCGL_DEBUG_PUSH_GROUP_MARKER("CCRendererCommandDraw: Invoke");
253+
254+
[renderer setRenderState:_renderState];
255+
glDrawElements(GLDrawModes[_mode], (GLsizei)_count, GL_UNSIGNED_SHORT, (GLvoid *)(_first*sizeof(GLushort)));
256+
CC_INCREMENT_GL_DRAWS(1);
257+
258+
CCGL_DEBUG_POP_GROUP_MARKER();
259+
}
260+
261+
@end

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,13 @@
636636
D2FEB747194F6C9E00FC0574 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
637637
D2FEB749194F6C9E00FC0574 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
638638
D309055018AC23110081BF11 /* CCRenderer_private.h in Headers */ = {isa = PBXBuildFile; fileRef = D309054F18AC23110081BF11 /* CCRenderer_private.h */; };
639+
D31C795019994126007921E1 /* CCMetalSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = D31C794F19994126007921E1 /* CCMetalSupport.m */; };
640+
D31C795219994197007921E1 /* CCMetalSupport_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D31C795119994197007921E1 /* CCMetalSupport_Private.h */; };
639641
D33803E318032ECE0072D8FE /* CCPhysicsBody.m in Sources */ = {isa = PBXBuildFile; fileRef = D33803E218032ECE0072D8FE /* CCPhysicsBody.m */; };
640642
D33803E618032F390072D8FE /* CCPhysicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = D33803E518032F390072D8FE /* CCPhysicsNode.m */; };
641643
D33803EA180331A90072D8FE /* CCPhysicsJoint.m in Sources */ = {isa = PBXBuildFile; fileRef = D33803E9180331A90072D8FE /* CCPhysicsJoint.m */; };
642644
D36D31B718BD3CAA00E45F08 /* CCProgressNode.m in Sources */ = {isa = PBXBuildFile; fileRef = B791E85C182074C500DAE1D7 /* CCProgressNode.m */; };
645+
D36DFA2819996EC500DEC135 /* CCRendererGLSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = D36DFA2719996EC500DEC135 /* CCRendererGLSupport.m */; };
643646
D37D197718B6665700B23FDE /* CCTiledMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 509D0817101E4FCE007E1749 /* CCTiledMap.m */; };
644647
D37D197818B6665700B23FDE /* CCTiledMapLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D2AC9210E90DFA0068ECEB /* CCTiledMapLayer.m */; };
645648
D37D197918B6665700B23FDE /* CCTiledMapObjectGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D2AC9410E90DFA0068ECEB /* CCTiledMapObjectGroup.m */; };
@@ -859,7 +862,7 @@
859862
5BC3CB5219626E4F00C4F0D0 /* CCGestureListener.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCGestureListener.java; sourceTree = "<group>"; };
860863
5BC3CB5719626FA000C4F0D0 /* CCGestureListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGestureListener.h; path = Android/CCGestureListener.h; sourceTree = "<group>"; };
861864
5BC3CB5819626FA000C4F0D0 /* CCGestureListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCGestureListener.m; path = Android/CCGestureListener.m; sourceTree = "<group>"; };
862-
5BF3267A195F8D8800D9A51A /* cocos2dJava.jar */ = {isa = PBXFileReference; explicitFileType = compiled.java.jar; includeInIndex = 0; path = cocos2dJava.jar; sourceTree = BUILT_PRODUCTS_DIR; };
865+
5BF3267A195F8D8800D9A51A /* cocos2dJava.jar */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.jar; path = cocos2dJava.jar; sourceTree = BUILT_PRODUCTS_DIR; };
863866
5BF3268C195F8E0300D9A51A /* CCActivity.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCActivity.java; sourceTree = "<group>"; };
864867
5BF3268D195F8E0300D9A51A /* CCGLView.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = CCGLView.java; sourceTree = "<group>"; };
865868
5BF32696195F947800D9A51A /* CCActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCActivity.h; path = Android/CCActivity.h; sourceTree = "<group>"; };
@@ -1078,13 +1081,16 @@
10781081
D2F78CC71999AB6E00229357 /* CCEffectDropShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEffectDropShadow.h; sourceTree = "<group>"; };
10791082
D2FEB74F194F6C9E00FC0574 /* libcocos2dAndroid.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcocos2dAndroid.a; sourceTree = BUILT_PRODUCTS_DIR; };
10801083
D309054F18AC23110081BF11 /* CCRenderer_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer_private.h; sourceTree = "<group>"; };
1084+
D31C794F19994126007921E1 /* CCMetalSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMetalSupport.m; sourceTree = "<group>"; };
1085+
D31C795119994197007921E1 /* CCMetalSupport_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMetalSupport_Private.h; sourceTree = "<group>"; };
10811086
D33803DC18032E4F0072D8FE /* CCPhysics+ObjectiveChipmunk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CCPhysics+ObjectiveChipmunk.h"; sourceTree = "<group>"; };
10821087
D33803E218032ECE0072D8FE /* CCPhysicsBody.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsBody.m; sourceTree = "<group>"; };
10831088
D33803E418032F250072D8FE /* CCPhysicsBody.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBody.h; sourceTree = "<group>"; };
10841089
D33803E518032F390072D8FE /* CCPhysicsNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsNode.m; sourceTree = "<group>"; };
10851090
D33803E718032F4A0072D8FE /* CCPhysicsNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsNode.h; sourceTree = "<group>"; };
10861091
D33803E81803319F0072D8FE /* CCPhysicsJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsJoint.h; sourceTree = "<group>"; };
10871092
D33803E9180331A90072D8FE /* CCPhysicsJoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsJoint.m; sourceTree = "<group>"; };
1093+
D36DFA2719996EC500DEC135 /* CCRendererGLSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCRendererGLSupport.m; path = ../CCRendererGLSupport.m; sourceTree = "<group>"; };
10881094
D38058181889AD6000822437 /* CCRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer.h; sourceTree = "<group>"; };
10891095
D38058191889AD6000822437 /* CCRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCRenderer.m; sourceTree = "<group>"; };
10901096
D380581E1889CE7700822437 /* CCCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCCache.h; path = ../CCCache.h; sourceTree = "<group>"; };
@@ -1101,6 +1107,7 @@
11011107
D39FA9C718C1BC6B00441627 /* CCShader_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShader_Private.h; sourceTree = "<group>"; };
11021108
D3A2E7D0181E12750033614C /* CCPhysicsShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsShape.h; sourceTree = "<group>"; };
11031109
D3A2E7D1181E12750033614C /* CCPhysicsShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsShape.m; sourceTree = "<group>"; };
1110+
D3C12815199D40AC005D2119 /* CCShaders.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = CCShaders.metal; sourceTree = "<group>"; };
11041111
E01E6D8A121F130E001A484F /* CCLabelBMFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCLabelBMFont.h; sourceTree = "<group>"; };
11051112
E01E6D8B121F130E001A484F /* CCLabelBMFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCLabelBMFont.m; sourceTree = "<group>"; };
11061113
E02BB6D4126CA93A006E46A2 /* CCAnimationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimationCache.h; sourceTree = "<group>"; };
@@ -1278,6 +1285,7 @@
12781285
D38058181889AD6000822437 /* CCRenderer.h */,
12791286
D309054F18AC23110081BF11 /* CCRenderer_private.h */,
12801287
D38058191889AD6000822437 /* CCRenderer.m */,
1288+
D36DFA2719996EC500DEC135 /* CCRendererGLSupport.m */,
12811289
D3903B0C1995288D003AA81A /* CCNoARC.m */,
12821290
D3903B0E199528A0003AA81A /* CCRenderDispatch.h */,
12831291
D3903B0F199528A0003AA81A /* CCRenderDispatch.m */,
@@ -1916,6 +1924,7 @@
19161924
E0EAD0E9121F4B4600B0C81C /* iOS */ = {
19171925
isa = PBXGroup;
19181926
children = (
1927+
D3C12815199D40AC005D2119 /* CCShaders.metal */,
19191928
D3903B12199528B6003AA81A /* CCMetalView.h */,
19201929
D3903B13199528B6003AA81A /* CCMetalView.m */,
19211930
B78AE46A17E7AF6C0028BE0B /* UITouch+CC.h */,
@@ -1931,6 +1940,8 @@
19311940
B7E775CF18527EF0004221AA /* CCAppDelegate.m */,
19321941
D23C5CB2194BC108007CA669 /* CCTouchIOS.h */,
19331942
D23C5CB3194BC108007CA669 /* CCTouchIOS.m */,
1943+
D31C795119994197007921E1 /* CCMetalSupport_Private.h */,
1944+
D31C794F19994126007921E1 /* CCMetalSupport.m */,
19341945
);
19351946
path = iOS;
19361947
sourceTree = "<group>";
@@ -2023,6 +2034,7 @@
20232034
5B063DD419637443002B1CDE /* ALWeakElement.h in Headers */,
20242035
509D0818101E4FCE007E1749 /* CCTiledMap.h in Headers */,
20252036
50F29F6F102053370046CA73 /* base64.h in Headers */,
2037+
D31C795219994197007921E1 /* CCMetalSupport_Private.h in Headers */,
20262038
50F2A105102094550046CA73 /* ZipUtils.h in Headers */,
20272039
50CFAC391023660000175934 /* CCTMXXMLParser.h in Headers */,
20282040
50316AA610291280003ACFE7 /* CCRenderTexture.h in Headers */,
@@ -2480,6 +2492,7 @@
24802492
5018F2780DFDEAFF00C013A5 /* CCScene.m in Sources */,
24812493
5B063DD119637291002B1CDE /* ALWeakDictionary.m in Sources */,
24822494
5018F27E0DFDEAFF00C013A5 /* CCTextureCache.m in Sources */,
2495+
D31C795019994126007921E1 /* CCMetalSupport.m in Sources */,
24832496
B7705FE51831A07B0043CC67 /* ALChannelSource.m in Sources */,
24842497
D2DDB09D19805E8400233D80 /* CCMatrix4.m in Sources */,
24852498
5038B6B30E196CD8009A621E /* CCParticleSystemBase.m in Sources */,
@@ -2502,6 +2515,7 @@
25022515
D37D197A18B6665700B23FDE /* CCTMXXMLParser.m in Sources */,
25032516
509A79980F6188420032F449 /* CCSprite.m in Sources */,
25042517
D37D197718B6665700B23FDE /* CCTiledMap.m in Sources */,
2518+
D36DFA2819996EC500DEC135 /* CCRendererGLSupport.m in Sources */,
25052519
50C508C70F7C194400799124 /* CCFileUtils.m in Sources */,
25062520
B7705FD31831A07B0043CC67 /* OALAudioActions.m in Sources */,
25072521
D25B4F4C194A499700DA9D60 /* CCTouch.m in Sources */,

cocos2d-tests-android/Headless/tests/CCTextFieldTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ - (void) setupTextFieldBasicTest
3434
textField.preferredSize = CGSizeMake(0.5, 50);
3535
textField.positionType = CCPositionTypeNormalized;
3636
textField.position = ccp(0.5f, 0.8f);
37-
textField.padding = 6;
37+
textField.padding = 10;
3838
textField.anchorPoint = ccp(0.5f, 0.5f);
3939
textField.string = @"Hello!";
4040

0 commit comments

Comments
 (0)