Browse files

Shaders: shaders are char *

Base shaders are no longer parsed from a file.
They are part of the main "library": faster to parse, easier to migrate to v2.0
  • Loading branch information...
1 parent aece9da commit 30dd74fb735dd0964a322e0d8322e79865136a98 @ricardoquesada ricardoquesada committed Mar 12, 2012
Showing with 721 additions and 2,415 deletions.
  1. +0 −12 Resources/Shaders/PositionColor.fsh
  2. +0 −19 Resources/Shaders/PositionColor.vsh
  3. +0 −13 Resources/Shaders/PositionTexture.fsh
  4. +0 −18 Resources/Shaders/PositionTexture.vsh
  5. +0 −16 Resources/Shaders/PositionTextureA8Color.fsh
  6. +0 −22 Resources/Shaders/PositionTextureA8Color.vsh
  7. +0 −14 Resources/Shaders/PositionTextureColor.fsh
  8. +0 −22 Resources/Shaders/PositionTextureColor.vsh
  9. +0 −27 Resources/Shaders/PositionTextureColorAlphaTest.fsh
  10. +0 −16 Resources/Shaders/PositionTexture_uColor.fsh
  11. +0 −18 Resources/Shaders/PositionTexture_uColor.vsh
  12. +0 −12 Resources/Shaders/Position_uColor.fsh
  13. +0 −20 Resources/Shaders/Position_uColor.vsh
  14. +60 −1,248 cocos2d-ios.xcodeproj/project.pbxproj
  15. +60 −702 cocos2d-mac.xcodeproj/project.pbxproj
  16. +5 −2 cocos2d/CCGLProgram.h
  17. +36 −40 cocos2d/CCGLProgram.m
  18. +13 −12 cocos2d/CCShaderCache.m
  19. +12 −0 cocos2d/ccShader_PositionColor_frag.h
  20. +17 −0 cocos2d/ccShader_PositionColor_vert.h
  21. +16 −0 cocos2d/ccShader_PositionTextureA8Color_frag.h
  22. +21 −0 cocos2d/ccShader_PositionTextureA8Color_vert.h
  23. +23 −0 cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h
  24. +14 −0 cocos2d/ccShader_PositionTextureColor_frag.h
  25. +22 −0 cocos2d/ccShader_PositionTextureColor_vert.h
  26. +13 −0 cocos2d/ccShader_PositionTexture_frag.h
  27. +16 −0 cocos2d/ccShader_PositionTexture_uColor_frag.h
  28. +18 −0 cocos2d/ccShader_PositionTexture_uColor_vert.h
  29. +17 −0 cocos2d/ccShader_PositionTexture_vert.h
  30. +12 −0 cocos2d/ccShader_Position_uColor_frag.h
  31. +19 −0 cocos2d/ccShader_Position_uColor_vert.h
  32. +45 −0 cocos2d/ccShaders.h
  33. +65 −0 cocos2d/ccShaders.m
  34. +1 −0 cocos2d/cocos2d.h
  35. +1 −1 cocos2d/cocos2d.m
  36. +16 −24 install-templates.sh
  37. +193 −4 templates/Xcode4_templates/lib_cocos2d.xctemplate/TemplateInfo.plist
  38. +0 −149 templates/Xcode4_templates/lib_cocos2d_shaders.xctemplate/TemplateInfo.plist
  39. +3 −2 tests/SpriteTest.m
  40. +2 −1 tests/TransitionsTest.m
  41. +1 −1 tools/template_generator.py
