Move replacePixels from Image to Texture

This commit is contained in:
Alex Szpakowski
2020-02-04 19:05:43 -04:00
parent 63c5df6aa7
commit 4716211c14
12 changed files with 168 additions and 143 deletions
+1 -10
View File
@@ -62,16 +62,7 @@ int w_ParticleSystem_setTexture(lua_State *L)
int w_ParticleSystem_getTexture(lua_State *L)
{
ParticleSystem *t = luax_checkparticlesystem(L, 1);
Texture *tex = t->getTexture();
// FIXME: big hack right here.
if (dynamic_cast<Image *>(tex) != nullptr)
luax_pushtype(L, Image::type, tex);
else if (dynamic_cast<Canvas *>(tex) != nullptr)
luax_pushtype(L, Canvas::type, tex);
else
return luaL_error(L, "Unable to determine texture type.");
luax_pushtype(L, t->getTexture());
return 1;
}