背景のlua関係でメモリリークをしていた問題の修正 (#262)
This commit is contained in:
parent
52a0680bfa
commit
24b5152f76
@ -66,6 +66,7 @@ namespace TJAPlayer3
|
|||||||
|
|
||||||
private Lua LuaScript;
|
private Lua LuaScript;
|
||||||
|
|
||||||
|
private LuaFunction LuaSetConstValues;
|
||||||
private LuaFunction LuaUpdateValues;
|
private LuaFunction LuaUpdateValues;
|
||||||
private LuaFunction LuaClearIn;
|
private LuaFunction LuaClearIn;
|
||||||
private LuaFunction LuaClearOut;
|
private LuaFunction LuaClearOut;
|
||||||
@ -95,6 +96,7 @@ namespace TJAPlayer3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LuaSetConstValues = LuaScript.GetFunction("setConstValues");
|
||||||
LuaUpdateValues = LuaScript.GetFunction("updateValues");
|
LuaUpdateValues = LuaScript.GetFunction("updateValues");
|
||||||
LuaClearIn = LuaScript.GetFunction("clearIn");
|
LuaClearIn = LuaScript.GetFunction("clearIn");
|
||||||
LuaClearOut = LuaScript.GetFunction("clearOut");
|
LuaClearOut = LuaScript.GetFunction("clearOut");
|
||||||
@ -104,15 +106,28 @@ namespace TJAPlayer3
|
|||||||
}
|
}
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
var texs = Textures.ToArray();
|
List<CTexture> texs = new List<CTexture>();
|
||||||
for (int i = 0; i < texs.Length; i++)
|
foreach(var tex in Textures.Values)
|
||||||
{
|
{
|
||||||
TJAPlayer3.t安全にDisposeする(ref texs[i]);
|
texs.Add(tex);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < texs.Count; i++)
|
||||||
|
{
|
||||||
|
var tex = texs[i];
|
||||||
|
TJAPlayer3.tテクスチャの解放(ref tex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Textures.Clear();
|
Textures.Clear();
|
||||||
|
|
||||||
LuaScript?.Dispose();
|
LuaScript?.Dispose();
|
||||||
|
|
||||||
|
LuaSetConstValues?.Dispose();
|
||||||
|
LuaUpdateValues?.Dispose();
|
||||||
|
LuaClearIn?.Dispose();
|
||||||
|
LuaClearOut?.Dispose();
|
||||||
|
LuaInit?.Dispose();
|
||||||
|
LuaUpdate?.Dispose();
|
||||||
|
LuaDraw?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearIn(int player)
|
public void ClearIn(int player)
|
||||||
@ -146,12 +161,7 @@ namespace TJAPlayer3
|
|||||||
if (LuaScript == null) return;
|
if (LuaScript == null) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LuaScript["playerCount"] = TJAPlayer3.ConfigIni.nPlayerCount;
|
LuaSetConstValues.Call(TJAPlayer3.ConfigIni.nPlayerCount, TJAPlayer3.P1IsBlue());
|
||||||
LuaScript["p1IsBlue"] = TJAPlayer3.P1IsBlue();
|
|
||||||
//LuaScript["isClear"] = new bool[4] { false, false, false, false };
|
|
||||||
//LuaScript["towerNightOpacity"] = 0;
|
|
||||||
//LuaScript["towerNightOpacity"] = (double)(255 * currentFloorPositionMax140);
|
|
||||||
|
|
||||||
LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, TJAPlayer3.FPS.n現在のFPS, TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, 0);
|
LuaUpdateValues.Call(TJAPlayer3.FPS.DeltaTime, TJAPlayer3.FPS.n現在のFPS, TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared, 0);
|
||||||
|
|
||||||
LuaInit.Call();
|
LuaInit.Call();
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
|
local playerCount = 0
|
||||||
|
local p1IsBlue = false
|
||||||
|
|
||||||
local fps = 0
|
local fps = 0
|
||||||
local deltaTime = 0
|
local deltaTime = 0
|
||||||
local isClear = { false, false }
|
local isClear = { false, false }
|
||||||
local towerNightNum = 0
|
local towerNightNum = 0
|
||||||
|
|
||||||
|
function setConstValues(_playerCount, _p1IsBlue)
|
||||||
|
playerCount = _playerCount
|
||||||
|
p1IsBlue = _p1IsBlue
|
||||||
|
end
|
||||||
|
|
||||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||||
deltaTime = _deltaTime
|
deltaTime = _deltaTime
|
||||||
fps = _fps
|
fps = _fps
|
||||||
|
Loading…
x
Reference in New Issue
Block a user