mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Automatically deduce the type in luax_pushtype, if possible
--HG-- branch : dynamiccore2
This commit is contained in:
@@ -43,7 +43,7 @@ namespace math
|
||||
int w__getRandomGenerator(lua_State *L)
|
||||
{
|
||||
RandomGenerator *t = Math::instance.getRandomGenerator();
|
||||
luax_pushtype(L, RandomGenerator::type, t);
|
||||
luax_pushtype(L, t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ int w_newRandomGenerator(lua_State *L)
|
||||
return luaL_error(L, "%s", lua_tostring(L, -1));
|
||||
}
|
||||
|
||||
luax_pushtype(L, RandomGenerator::type, t);
|
||||
luax_pushtype(L, t);
|
||||
t->release();
|
||||
return 1;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ int w_newBezierCurve(lua_State *L)
|
||||
}
|
||||
|
||||
BezierCurve *curve = Math::instance.newBezierCurve(points);
|
||||
luax_pushtype(L, BezierCurve::type, curve);
|
||||
luax_pushtype(L, curve);
|
||||
curve->release();
|
||||
return 1;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ int w_compress(lua_State *L)
|
||||
luax_catchexcept(L, [&](){ cdata = compress(format, rawdata, level); });
|
||||
}
|
||||
|
||||
luax_pushtype(L, CompressedData::type, cdata);
|
||||
luax_pushtype(L, cdata);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user