[loved] Fixed formatting.

This commit is contained in:
badlogic 2017-03-14 09:44:21 +01:00
parent 365d5b0c3c
commit a810a8d5c4

View File

@ -93,26 +93,26 @@ function PolygonBatcher.new(vertexCount, useTwoColorTint)
{"VertexColor2", "byte", 4} -- The r,g,b,a dark color of each vertex. {"VertexColor2", "byte", 4} -- The r,g,b,a dark color of each vertex.
} }
local vertexcode = [[ local vertexcode = [[
attribute vec4 VertexColor2; attribute vec4 VertexColor2;
varying vec4 color2; varying vec4 color2;
vec4 position(mat4 transform_projection, vec4 vertex_position) { vec4 position(mat4 transform_projection, vec4 vertex_position) {
color2 = VertexColor2; color2 = VertexColor2;
return transform_projection * vertex_position; return transform_projection * vertex_position;
} }
]] ]]
local pixelcode = [[ local pixelcode = [[
varying vec4 color2; varying vec4 color2;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) { vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) {
vec4 texColor = Texel(texture, texture_coords); vec4 texColor = Texel(texture, texture_coords);
float alpha = texColor.a * color.a; float alpha = texColor.a * color.a;
vec4 outputColor; vec4 outputColor;
outputColor.a = alpha; outputColor.a = alpha;
outputColor.rgb = (1.0 - texColor.rgb) * color2.rgb * alpha + texColor.rgb * color.rgb; outputColor.rgb = (1.0 - texColor.rgb) * color2.rgb * alpha + texColor.rgb * color.rgb;
return outputColor; return outputColor;
} }
]] ]]
twoColorTintShader = love.graphics.newShader(pixelcode, vertexcode) twoColorTintShader = love.graphics.newShader(pixelcode, vertexcode)