Use C++11 multiline string literal instead (#16765)

* Undo pull request #16742 while keeping fixed indentation on ccShader_UI_Gray.frag

* Removed unnecessary whitespace

* Switched implementation to C++11 string literal

Thanks to stevetranby for the suggestion
This commit is contained in:
Wilson E. Alvarez 2016-11-02 02:13:34 -04:00 committed by minggo
parent a888f42d7f
commit d5dacd4f0e
37 changed files with 131 additions and 131 deletions

View File

@ -1,5 +1,5 @@
const char* cc3D_Color_frag = STRINGIFY(
const char* cc3D_Color_frag = R"(
#ifdef GL_ES
varying lowp vec4 DestinationColor;
@ -12,4 +12,4 @@ void main(void)
{
gl_FragColor = u_color;
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_ColorNormal_frag = STRINGIFY(
const char* cc3D_ColorNormal_frag = R"(
#if (MAX_DIRECTIONAL_LIGHT_NUM > 0)
uniform vec3 u_DirLightSourceColor[MAX_DIRECTIONAL_LIGHT_NUM];
@ -110,4 +110,4 @@ void main(void)
#endif
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_ColorNormalTex_frag = STRINGIFY(
const char* cc3D_ColorNormalTex_frag = R"(
#if (MAX_DIRECTIONAL_LIGHT_NUM > 0)
uniform vec3 u_DirLightSourceColor[MAX_DIRECTIONAL_LIGHT_NUM];
@ -152,4 +152,4 @@ void main(void)
#endif
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_ColorTex_frag = STRINGIFY(
const char* cc3D_ColorTex_frag = R"(
#ifdef GL_ES
varying mediump vec2 TextureCoordOut;
@ -12,4 +12,4 @@ void main(void)
{
gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * u_color;
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_Particle_tex_frag = STRINGIFY(
const char* cc3D_Particle_tex_frag = R"(
#ifdef GL_ES
varying mediump vec2 TextureCoordOut;
@ -14,9 +14,9 @@ void main(void)
{
gl_FragColor = texture2D(CC_Texture0, TextureCoordOut) * ColorOut * u_color;
}
);
)";
const char* cc3D_Particle_color_frag = STRINGIFY(
const char* cc3D_Particle_color_frag = R"(
#ifdef GL_ES
varying mediump vec4 ColorOut;
@ -29,4 +29,4 @@ void main(void)
{
gl_FragColor = ColorOut * u_color;
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_PositionNormalTex_vert = STRINGIFY(
const char* cc3D_PositionNormalTex_vert = R"(
#ifdef USE_NORMAL_MAPPING
#if (MAX_DIRECTIONAL_LIGHT_NUM > 0)
@ -111,9 +111,9 @@ void main(void)
TextureCoordOut.y = 1.0 - TextureCoordOut.y;
gl_Position = CC_PMatrix * ePosition;
}
);
)";
const char* cc3D_SkinPositionNormalTex_vert = STRINGIFY(
const char* cc3D_SkinPositionNormalTex_vert = R"(
#ifdef USE_NORMAL_MAPPING
#if (MAX_DIRECTIONAL_LIGHT_NUM > 0)
@ -305,4 +305,4 @@ void main()
gl_Position = CC_PMatrix * ePosition;
}
);
)";

View File

@ -1,4 +1,4 @@
const char* cc3D_Skybox_frag = STRINGIFY(
const char* cc3D_Skybox_frag = R"(
#ifdef GL_ES
varying mediump vec3 v_reflect;
#else
@ -11,4 +11,4 @@ void main(void)
{
gl_FragColor = textureCube(u_Env, v_reflect) * u_color;
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_Terrain_frag = STRINGIFY(
const char* cc3D_Terrain_frag = R"(
#ifdef GL_ES
precision mediump float;
#endif
@ -45,4 +45,4 @@ if(u_has_alpha<=0)
gl_FragColor = vec4(color.rgb*lightColor.rgb*lightFactor, 1.0);
}
}
);
)";

View File

@ -1,5 +1,5 @@
const char* cc3D_Terrain_vert = STRINGIFY(
const char* cc3D_Terrain_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec3 a_normal;
@ -16,4 +16,4 @@ void main()
v_texCoord = a_texCoord;
v_normal = a_normal;
}
);
)";

View File

@ -1,5 +1,5 @@
const char* ccCameraClearFrag = STRINGIFY(
const char* ccCameraClearFrag = R"(
#ifdef GL_ES
varying mediump vec2 v_texCoord;
@ -12,4 +12,4 @@ void main()
{
gl_FragColor = vec4(v_color, 1.0);
}
);
)";

