mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
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:
@@ -147,6 +147,10 @@ namespace opengl
|
|||||||
{
|
{
|
||||||
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
||||||
size_t nSizes = lua_gettop(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) {
|
if (nSizes == 1) {
|
||||||
t->setSize(luax_checkfloat(L, 2));
|
t->setSize(luax_checkfloat(L, 2));
|
||||||
} else {
|
} else {
|
||||||
@@ -199,6 +203,9 @@ namespace opengl
|
|||||||
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
||||||
size_t nColors = (lua_gettop(L) - 1) / 4;
|
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) {
|
if (nColors == 1) {
|
||||||
t->setColor(Color(luaL_checkint(L,2),
|
t->setColor(Color(luaL_checkint(L,2),
|
||||||
luaL_checkint(L,3),
|
luaL_checkint(L,3),
|
||||||
|
|||||||
Reference in New Issue
Block a user