View
12 Resources/Shaders/PositionColor.fsh
@@ -1,12 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-varying vec4 v_fragmentColor;
-
-void main()
-{
- gl_FragColor = v_fragmentColor;
-}
View
19 Resources/Shaders/PositionColor.vsh
@@ -1,19 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-attribute vec4 a_color;
-
-uniform mat4 u_MVPMatrix;
-
-#ifdef GL_ES
-varying lowp vec4 v_fragmentColor;
-#else
-varying vec4 v_fragmentColor;
-#endif
-
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- v_fragmentColor = a_color;
-}
View
13 Resources/Shaders/PositionTexture.fsh
@@ -1,13 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-
-void main()
-{
- gl_FragColor = texture2D(u_texture, v_texCoord);
-}
View
18 Resources/Shaders/PositionTexture.vsh
@@ -1,18 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-attribute vec2 a_texCoord;
-
-uniform mat4 u_MVPMatrix;
-
-#ifdef GL_ES
-varying mediump vec2 v_texCoord;
-#else
-varying vec2 v_texCoord;
-#endif
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- v_texCoord = a_texCoord;
-}
View
16 Resources/Shaders/PositionTextureA8Color.fsh
@@ -1,16 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-varying vec4 v_fragmentColor;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-
-void main()
-{
- gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform
- v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform
- );
-}
View
22 Resources/Shaders/PositionTextureA8Color.vsh
@@ -1,22 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-attribute vec2 a_texCoord;
-attribute vec4 a_color;
-
-uniform mat4 u_MVPMatrix;
-
-#ifdef GL_ES
-varying lowp vec4 v_fragmentColor;
-varying mediump vec2 v_texCoord;
-#else
-varying vec4 v_fragmentColor;
-varying vec2 v_texCoord;
-#endif
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- v_fragmentColor = a_color;
- v_texCoord = a_texCoord;
-}
View
14 Resources/Shaders/PositionTextureColor.fsh
@@ -1,14 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-varying vec4 v_fragmentColor;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-
-void main()
-{
- gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord);
-}
View
22 Resources/Shaders/PositionTextureColor.vsh
@@ -1,22 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-attribute vec2 a_texCoord;
-attribute vec4 a_color;
-
-uniform mat4 u_MVPMatrix;
-
-#ifdef GL_ES
-varying lowp vec4 v_fragmentColor;
-varying mediump vec2 v_texCoord;
-#else
-varying vec4 v_fragmentColor;
-varying vec2 v_texCoord;
-#endif
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- v_fragmentColor = a_color;
- v_texCoord = a_texCoord;
-}
View
27 Resources/Shaders/PositionTextureColorAlphaTest.fsh
@@ -1,27 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-uniform float u_alpha_value;
-
-varying vec4 v_fragmentColor;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-
-void main()
-{
- vec4 texColor = texture2D(u_texture, v_texCoord);
-
- //
- // mimic: glAlphaFunc(GL_GREATER)
- // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value
- //
- if ( texColor.a <= u_alpha_value )
- {
- discard;
- }
-
- gl_FragColor = texColor * v_fragmentColor;
-}
View
16 Resources/Shaders/PositionTexture_uColor.fsh
@@ -1,16 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-uniform vec4 u_color;
-
-varying vec2 v_texCoord;
-
-uniform sampler2D u_texture;
-
-void main()
-{
- gl_FragColor = texture2D(u_texture, v_texCoord) * u_color;
-}
View
18 Resources/Shaders/PositionTexture_uColor.vsh
@@ -1,18 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-attribute vec2 a_texCoord;
-
-uniform mat4 u_MVPMatrix;
-
-#ifdef GL_ES
-varying mediump vec2 v_texCoord;
-#else
-varying vec2 v_texCoord;
-#endif
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- v_texCoord = a_texCoord;
-}
View
12 Resources/Shaders/Position_uColor.fsh
@@ -1,12 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-#ifdef GL_ES
-precision lowp float;
-#endif
-
-varying vec4 v_fragmentColor;
-
-void main()
-{
- gl_FragColor = v_fragmentColor;
-}
View
20 Resources/Shaders/Position_uColor.vsh
@@ -1,20 +0,0 @@
-// http://www.cocos2d-iphone.org
-
-attribute vec4 a_position;
-
-uniform mat4 u_MVPMatrix;
-uniform vec4 u_color;
-uniform float u_pointSize;
-
-#ifdef GL_ES
-varying lowp vec4 v_fragmentColor;
-#else
-varying vec4 v_fragmentColor;
-#endif
-
-void main()
-{
- gl_Position = u_MVPMatrix * a_position;
- gl_PointSize = u_pointSize;
- v_fragmentColor = u_color;
-}
View
1,308 cocos2d-ios.xcodeproj/project.pbxproj
60 additions, 1,248 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
762 cocos2d-mac.xcodeproj/project.pbxproj
60 additions, 702 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
7 cocos2d/CCGLProgram.h
@@ -90,8 +90,11 @@ struct _hashUniformEntry;
GLint uniforms_[kCCUniform_MAX];
}
-- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename
- fragmentShaderFilename:(NSString *)fShaderFilename;
+/** Initializes the CCGLProgram with a vertex and fragment with bytes array */
+- (id)initWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray;
+
+/** Initializes the CCGLProgram with a vertex and fragment with contents of filenames */
+- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename;
/** It will add a new attribute to the shader */
- (void)addAttribute:(NSString *)attributeName index:(GLuint)index;
View
76 cocos2d/CCGLProgram.m
@@ -29,8 +29,8 @@
#import "CCGLProgram.h"
#import "ccGLStateCache.h"
#import "ccMacros.h"
-#import "Support/uthash.h"
#import "Support/CCFileUtils.h"
+#import "Support/uthash.h"
#import "Support/OpenGL_Internal.h"
// extern
@@ -58,91 +58,87 @@ typedef void (*GLLogFunction) (GLuint program,
#pragma mark Private Extension Method Declaration
@interface CCGLProgram()
-- (BOOL)compileShader:(GLuint *)shader
- type:(GLenum)type
- file:(NSString *)file;
-- (NSString *)logForOpenGLObject:(GLuint)object
- infoCallback:(GLInfoFunction)infoFunc
- logFunc:(GLLogFunction)logFunc;
+- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar*)byteArray;
+
+- (NSString *)logForOpenGLObject:(GLuint)object infoCallback:(GLInfoFunction)infoFunc logFunc:(GLLogFunction)logFunc;
@end
#pragma mark -
@implementation CCGLProgram
-- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename
+- (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentShaderByteArray:(const GLchar *)fShaderByteArray
{
if ((self = [super init]) )
{
program_ = glCreateProgram();
-
+
vertShader_ = fragShader_ = 0;
-
- if( vShaderFilename ) {
- NSString *fullname = [CCFileUtils fullPathFromRelativePath:vShaderFilename];
-
+
+ if( vShaderByteArray ) {
+
if (![self compileShader:&vertShader_
type:GL_VERTEX_SHADER
- file:fullname])
- CCLOG(@"cocos2d: ERROR: Failed to compile vertex shader: %@", vShaderFilename);
+ byteArray:vShaderByteArray] )
+ CCLOG(@"cocos2d: ERROR: Failed to compile vertex shader");
}
-
+
// Create and compile fragment shader
- if( fShaderFilename ) {
- NSString *fullname = [CCFileUtils fullPathFromRelativePath:fShaderFilename];
-
+ if( fShaderByteArray ) {
if (![self compileShader:&fragShader_
type:GL_FRAGMENT_SHADER
- file:fullname])
- CCLOG(@"cocos2d: ERROR: Failed to compile fragment shader: %@", fShaderFilename);
- }
+ byteArray:fShaderByteArray] )
+ CCLOG(@"cocos2d: ERROR: Failed to compile fragment shader");
+ }
+
if( vertShader_ )
glAttachShader(program_, vertShader_);
-
+
if( fragShader_ )
glAttachShader(program_, fragShader_);
hashForUniforms_ = NULL;
-
}
-
+
return self;
}
+- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename
+{
+
+ const GLchar * vertexSource = (GLchar*) [[NSString stringWithContentsOfFile:[CCFileUtils fullPathFromRelativePath:vShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
+ const GLchar * fragmentSource = (GLchar*) [[NSString stringWithContentsOfFile:[CCFileUtils fullPathFromRelativePath:fShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String];
+
+ return [self initWithVertexShaderByteArray:vertexSource fragmentShaderByteArray:fragmentSource];
+}
+
- (NSString*) description
{
return [NSString stringWithFormat:@"<%@ = %08X | Program = %i, VertexShader = %i, FragmentShader = %i>", [self class], self, program_, vertShader_, fragShader_];
}
-- (BOOL)compileShader:(GLuint *)shader
- type:(GLenum)type
- file:(NSString *)file
+- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar *)source
{
GLint status;
- const GLchar *source;
- source =
- (GLchar *)[[NSString stringWithContentsOfFile:file
- encoding:NSUTF8StringEncoding
- error:nil] UTF8String];
if (!source)
return NO;
-
+
*shader = glCreateShader(type);
glShaderSource(*shader, 1, &source, NULL);
glCompileShader(*shader);
-
+
glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
-
+
if( ! status ) {
if( type == GL_VERTEX_SHADER )
- CCLOG(@"cocos2d: %@: %@", file, [self vertexShaderLog] );
+ CCLOG(@"cocos2d: %@", [self vertexShaderLog] );
else
- CCLOG(@"cocos2d: %@: %@", file, [self fragmentShaderLog] );
-
+ CCLOG(@"cocos2d: %@", [self fragmentShaderLog] );
+
}
- return status == GL_TRUE;
+ return ( status == GL_TRUE );
}
#pragma mark -
View
25 cocos2d/CCShaderCache.m
@@ -24,6 +24,7 @@
*/
#import "CCShaderCache.h"
+#import "ccShaders.h"
#import "CCGLProgram.h"
#import "ccMacros.h"
#import "Support/OpenGL_Internal.h"
@@ -83,8 +84,8 @@ -(id) init
-(void) loadDefaultShaders
{
// Position Texture Color shader
- CCGLProgram *p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionTextureColor.vsh"
- fragmentShaderFilename:@"PositionTextureColor.fsh"];
+ CCGLProgram *p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionTextureColor_vert
+ fragmentShaderByteArray:ccPositionTextureColor_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameColor index:kCCVertexAttrib_Color];
@@ -99,8 +100,8 @@ -(void) loadDefaultShaders
CHECK_GL_ERROR_DEBUG();
// Position Texture Color alpha test
- p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionTextureColor.vsh"
- fragmentShaderFilename:@"PositionTextureColorAlphaTest.fsh"];
+ p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionTextureColor_vert
+ fragmentShaderByteArray:ccPositionTextureColorAlphaTest_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameColor index:kCCVertexAttrib_Color];
@@ -117,8 +118,8 @@ -(void) loadDefaultShaders
//
// Position, Color shader
//
- p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionColor.vsh"
- fragmentShaderFilename:@"PositionColor.fsh"];
+ p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionColor_vert
+ fragmentShaderByteArray:ccPositionColor_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameColor index:kCCVertexAttrib_Color];
@@ -134,8 +135,8 @@ -(void) loadDefaultShaders
//
// Position Texture shader
//
- p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionTexture.vsh"
- fragmentShaderFilename:@"PositionTexture.fsh"];
+ p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionTexture_vert
+ fragmentShaderByteArray:ccPositionTexture_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameTexCoord index:kCCVertexAttrib_TexCoords];
@@ -151,8 +152,8 @@ -(void) loadDefaultShaders
//
// Position, Texture attribs, 1 Color as uniform shader
//
- p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionTexture_uColor.vsh"
- fragmentShaderFilename:@"PositionTexture_uColor.fsh"];
+ p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionTexture_uColor_vert
+ fragmentShaderByteArray:ccPositionTexture_uColor_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameTexCoord index:kCCVertexAttrib_TexCoords];
@@ -168,8 +169,8 @@ -(void) loadDefaultShaders
//
// Position Texture A8 Color shader
//
- p = [[CCGLProgram alloc] initWithVertexShaderFilename:@"PositionTextureA8Color.vsh"
- fragmentShaderFilename:@"PositionTextureA8Color.fsh"];
+ p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionTextureA8Color_vert
+ fragmentShaderByteArray:ccPositionTextureA8Color_frag];
[p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position];
[p addAttribute:kCCAttributeNameColor index:kCCVertexAttrib_Color];
View
12 cocos2d/ccShader_PositionColor_frag.h
@@ -0,0 +1,12 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec4 v_fragmentColor; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = v_fragmentColor; \n\
+} \n\
+";
View
17 cocos2d/ccShader_PositionColor_vert.h
@@ -0,0 +1,17 @@
+" \n\
+attribute vec4 a_position; \n\
+attribute vec4 a_color; \n\
+uniform mat4 u_MVPMatrix; \n\
+ \n\
+#ifdef GL_ES \n\
+varying lowp vec4 v_fragmentColor; \n\
+#else \n\
+varying vec4 v_fragmentColor; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ v_fragmentColor = a_color; \n\
+} \n\
+";
View
16 cocos2d/ccShader_PositionTextureA8Color_frag.h
@@ -0,0 +1,16 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec4 v_fragmentColor; \n\
+varying vec2 v_texCoord; \n\
+uniform sampler2D u_texture; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\
+ v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform \n\
+ ); \n\
+} \n\
+";
View
21 cocos2d/ccShader_PositionTextureA8Color_vert.h
@@ -0,0 +1,21 @@
+" \n\
+attribute vec4 a_position; \n\
+attribute vec2 a_texCoord; \n\
+attribute vec4 a_color; \n\
+uniform mat4 u_MVPMatrix; \n\
+ \n\
+#ifdef GL_ES \n\
+varying lowp vec4 v_fragmentColor; \n\
+varying mediump vec2 v_texCoord; \n\
+#else \n\
+varying vec4 v_fragmentColor; \n\
+varying vec2 v_texCoord; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ v_fragmentColor = a_color; \n\
+ v_texCoord = a_texCoord; \n\
+} \n\
+";
View
23 cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h
@@ -0,0 +1,23 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec4 v_fragmentColor; \n\
+varying vec2 v_texCoord; \n\
+uniform sampler2D u_texture; \n\
+uniform float u_alpha_value; \n\
+ \n\
+void main() \n\
+{ \n\
+ vec4 texColor = texture2D(u_texture, v_texCoord); \n\
+ \n\
+ // mimic: glAlphaFunc(GL_GREATER) \n\
+ // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value \n\
+ \n\
+ if ( texColor.a <= u_alpha_value ) \n\
+ discard; \n\
+ \n\
+ gl_FragColor = texColor * v_fragmentColor; \n\
+} \n\
+";
View
14 cocos2d/ccShader_PositionTextureColor_frag.h
@@ -0,0 +1,14 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec4 v_fragmentColor; \n\
+varying vec2 v_texCoord; \n\
+uniform sampler2D u_texture; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord); \n\
+} \n\
+";
View
22 cocos2d/ccShader_PositionTextureColor_vert.h
@@ -0,0 +1,22 @@
+" \n\
+attribute vec4 a_position; \n\
+attribute vec2 a_texCoord; \n\
+attribute vec4 a_color; \n\
+ \n\
+uniform mat4 u_MVPMatrix; \n\
+ \n\
+#ifdef GL_ES \n\
+varying lowp vec4 v_fragmentColor; \n\
+varying mediump vec2 v_texCoord; \n\
+#else \n\
+varying vec4 v_fragmentColor; \n\
+varying vec2 v_texCoord; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ v_fragmentColor = a_color; \n\
+ v_texCoord = a_texCoord; \n\
+} \n\
+";
View
13 cocos2d/ccShader_PositionTexture_frag.h
@@ -0,0 +1,13 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec2 v_texCoord; \n\
+uniform sampler2D u_texture; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = texture2D(u_texture, v_texCoord); \n\
+} \n\
+";
View
16 cocos2d/ccShader_PositionTexture_uColor_frag.h
@@ -0,0 +1,16 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+uniform vec4 u_color; \n\
+ \n\
+varying vec2 v_texCoord; \n\
+ \n\
+uniform sampler2D u_texture; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = texture2D(u_texture, v_texCoord) * u_color; \n\
+} \n\
+";
View
18 cocos2d/ccShader_PositionTexture_uColor_vert.h
@@ -0,0 +1,18 @@
+" \n\
+attribute vec4 a_position; \n\
+attribute vec2 a_texCoord; \n\
+ \n\
+uniform mat4 u_MVPMatrix; \n\
+ \n\
+#ifdef GL_ES \n\
+varying mediump vec2 v_texCoord; \n\
+#else \n\
+varying vec2 v_texCoord; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ v_texCoord = a_texCoord; \n\
+} \n\
+";
View
17 cocos2d/ccShader_PositionTexture_vert.h
@@ -0,0 +1,17 @@
+" \n\
+attribute vec4 a_position; \n\
+attribute vec2 a_texCoord; \n\
+uniform mat4 u_MVPMatrix; \n\
+ \n\
+#ifdef GL_ES \n\
+varying mediump vec2 v_texCoord; \n\
+#else \n\
+varying vec2 v_texCoord; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ v_texCoord = a_texCoord; \n\
+} \n\
+";
View
12 cocos2d/ccShader_Position_uColor_frag.h
@@ -0,0 +1,12 @@
+" \n\
+#ifdef GL_ES \n\
+precision lowp float; \n\
+#endif \n\
+ \n\
+varying vec4 v_fragmentColor; \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_FragColor = v_fragmentColor; \n\
+} \n\
+";
View
19 cocos2d/ccShader_Position_uColor_vert.h
@@ -0,0 +1,19 @@
+" \n\
+attribute vec4 a_position; \n\
+uniform mat4 u_MVPMatrix; \n\
+uniform vec4 u_color; \n\
+uniform float u_pointSize; \n\
+ \n\
+#ifdef GL_ES \n\
+varying lowp vec4 v_fragmentColor; \n\
+#else \n\
+varying vec4 v_fragmentColor; \n\
+#endif \n\
+ \n\
+void main() \n\
+{ \n\
+ gl_Position = u_MVPMatrix * a_position; \n\
+ gl_PointSize = u_pointSize; \n\
+ v_fragmentColor = u_color; \n\
+} \n\
+";
View
45 cocos2d/ccShaders.h
@@ -0,0 +1,45 @@
+/*
+ * cocos2d for iPhone: http://www.cocos2d-iphone.org
+ *
+ * Copyright (c) 2012 Zynga Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * 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.
+ */
+
+#import "Platforms/CCGL.h"
+
+extern const GLchar * ccPosition_uColor_frag;
+extern const GLchar * ccPosition_uColor_vert;
+
+extern const GLchar * ccPositionColor_frag;
+extern const GLchar * ccPositionColor_vert;
+
+extern const GLchar * ccPositionTexture_frag;
+extern const GLchar * ccPositionTexture_vert;
+
+extern const GLchar * ccPositionTextureA8Color_frag;
+extern const GLchar * ccPositionTextureA8Color_vert;
+
+extern const GLchar * ccPositionTextureColor_frag;
+extern const GLchar * ccPositionTextureColor_vert;
+
+extern const GLchar * ccPositionTextureColorAlphaTest_frag;
+
+extern const GLchar * ccPositionTexture_uColor_frag;
+extern const GLchar * ccPositionTexture_uColor_vert;
View
65 cocos2d/ccShaders.m
@@ -0,0 +1,65 @@
+/*
+ * cocos2d for iPhone: http://www.cocos2d-iphone.org
+ *
+ * Copyright (c) 2012 Zynga Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * 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.
+ */
+
+#import "ccShaders.h"
+
+//
+const GLchar * ccPosition_uColor_frag =
+#import "ccShader_Position_uColor_frag.h"
+const GLchar * ccPosition_uColor_vert =
+#import "ccShader_Position_uColor_vert.h"
+
+//
+const GLchar * ccPositionColor_frag =
+#import "ccShader_PositionColor_frag.h"
+const GLchar * ccPositionColor_vert =
+#import "ccShader_PositionColor_vert.h"
+
+//
+const GLchar * ccPositionTexture_frag =
+#import "ccShader_PositionTexture_frag.h"
+const GLchar * ccPositionTexture_vert =
+#import "ccShader_PositionTexture_vert.h"
+
+//
+const GLchar * ccPositionTextureA8Color_frag =
+#import "ccShader_PositionTextureA8Color_frag.h"
+const GLchar * ccPositionTextureA8Color_vert =
+#import "ccShader_PositionTextureA8Color_vert.h"
+
+//
+const GLchar * ccPositionTextureColor_frag =
+#import "ccShader_PositionTextureColor_frag.h"
+const GLchar * ccPositionTextureColor_vert =
+#import "ccShader_PositionTextureColor_vert.h"
+
+//
+const GLchar * ccPositionTextureColorAlphaTest_frag =
+#import "ccShader_PositionTextureColorAlphaTest_frag.h"
+
+//
+const GLchar * ccPositionTexture_uColor_frag =
+#import "ccShader_PositionTexture_uColor_frag.h"
+const GLchar * ccPositionTexture_uColor_vert =
+#import "ccShader_PositionTexture_uColor_vert.h"
View
1 cocos2d/cocos2d.h
@@ -115,6 +115,7 @@
#import "CCGLProgram.h"
#import "ccGLStateCache.h"
#import "CCShaderCache.h"
+#import "ccShaders.h"
//
// cocos2d macros
View
2 cocos2d/cocos2d.m
@@ -26,7 +26,7 @@
#import <Foundation/Foundation.h>
#import "cocos2d.h"
-static NSString *version = @"cocos2d v2.0.0-github-post-beta2";
+static NSString *version = @"cocos2d v2.0.0-rc0";
NSString *cocos2dVersion()
{
View
40 install-templates.sh
@@ -72,13 +72,13 @@ check_dst_dir(){
copy_cocos2d_files(){
echo ...copying cocos2d files
copy_files cocos2d "$LIBS_DIR"
- copy_files LICENSE_cocos2d.txt "$LIBS_DIR"
+ copy_files LICENSE_cocos2d.txt "$LIBS_DIR"
}
copy_cocosdenshion_files(){
echo ...copying CocosDenshion files
copy_files CocosDenshion/CocosDenshion "$LIBS_DIR"
- copy_files LICENSE_CocosDenshion.txt "$LIBS_DIR"
+ copy_files LICENSE_CocosDenshion.txt "$LIBS_DIR"
}
copy_cocosdenshionextras_files(){
@@ -89,13 +89,9 @@ copy_cocosdenshionextras_files(){
copy_kazmath_files(){
echo ...copying Kazmath files
copy_files external/kazmath "$LIBS_DIR"
- copy_files LICENSE_Kazmath.txt "$LIBS_DIR"
+ copy_files LICENSE_Kazmath.txt "$LIBS_DIR"
}
-copy_shaders_files(){
- echo ...copying cocos2d Shaders files
- copy_files Resources/Shaders "$LIBS_DIR"
-}
print_template_banner(){
echo ''
@@ -116,25 +112,21 @@ copy_xcode4_project_templates(){
check_dst_dir
LIBS_DIR="$DST_DIR""lib_cocos2d.xctemplate/libs/"
- mkdir -p "$LIBS_DIR"
- copy_cocos2d_files
-
- LIBS_DIR="$DST_DIR""lib_cocos2d_shaders.xctemplate/"
- mkdir -p "$LIBS_DIR"
- copy_shaders_files
+ mkdir -p "$LIBS_DIR"
+ copy_cocos2d_files
LIBS_DIR="$DST_DIR""lib_cocosdenshion.xctemplate/libs/"
- mkdir -p "$LIBS_DIR"
- copy_cocosdenshion_files
+ mkdir -p "$LIBS_DIR"
+ copy_cocosdenshion_files
LIBS_DIR="$DST_DIR""lib_cocosdenshionextras.xctemplate/libs/"
- mkdir -p "$LIBS_DIR"
- copy_cocosdenshionextras_files
+ mkdir -p "$LIBS_DIR"
+ copy_cocosdenshionextras_files
LIBS_DIR="$DST_DIR""lib_kazmath.xctemplate/libs/"
- mkdir -p "$LIBS_DIR"
- copy_kazmath_files
+ mkdir -p "$LIBS_DIR"
+ copy_kazmath_files
echo ...copying template files
copy_files templates/Xcode4_templates/ "$DST_DIR"
@@ -149,30 +141,30 @@ copy_xcode4_project_templates(){
echo ...copying Chipmunk files
copy_files external/Chipmunk "$LIBS_DIR"
- copy_files LICENSE_Chipmunk.txt "$LIBS_DIR"
+ copy_files LICENSE_Chipmunk.txt "$LIBS_DIR"
echo done!
print_template_banner "Installing Xcode 4 Box2d iOS template"
LIBS_DIR="$DST_DIR""lib_box2d.xctemplate/libs/"
- mkdir -p "$LIBS_DIR"
+ mkdir -p "$LIBS_DIR"
echo ...copying Box2d files
copy_files external/Box2d/Box2D "$LIBS_DIR"
- copy_files LICENSE_Box2D.txt "$LIBS_DIR"
+ copy_files LICENSE_Box2D.txt "$LIBS_DIR"
echo done!
- # Move File Templates to correct position
+ # Move File Templates to correct position
DST_DIR="$HOME/Library/Developer/Xcode/Templates/File Templates/$COCOS2D_DST_DIR/"
OLD_DIR="$HOME/Library/Developer/Xcode/Templates/$COCOS2D_DST_DIR/"
print_template_banner "Installing Xcode 4 CCNode file templates..."
- check_dst_dir
+ check_dst_dir
mv -f "$OLD_DIR""/CCNode class.xctemplate" "$DST_DIR"
View
197 templates/Xcode4_templates/lib_cocos2d.xctemplate/TemplateInfo.plist
@@ -9,10 +9,6 @@
<string>com.cocos2d-v2.cocos2dlib</string>
<key>Kind</key>
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
- <key>Ancestors</key>
- <array>
- <string>com.cocos2d-v2.cocos2dshaders</string>
- </array>
<key>Definitions</key>
<dict>
<key>libs/cocos2d/CCAction.h</key>
@@ -953,6 +949,162 @@
<key>Path</key>
<string>libs/cocos2d/CCScheduler.m</string>
</dict>
+ <key>libs/cocos2d/ccShader_Position_uColor_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_Position_uColor_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_Position_uColor_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_Position_uColor_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionColor_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionColor_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionColor_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionColor_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTexture_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTexture_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTexture_uColor_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTexture_uColor_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTexture_uColor_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTexture_uColor_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTexture_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTexture_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTextureA8Color_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTextureA8Color_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTextureA8Color_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTextureA8Color_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTextureColor_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTextureColor_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTextureColor_vert.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTextureColor_vert.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
<key>libs/cocos2d/CCShaderCache.h</key>
<dict>
<key>Group</key>
@@ -975,6 +1127,28 @@
<key>Path</key>
<string>libs/cocos2d/CCShaderCache.m</string>
</dict>
+ <key>libs/cocos2d/ccShaders.h</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShaders.h</string>
+ <key>TargetIndices</key>
+ <array/>
+ </dict>
+ <key>libs/cocos2d/ccShaders.m</key>
+ <dict>
+ <key>Group</key>
+ <array>
+ <string>libs</string>
+ <string>cocos2d</string>
+ </array>
+ <key>Path</key>
+ <string>libs/cocos2d/ccShaders.m</string>
+ </dict>
<key>libs/cocos2d/CCSprite.h</key>
<dict>
<key>Group</key>
@@ -2064,8 +2238,23 @@
<string>libs/cocos2d/CCScene.m</string>
<string>libs/cocos2d/CCScheduler.h</string>
<string>libs/cocos2d/CCScheduler.m</string>
+ <string>libs/cocos2d/ccShader_Position_uColor_frag.h</string>
+ <string>libs/cocos2d/ccShader_Position_uColor_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionColor_frag.h</string>
+ <string>libs/cocos2d/ccShader_PositionColor_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionTexture_frag.h</string>
+ <string>libs/cocos2d/ccShader_PositionTexture_uColor_frag.h</string>
+ <string>libs/cocos2d/ccShader_PositionTexture_uColor_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionTexture_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionTextureA8Color_frag.h</string>
+ <string>libs/cocos2d/ccShader_PositionTextureA8Color_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionTextureColor_frag.h</string>
+ <string>libs/cocos2d/ccShader_PositionTextureColor_vert.h</string>
+ <string>libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h</string>
<string>libs/cocos2d/CCShaderCache.h</string>
<string>libs/cocos2d/CCShaderCache.m</string>
+ <string>libs/cocos2d/ccShaders.h</string>
+ <string>libs/cocos2d/ccShaders.m</string>
<string>libs/cocos2d/CCSprite.h</string>
<string>libs/cocos2d/CCSprite.m</string>
<string>libs/cocos2d/CCSpriteBatchNode.h</string>
View
149 templates/Xcode4_templates/lib_cocos2d_shaders.xctemplate/TemplateInfo.plist
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<!-- FILE AUTOGENERATED BY cocos2d/tools/template_generator.py DO NOT EDIT -->
-<plist version="1.0">
-<dict>
- <key>Description</key>
- <string>This is a template description.</string>
- <key>Identifier</key>
- <string>com.cocos2d-v2.cocos2dshaders</string>
- <key>Kind</key>
- <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
- <key>Definitions</key>
- <dict>
- <key>Shaders/Position_uColor.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/Position_uColor.fsh</string>
- </dict>
- <key>Shaders/Position_uColor.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/Position_uColor.vsh</string>
- </dict>
- <key>Shaders/PositionColor.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionColor.fsh</string>
- </dict>
- <key>Shaders/PositionColor.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionColor.vsh</string>
- </dict>
- <key>Shaders/PositionTexture.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTexture.fsh</string>
- </dict>
- <key>Shaders/PositionTexture.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTexture.vsh</string>
- </dict>
- <key>Shaders/PositionTexture_uColor.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTexture_uColor.fsh</string>
- </dict>
- <key>Shaders/PositionTexture_uColor.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTexture_uColor.vsh</string>
- </dict>
- <key>Shaders/PositionTextureA8Color.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTextureA8Color.fsh</string>
- </dict>
- <key>Shaders/PositionTextureA8Color.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTextureA8Color.vsh</string>
- </dict>
- <key>Shaders/PositionTextureColor.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTextureColor.fsh</string>
- </dict>
- <key>Shaders/PositionTextureColor.vsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTextureColor.vsh</string>
- </dict>
- <key>Shaders/PositionTextureColorAlphaTest.fsh</key>
- <dict>
- <key>Group</key>
- <array>
- <string>Shaders</string>
- </array>
- <key>Path</key>
- <string>Shaders/PositionTextureColorAlphaTest.fsh</string>
- </dict>
- </dict>
- <key>Nodes</key>
- <array>
- <string>Shaders/Position_uColor.fsh</string>
- <string>Shaders/Position_uColor.vsh</string>
- <string>Shaders/PositionColor.fsh</string>
- <string>Shaders/PositionColor.vsh</string>
- <string>Shaders/PositionTexture.fsh</string>
- <string>Shaders/PositionTexture.vsh</string>
- <string>Shaders/PositionTexture_uColor.fsh</string>
- <string>Shaders/PositionTexture_uColor.vsh</string>
- <string>Shaders/PositionTextureA8Color.fsh</string>
- <string>Shaders/PositionTextureA8Color.vsh</string>
- <string>Shaders/PositionTextureColor.fsh</string>
- <string>Shaders/PositionTextureColor.vsh</string>
- <string>Shaders/PositionTextureColorAlphaTest.fsh</string>
- </array>
-</dict>
-</plist>
View
5 tests/SpriteTest.m
@@ -4565,7 +4565,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
depthFormat:GL_DEPTH_COMPONENT24_OES
preserveBackbuffer:NO
sharegroup:nil
- multiSampling:YES
+ multiSampling:NO
numberOfSamples:4];
director_ = (CCDirectorIOS*) [CCDirector sharedDirector];
@@ -4627,7 +4627,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
- return UIInterfaceOrientationIsLandscape(interfaceOrientation);
+ return YES;
+// return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
@end
View
3 tests/TransitionsTest.m
@@ -487,7 +487,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
- return UIInterfaceOrientationIsLandscape(interfaceOrientation);
+ return YES;
+// return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
@end
View
2 tools/template_generator.py
@@ -203,7 +203,7 @@ def help():
print "directory_to_parse"
print "\nExample:"
print "\t%s -i kazmathlib --header-path ___PACKAGENAME___/libs/kazmath/include libs" % sys.argv[0]
- print "\t%s -i cocos2dlib --ancestor com.cocos2d-v2.cocos2dshaders libs" % sys.argv[0]
+ print "\t%s -i cocos2dlib libs" % sys.argv[0]
sys.exit(-1)
if __name__ == "__main__":

0 comments on commit 30dd74f

Please sign in to comment.