mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-25 06:05:45 +00:00
Minor extensions to script interface:
- quad_setRepeatTexture() - quad_setRepeatScale() - quad_isRepeatTexture() (bone, entity, ... as well) - getOldDT() - return unmodified dt - getDT() - as passed to update(), for complicated edge cases where dt is unavailable but required.
This commit is contained in:
parent
8ac88b9749
commit
93c59fdb28
3 changed files with 41 additions and 2 deletions
|
@ -1548,6 +1548,27 @@ luaFunc(quad_setSegs)
|
|||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(quad_setRepeatTexture)
|
||||
{
|
||||
Quad *b = getQuad(L);
|
||||
if (b)
|
||||
b->repeatTextureToFill(getBool(L, 2));
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(quad_setRepeatScale)
|
||||
{
|
||||
Quad *b = getQuad(L);
|
||||
if (b)
|
||||
b->repeatToFillScale = Vector(lua_tonumber(L, 2), lua_tonumber(L, 3));
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(quad_isRepeatTexture)
|
||||
{
|
||||
Quad *b = getQuad(L);
|
||||
luaReturnBool(b ? b->isRepeatingTextureToFill() : false);
|
||||
}
|
||||
|
||||
// --- standard set/get functions for each type, wrapping RenderObject functions ---
|
||||
|
||||
|
@ -1649,7 +1670,10 @@ luaFunc(quad_setSegs)
|
|||
Q_FUNC(getter, prefix, setHeight ) \
|
||||
Q_FUNC(getter, prefix, getWidth ) \
|
||||
Q_FUNC(getter, prefix, getHeight ) \
|
||||
Q_FUNC(getter, prefix, setSegs )
|
||||
Q_FUNC(getter, prefix, setSegs ) \
|
||||
Q_FUNC(getter, prefix, setRepeatTexture) \
|
||||
Q_FUNC(getter, prefix, isRepeatTexture ) \
|
||||
Q_FUNC(getter, prefix, setRepeatScale )
|
||||
|
||||
// This should reflect the internal class hierarchy,
|
||||
// e.g. a Beam is a Quad, so it can use quad_* functions
|
||||
|
@ -6299,6 +6323,16 @@ luaFunc(getHalfTimer)
|
|||
luaReturnNum(dsq->game->getHalfTimer(n));
|
||||
}
|
||||
|
||||
luaFunc(getOldDT)
|
||||
{
|
||||
luaReturnNum(core->get_old_dt());
|
||||
}
|
||||
|
||||
luaFunc(getDT)
|
||||
{
|
||||
luaReturnNum(core->get_current_dt());
|
||||
}
|
||||
|
||||
luaFunc(isNested)
|
||||
{
|
||||
luaReturnBool(core->isNested());
|
||||
|
@ -8103,6 +8137,8 @@ static const struct {
|
|||
luaRegister(getPetPower),
|
||||
luaRegister(getTimer),
|
||||
luaRegister(getHalfTimer),
|
||||
luaRegister(getOldDT),
|
||||
luaRegister(getDT),
|
||||
luaRegister(setCostume),
|
||||
luaRegister(getCostume),
|
||||
luaRegister(getNoteName),
|
||||
|
@ -8180,7 +8216,6 @@ static const struct {
|
|||
|
||||
|
||||
luaRegister(entity_setCullRadius),
|
||||
luaRegister(entity_setUpdateCull),
|
||||
|
||||
luaRegister(entity_switchLayer),
|
||||
|
||||
|
|
|
@ -953,6 +953,7 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
|
|||
|
||||
srand(time(NULL));
|
||||
old_dt = 0;
|
||||
current_dt = 0;
|
||||
|
||||
aspectX = 4;
|
||||
aspectY = 3;
|
||||
|
@ -2956,6 +2957,7 @@ void Core::main(float runTime)
|
|||
if (verbose) debugLog("modify dt");
|
||||
modifyDt(dt);
|
||||
|
||||
current_dt = dt;
|
||||
|
||||
if (verbose) debugLog("check runtime/quit");
|
||||
|
||||
|
|
|
@ -1277,6 +1277,7 @@ public:
|
|||
float aspectX, aspectY;
|
||||
|
||||
float get_old_dt() { return old_dt; }
|
||||
float get_current_dt() { return current_dt; }
|
||||
|
||||
bool debugLogActive;
|
||||
|
||||
|
@ -1330,6 +1331,7 @@ protected:
|
|||
void initIcon();
|
||||
|
||||
float old_dt;
|
||||
float current_dt;
|
||||
|
||||
std::string debugLogPath;
|
||||
|
||||
|
|
Loading…
Reference in a new issue