Browse Source

Fixed a bug in love.math.gammaToLinear/linearToGamma when a table with an alpha channel is passed in as an argument.

Alex Szpakowski 9 years ago
parent
commit
a1dab12117
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/math/wrap_Math.lua

+ 2 - 2
src/modules/math/wrap_Math.lua

@@ -76,7 +76,7 @@ end
 function math.gammaToLinear(r, g, b, a)
 	if type(r) == "table" then
 		local t = r
-		return gammaToLinear(t[1]), gammaToLinear(t[2]), gammaToLinear(t[3]), a
+		return gammaToLinear(t[1]), gammaToLinear(t[2]), gammaToLinear(t[3]), t[4]
 	end
 	return gammaToLinear(r), gammaToLinear(g), gammaToLinear(b), a
 end
@@ -91,7 +91,7 @@ end
 function math.linearToGamma(r, g, b, a)
 	if type(r) == "table" then
 		local t = r
-		return linearToGamma(t[1]), linearToGamma(t[2]), linearToGamma(t[3]), a
+		return linearToGamma(t[1]), linearToGamma(t[2]), linearToGamma(t[3]), t[4]
 	end
 	return linearToGamma(r), linearToGamma(g), linearToGamma(b), a
 end