Do not allow more than eight sizes and colors in ParticleSystem. This makes it

less impossible to implement ParticleSystem as a vertex shader in the future.
This commit is contained in:
rude
2011-07-24 18:40:22 +02:00
parent 3353180abc
commit 1274b5d55a
@@ -147,6 +147,10 @@ namespace opengl
{
ParticleSystem * t = luax_checkparticlesystem(L, 1);
size_t nSizes = lua_gettop(L) - 1;
if (nSizes > 8)
return luaL_error(L, "At most eight (8) sizes may be used.");
if (nSizes == 1) {
t->setSize(luax_checkfloat(L, 2));
} else {
@@ -199,6 +203,9 @@ namespace opengl
ParticleSystem * t = luax_checkparticlesystem(L, 1);
size_t nColors = (lua_gettop(L) - 1) / 4;
if (nColors > 8)
return luaL_error(L, "At most eight (8) colors may be used.");
if (nColors == 1) {
t->setColor(Color(luaL_checkint(L,2),
luaL_checkint(L,3),