From 41929955d3dc63ae41977d09780495ce1b42693c Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 3 Aug 2013 22:37:10 +0200 Subject: [PATCH] Fix ScriptInterface developer mode settings not applying. Minor changes: - clean out some Lua functions registered twice - Correct bool cast in quad_setSegs() - Show nested mains in debug console - One less //HACK comment --- Aquaria/DSQ.cpp | 1 + Aquaria/ScriptInterface.cpp | 11 ++++------- BBGE/Core.cpp | 2 -- BBGE/SoundManager.cpp | 1 - 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index ed39c0a..ca8b7ae 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -4557,6 +4557,7 @@ void DSQ::onUpdate(float dt) dsq->sound->getStats(&ca, &ma); os << " ca: " << ca << " ma: " << ma << std::endl; os << dsq->sound->getVolumeString() << std::endl; + os << "runInBG: " << core->settings.runInBackground << " nested: " << core->getNestedMains() << std::endl; os << core->globalResolutionScale.x << ", " << core->globalResolutionScale.y << std::endl; os << "Lua mem: " << scriptInterface.gcGetStats() << " KB" << std::endl; diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index f4af088..6391b5d 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -1580,7 +1580,7 @@ luaFunc(quad_setSegs) { Quad *b = getQuad(L); if (b) - b->setSegs(lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tonumber(L, 4), lua_tonumber(L, 5), lua_tonumber(L, 6), lua_tonumber(L, 7), lua_tonumber(L, 8), lua_tointeger(L, 9)); + b->setSegs(lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tonumber(L, 4), lua_tonumber(L, 5), lua_tonumber(L, 6), lua_tonumber(L, 7), lua_tonumber(L, 8), getBool(L, 9)); luaReturnNil(); } @@ -9079,7 +9079,6 @@ static const struct { luaRegister(entity_setCull), - luaRegister(entity_setTexture), luaRegister(entity_setFillGrid), luaRegister(entity_isFillGrid), @@ -9111,8 +9110,6 @@ static const struct { luaRegister(entity_warpLastPosition), - luaRegister(entity_x), - luaRegister(entity_y), luaRegister(entity_setVel), luaRegister(entity_setVelLen), luaRegister(entity_getVelLen), @@ -9938,9 +9935,9 @@ void ScriptInterface::init() bool devmode = dsq->isDeveloperKeys(); // Everything on in dev mode, everything off otherwise. - bool loudScriptErrors = devmode; - bool complainOnGlobalVar = devmode; - bool complainOnUndefLocal = devmode; + loudScriptErrors = devmode; + complainOnGlobalVar = devmode; + complainOnUndefLocal = devmode; if (!baseState) baseState = createLuaVM(); diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp index 09acce9..6afaf99 100644 --- a/BBGE/Core.cpp +++ b/BBGE/Core.cpp @@ -2746,8 +2746,6 @@ void Core::setMousePosition(const Vector &p) // used to update all render objects either uniformly or as part of a time sliced update process void Core::updateRenderObjects(float dt) { - //HACK: we may not always be assuming virtual 800x600 - Vector cameraC = core->cameraPos + Vector(400,300); for (int c = 0; c < renderObjectLayers.size(); c++) { diff --git a/BBGE/SoundManager.cpp b/BBGE/SoundManager.cpp index f57ad1f..dfc28c7 100644 --- a/BBGE/SoundManager.cpp +++ b/BBGE/SoundManager.cpp @@ -483,7 +483,6 @@ std::string SoundManager::getVolumeString() musicChannel2->getVolume(&musicChannel2Vol); os << "curMusVol (c1/c2/g): " << musicChannelVol << " " << musicChannel2Vol << " " << musicGroupVol << std::endl; - os << "runInBG: " << core->settings.runInBackground << std::endl; return os.str(); }