mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Array textures can be easily drawn without a shader (resolves issue #1111).
Added love.graphics.drawLayer(texture, layerindex, …). ‘texture’ must be an array texture. Added SpriteBatch:add/setLayer. Added Quad:get/setLayer. This applies to array textures that are drawn without specifying an explicit layer index in the draw call. Added love.graphics.newQuad variants which have layer arguments. --HG-- branch : minor
This commit is contained in:
@@ -74,11 +74,28 @@ int w_Quad_getTextureDimensions(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Quad_setLayer(lua_State *L)
|
||||
{
|
||||
Quad *quad = luax_checkquad(L, 1);
|
||||
int layer = (int) luaL_checknumber(L, 2) - 1;
|
||||
quad->setLayer(layer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Quad_getLayer(lua_State *L)
|
||||
{
|
||||
Quad *quad = luax_checkquad(L, 1);
|
||||
lua_pushnumber(L, quad->getLayer() + 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const luaL_Reg w_Quad_functions[] =
|
||||
{
|
||||
{ "setViewport", w_Quad_setViewport },
|
||||
{ "getViewport", w_Quad_getViewport },
|
||||
{ "getTextureDimensions", w_Quad_getTextureDimensions },
|
||||
{ "setLayer", w_Quad_setLayer },
|
||||
{ "getLayer", w_Quad_getLayer },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user