View File

@ -1,5 +1,5 @@
const char* ccCameraClearVert = STRINGIFY(
const char* ccCameraClearVert = R"(
uniform float depth;
@ -21,4 +21,4 @@ void main()
v_texCoord = a_texCoord;
v_color = a_color;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccETC1ASPositionTextureColor_frag = STRINGIFY(
const char* ccETC1ASPositionTextureColor_frag = R"(
#ifdef GL_ES
precision mediump float;
#endif
@ -38,4 +38,4 @@ void main() {
gl_FragColor = v_fragmentColor * texColor;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccETC1ASPositionTextureGray_frag = STRINGIFY(
const char* ccETC1ASPositionTextureGray_frag = R"(
#ifdef GL_ES
precision mediump float;
#endif
@ -42,4 +42,4 @@ void main()
gl_FragColor.rgb = vec3(0.2126*texColor.r + 0.7152*texColor.g + 0.0722*texColor.b);
gl_FragColor.a = texColor.a;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccLabel_vert = STRINGIFY(
const char* ccLabel_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
@ -43,4 +43,4 @@ void main()
v_fragmentColor = a_color;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -1,4 +1,4 @@
const char* ccLabelDistanceFieldNormal_frag = STRINGIFY(
const char* ccLabelDistanceFieldNormal_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -23,4 +23,4 @@ void main()
float alpha = smoothstep(0.5-width, 0.5+width, dist) * u_textColor.a;
gl_FragColor = v_fragmentColor * vec4(u_textColor.rgb,alpha);
}
);
)";

View File

@ -1,4 +1,4 @@
const char* ccLabelDistanceFieldGlow_frag = STRINGIFY(
const char* ccLabelDistanceFieldGlow_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -23,4 +23,4 @@ void main()
vec4 color = u_effectColor*(1.0-alpha) + u_textColor*alpha;
gl_FragColor = v_fragmentColor * vec4(color.rgb, max(alpha,mu)*color.a);
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccLabelNormal_frag = STRINGIFY(
const char* ccLabelNormal_frag = R"(
#ifdef GL_ES
precision lowp float;
#endif
@ -39,4 +39,4 @@ void main()
u_textColor.a * texture2D(CC_Texture0, v_texCoord).a// A from texture & uniform
);
}
);
)";

View File

@ -1,7 +1,7 @@
/*
* LICENSE ???
*/
const char* ccLabelOutline_frag = STRINGIFY(
const char* ccLabelOutline_frag = R"(
#ifdef GL_ES
precision lowp float;
#endif
@ -40,4 +40,4 @@ void main()
discard;
}
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionColor_frag = STRINGIFY(
const char* ccPositionColor_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -35,4 +35,4 @@ void main()
{
gl_FragColor = v_fragmentColor;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionColor_vert = STRINGIFY(
const char* ccPositionColor_vert = R"(
attribute vec4 a_position;
attribute vec4 a_color;
@ -39,4 +39,4 @@ void main()
gl_Position = CC_MVPMatrix * a_position;
v_fragmentColor = a_color;
}
);
)";

View File

@ -19,7 +19,7 @@
* SOFTWARE.
*/
const char* ccPositionColorLengthTexture_frag = STRINGIFY(
const char* ccPositionColorLengthTexture_frag = R"(
#ifdef GL_ES
// #extension GL_OES_standard_derivatives : enable
@ -39,4 +39,4 @@ void main()
gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord));
// #endif
}
);
)";

View File

