fix: more aggressive memory management

This commit is contained in:
Kazhnuz 2021-04-03 10:39:34 +02:00
parent a2246f9bc7
commit ee59bc988b
10 changed files with 15 additions and 13 deletions

View file

@ -23,8 +23,8 @@
local Widget = {}
BaseWidget = Object:extend()
TextWidget = BaseWidget:extend()
local BaseWidget = Object:extend()
local TextWidget = BaseWidget:extend()
-- INIT FUNCTIONS
-- Initialize and configure the widget

View file

@ -54,6 +54,7 @@ function SceneManager:setStoredScene(name)
if storedScene ~= nil then
self.currentScene = storedScene
self.storage[name] = nil
collectgarbage()
self.currentScene:restored()
end
end
@ -73,6 +74,7 @@ function SceneManager:update(dt)
if (self.nextScene ~= nil) then
self.currentScene = self.nextScene
self.nextScene = nil
collectgarbage()
end
if (self.currentScene ~= nil) then

View file

@ -1,6 +1,6 @@
AbstractMobParent = require "game.abstractmobs.parent"
local AbstractMobParent = require "game.abstractmobs.parent"
AbstractCharacter = AbstractMobParent:extend()
local AbstractCharacter = AbstractMobParent:extend()
local charutils = require "game.utils.characters"

View file

@ -1,6 +1,6 @@
AbstractMobParent = require "game.abstractmobs.parent"
local AbstractMobParent = require "game.abstractmobs.parent"
AbstractEnnemy = AbstractMobParent:extend()
local AbstractEnnemy = AbstractMobParent:extend()
local ennutils = require "game.utils.ennemies"

View file

@ -1,4 +1,4 @@
EventUtils = {}
local EventUtils = {}
-- steps utils

View file

@ -1,4 +1,4 @@
Scene = require("core.modules.scenes")
local Scene = require("core.modules.scenes")
local PlayStyle = Scene:extend()
local PauseMenu = require("game.modules.subgames.pause")

View file

@ -1,4 +1,4 @@
BattleUtils = {}
local BattleUtils = {}
local datasutils = require "game.utils.datas"

View file

@ -1,4 +1,4 @@
ChoregraphyUtils = {}
local ChoregraphyUtils = {}
-- steps utils

View file

@ -1,4 +1,4 @@
DataUtils = {}
local DataUtils = {}
local DATADIR = "datas"
local GAMEDATADIR = "gamedata"

View file

@ -21,8 +21,8 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
Core = require "core"
Game = require "game"
local Core = require "core"
local Game = require "game"
scenes = require "scenes"