@ -19,7 +19,7 @@
* SOFTWARE.
*/
const char* ccPositionColorLengthTexture_vert = STRINGIFY(
const char* ccPositionColorLengthTexture_vert = R"(
#ifdef GL_ES
attribute mediump vec4 a_position;
@ -47,4 +47,4 @@ void main()
gl_Position = CC_MVPMatrix * a_position;
}
);
)";

View File

@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
const char* ccPositionColorTextureAsPointsize_vert = STRINGIFY(
const char* ccPositionColorTextureAsPointsize_vert = R"(
attribute vec4 a_position;
attribute vec4 a_color;
@ -41,4 +41,4 @@ void main()
gl_PointSize = a_texCoord.x;
v_fragmentColor = a_color;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTexture_frag = STRINGIFY(
const char* ccPositionTexture_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -35,4 +35,4 @@ void main()
{
gl_FragColor = texture2D(CC_Texture0, v_texCoord);
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTexture_vert = STRINGIFY(
const char* ccPositionTexture_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
@ -39,4 +39,4 @@ void main()
gl_Position = CC_MVPMatrix * a_position;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureA8Color_frag = STRINGIFY(
const char* ccPositionTextureA8Color_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -38,4 +38,4 @@ void main()
v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a // A from texture & uniform
);
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureA8Color_vert = STRINGIFY(
const char* ccPositionTextureA8Color_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
@ -43,4 +43,4 @@ void main()
v_fragmentColor = a_color;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureColor_frag = STRINGIFY(
const char* ccPositionTextureColor_frag = R"(
#ifdef GL_ES
precision lowp float;
#endif
@ -35,4 +35,4 @@ void main()
{
gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureColor_vert = STRINGIFY(
const char* ccPositionTextureColor_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec4 a_color;
@ -42,5 +42,5 @@ void main()
v_fragmentColor = a_color;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureColorAlphaTest_frag = STRINGIFY(
const char* ccPositionTextureColorAlphaTest_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -44,4 +44,4 @@ void main()
gl_FragColor = texColor * v_fragmentColor;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureColor_noMVP_frag = STRINGIFY(
const char* ccPositionTextureColor_noMVP_frag = R"(
#ifdef GL_ES
precision lowp float;
#endif
@ -35,5 +35,5 @@ void main()
{
gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTextureColor_noMVP_vert = STRINGIFY(
const char* ccPositionTextureColor_noMVP_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec4 a_color;
@ -42,4 +42,4 @@ void main()
v_fragmentColor = a_color;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTexture_uColor_frag = STRINGIFY(
const char* ccPositionTexture_uColor_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -37,4 +37,4 @@ void main()
{
gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPositionTexture_uColor_vert = STRINGIFY(
const char* ccPositionTexture_uColor_vert = R"(
attribute vec4 a_position;
attribute vec2 a_texCoord;
@ -39,4 +39,4 @@ void main()
gl_Position = CC_MVPMatrix * a_position;
v_texCoord = a_texCoord;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPosition_uColor_frag = STRINGIFY(
const char* ccPosition_uColor_frag = R"(
#ifdef GL_ES
precision lowp float;
@ -35,4 +35,4 @@ void main()
{
gl_FragColor = v_fragmentColor;
}
);
)";

View File

@ -23,7 +23,7 @@
* THE SOFTWARE.
*/
const char* ccPosition_uColor_vert = STRINGIFY(
const char* ccPosition_uColor_vert = R"(
attribute vec4 a_position;
uniform vec4 u_color;
@ -41,4 +41,4 @@ void main()
gl_PointSize = u_pointSize;
v_fragmentColor = u_color;
}
);
)";

View File

@ -1,4 +1,4 @@
const char* ccPositionTexture_GrayScale_frag = STRINGIFY(
const char* ccPositionTexture_GrayScale_frag = R"(
#ifdef GL_ES
precision mediump float;
@ -10,8 +10,8 @@ varying vec2 v_texCoord;
void main(void)
{
vec4 c = texture2D(CC_Texture0, v_texCoord);
c = v_fragmentColor * c;
c = v_fragmentColor * c;
gl_FragColor.xyz = vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b);
gl_FragColor.w = c.w;
}
);
)";