More stuff and also imgui (#717)
* Add names to input devices * Deprecate unused textures * ImGui debugging - track Script.lua textures * ImGui debugging - track Module textures * ImGui debugging - track Kusudama textures * actually let's not put that in a tree * Remove unused input methods for now * Update ImGuiDebugWindow.cs * Update OpenTaiko/src/Common/ImGuiDebugWindow.cs Co-authored-by: Wei-Cheng Yeh (IID) <iid@ccns.ncku.edu.tw> * Further simplify lyric sandwich --------- Co-authored-by: Wei-Cheng Yeh (IID) <iid@ccns.ncku.edu.tw>
This commit is contained in:
parent
e64462809b
commit
e87212ea60
@ -4,10 +4,14 @@ namespace FDK {
|
|||||||
public class CInputGamepad : IInputDevice, IDisposable {
|
public class CInputGamepad : IInputDevice, IDisposable {
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|
||||||
|
private IGamepad Gamepad { get; set; }
|
||||||
|
|
||||||
public CInputGamepad(IGamepad gamepad) {
|
public CInputGamepad(IGamepad gamepad) {
|
||||||
|
this.Gamepad = gamepad;
|
||||||
this.CurrentType = InputDeviceType.Gamepad;
|
this.CurrentType = InputDeviceType.Gamepad;
|
||||||
this.GUID = gamepad.Index.ToString();
|
this.GUID = gamepad.Index.ToString();
|
||||||
this.ID = gamepad.Index;
|
this.ID = gamepad.Index;
|
||||||
|
this.Name = gamepad.Name;
|
||||||
|
|
||||||
this.InputEvents = new List<STInputEvent>(32);
|
this.InputEvents = new List<STInputEvent>(32);
|
||||||
|
|
||||||
@ -36,6 +40,10 @@ namespace FDK {
|
|||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
public string Name {
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
public List<STInputEvent> InputEvents {
|
public List<STInputEvent> InputEvents {
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
|
@ -4,20 +4,19 @@ namespace FDK {
|
|||||||
public class CInputJoystick : IInputDevice, IDisposable {
|
public class CInputJoystick : IInputDevice, IDisposable {
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|
||||||
private IJoystick Joystick { get; set; }
|
public IJoystick Joystick { get; private set; }
|
||||||
|
|
||||||
public CInputJoystick(IJoystick joystick) {
|
public CInputJoystick(IJoystick joystick) {
|
||||||
Joystick = joystick;
|
this.Joystick = joystick;
|
||||||
this.CurrentType = InputDeviceType.Joystick;
|
this.CurrentType = InputDeviceType.Joystick;
|
||||||
this.GUID = joystick.Index.ToString();
|
this.GUID = joystick.Index.ToString();
|
||||||
this.ID = joystick.Index;
|
this.ID = joystick.Index;
|
||||||
|
this.Name = joystick.Name;
|
||||||
|
|
||||||
this.InputEvents = new List<STInputEvent>(32);
|
this.InputEvents = new List<STInputEvent>(32);
|
||||||
|
|
||||||
joystick.ButtonDown += Joystick_ButtonDown;
|
joystick.ButtonDown += Joystick_ButtonDown;
|
||||||
joystick.ButtonUp += Joystick_ButtonUp;
|
joystick.ButtonUp += Joystick_ButtonUp;
|
||||||
joystick.AxisMoved += Joystick_AxisMoved;
|
|
||||||
joystick.HatMoved += Joystick_HatMoved;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +40,10 @@ namespace FDK {
|
|||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
public string Name {
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
public List<STInputEvent> InputEvents {
|
public List<STInputEvent> InputEvents {
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
@ -145,14 +148,6 @@ namespace FDK {
|
|||||||
ButtonStates[(int)button.Name].Item1 = false;
|
ButtonStates[(int)button.Name].Item1 = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Joystick_AxisMoved(IJoystick joystick, Axis axis) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Joystick_HatMoved(IJoystick joystick, Hat hat) {
|
|
||||||
|
|
||||||
}
|
|
||||||
//-----------------
|
//-----------------
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ namespace FDK {
|
|||||||
this.CurrentType = InputDeviceType.Keyboard;
|
this.CurrentType = InputDeviceType.Keyboard;
|
||||||
this.GUID = "";
|
this.GUID = "";
|
||||||
this.ID = 0;
|
this.ID = 0;
|
||||||
|
this.Name = keyboards.Count > 0 ? keyboards[0].Name : "";
|
||||||
|
|
||||||
foreach (var keyboard in keyboards) {
|
foreach (var keyboard in keyboards) {
|
||||||
keyboard.KeyDown += KeyDown;
|
keyboard.KeyDown += KeyDown;
|
||||||
@ -28,6 +29,7 @@ namespace FDK {
|
|||||||
public InputDeviceType CurrentType { get; private set; }
|
public InputDeviceType CurrentType { get; private set; }
|
||||||
public string GUID { get; private set; }
|
public string GUID { get; private set; }
|
||||||
public int ID { get; private set; }
|
public int ID { get; private set; }
|
||||||
|
public string Name { get; private set; }
|
||||||
public List<STInputEvent> InputEvents { get; private set; }
|
public List<STInputEvent> InputEvents { get; private set; }
|
||||||
public string strDeviceName { get; set; }
|
public string strDeviceName { get; set; }
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
this.CurrentType = InputDeviceType.MidiIn;
|
this.CurrentType = InputDeviceType.MidiIn;
|
||||||
this.GUID = "";
|
this.GUID = "";
|
||||||
this.ID = (int)nID;
|
this.ID = (int)nID;
|
||||||
|
this.Name = "";
|
||||||
this.strDeviceName = ""; // CInput管理で初期化する
|
this.strDeviceName = ""; // CInput管理で初期化する
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@
|
|||||||
public InputDeviceType CurrentType { get; private set; }
|
public InputDeviceType CurrentType { get; private set; }
|
||||||
public string GUID { get; private set; }
|
public string GUID { get; private set; }
|
||||||
public int ID { get; private set; }
|
public int ID { get; private set; }
|
||||||
|
public string Name { get; private set; }
|
||||||
public List<STInputEvent> InputEvents { get; private set; }
|
public List<STInputEvent> InputEvents { get; private set; }
|
||||||
public string strDeviceName { get; set; }
|
public string strDeviceName { get; set; }
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ namespace FDK {
|
|||||||
Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":");
|
Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":");
|
||||||
for (int i = 0; i < InputDevices.Count; i++) {
|
for (int i = 0; i < InputDevices.Count; i++) {
|
||||||
try {
|
try {
|
||||||
Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + ")");
|
Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + " - " + InputDevices[i].Name + ")");
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,13 +15,7 @@ namespace FDK {
|
|||||||
this.CurrentType = InputDeviceType.Mouse;
|
this.CurrentType = InputDeviceType.Mouse;
|
||||||
this.GUID = "";
|
this.GUID = "";
|
||||||
this.ID = 0;
|
this.ID = 0;
|
||||||
try {
|
this.Name = mouse.Name;
|
||||||
Trace.TraceInformation(mouse.Name + " を生成しました。"); // なぜか0x00のゴミが出るので削除
|
|
||||||
this.strDeviceName = mouse.Name;
|
|
||||||
} catch {
|
|
||||||
Trace.TraceWarning("Mouse デバイスの生成に失敗しました。");
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
mouse.Click += Mouse_Click;
|
mouse.Click += Mouse_Click;
|
||||||
mouse.DoubleClick += Mouse_DoubleClick;
|
mouse.DoubleClick += Mouse_DoubleClick;
|
||||||
@ -40,8 +34,8 @@ namespace FDK {
|
|||||||
public InputDeviceType CurrentType { get; private set; }
|
public InputDeviceType CurrentType { get; private set; }
|
||||||
public string GUID { get; private set; }
|
public string GUID { get; private set; }
|
||||||
public int ID { get; private set; }
|
public int ID { get; private set; }
|
||||||
|
public string Name { get; private set; }
|
||||||
public List<STInputEvent> InputEvents { get; private set; }
|
public List<STInputEvent> InputEvents { get; private set; }
|
||||||
public string strDeviceName { get; set; }
|
|
||||||
|
|
||||||
public void Polling(bool useBufferInput) {
|
public void Polling(bool useBufferInput) {
|
||||||
InputEvents.Clear();
|
InputEvents.Clear();
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
int ID {
|
int ID {
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
string Name {
|
||||||
|
get;
|
||||||
|
}
|
||||||
List<STInputEvent> InputEvents {
|
List<STInputEvent> InputEvents {
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ namespace OpenTaiko {
|
|||||||
private static long memoryReadTimer = 0;
|
private static long memoryReadTimer = 0;
|
||||||
private static long pagedmemory = 0;
|
private static long pagedmemory = 0;
|
||||||
private static int textureMemoryUsage = 0;
|
private static int textureMemoryUsage = 0;
|
||||||
|
private static int currentStageMemoryUsage = 0;
|
||||||
|
|
||||||
private static int sortType = -1;
|
private static int sortType = -1;
|
||||||
private static readonly string[] sortNames = ["Memory Usage (Highest->Lowest)", "Memory Usage (Lowest->Highest)", "Pointer ID"];
|
private static readonly string[] sortNames = ["Memory Usage (Highest->Lowest)", "Memory Usage (Lowest->Highest)", "Pointer ID"];
|
||||||
@ -98,7 +99,7 @@ namespace OpenTaiko {
|
|||||||
ImGui.Text("Unknown: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Unknown));
|
ImGui.Text("Unknown: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Unknown));
|
||||||
|
|
||||||
foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) {
|
foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) {
|
||||||
if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + ")")) {
|
if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + " / Name: " + device.Name + ")")) {
|
||||||
switch (device.CurrentType) {
|
switch (device.CurrentType) {
|
||||||
case InputDeviceType.Keyboard:
|
case InputDeviceType.Keyboard:
|
||||||
var keyboard = (CInputKeyboard)device;
|
var keyboard = (CInputKeyboard)device;
|
||||||
@ -313,7 +314,6 @@ namespace OpenTaiko {
|
|||||||
ImGui.Text("Subtitle: " + dtx.SUBTITLE.GetString(""));
|
ImGui.Text("Subtitle: " + dtx.SUBTITLE.GetString(""));
|
||||||
ImGui.Text("Charter: " + dtx.MAKER);
|
ImGui.Text("Charter: " + dtx.MAKER);
|
||||||
|
|
||||||
// BPM
|
|
||||||
ImGui.Text("BPM: " + dtx.BASEBPM + (dtx.listBPM.Count > 1 ? (" (Min: " + dtx.MinBPM + " / Max: " + dtx.MaxBPM + ")") : ""));
|
ImGui.Text("BPM: " + dtx.BASEBPM + (dtx.listBPM.Count > 1 ? (" (Min: " + dtx.MinBPM + " / Max: " + dtx.MaxBPM + ")") : ""));
|
||||||
if (dtx.listBPM.Count > 1) {
|
if (dtx.listBPM.Count > 1) {
|
||||||
if (ImGui.TreeNodeEx($"BPM List ({dtx.listBPM.Count})###GAME_BPM_LIST_{i}")) {
|
if (ImGui.TreeNodeEx($"BPM List ({dtx.listBPM.Count})###GAME_BPM_LIST_{i}")) {
|
||||||
@ -324,6 +324,8 @@ namespace OpenTaiko {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Text("Lyrics: " + (dtx.usingLyricsFile ? dtx.listLyric2.Count : dtx.listLyric.Count));
|
||||||
|
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
||||||
ImGui.Text("Note Count: ");
|
ImGui.Text("Note Count: ");
|
||||||
@ -346,12 +348,7 @@ namespace OpenTaiko {
|
|||||||
}
|
}
|
||||||
private static void Textures() {
|
private static void Textures() {
|
||||||
if (ImGui.BeginTabItem("Textures")) {
|
if (ImGui.BeginTabItem("Textures")) {
|
||||||
ImGui.Text("Total Texture Count: " + OpenTaiko.Tx.listTexture.Count);
|
if (ImGui.BeginCombo("Change listTexture Sort###TEXTURE_TOTAL_SORT", sortType != -1 ? sortNames[sortType] : "(Default)")) {
|
||||||
ImGui.Text("Total Memory Usage: " + textureMemoryUsage + "bytes (" + GetMemAllocationInMegabytes(textureMemoryUsage) + "MB)");
|
|
||||||
if (ImGui.Button("Refresh") || textureMemoryUsage == 0) {
|
|
||||||
textureMemoryUsage = OpenTaiko.Tx.listTexture.Where(tex => tex != null).Sum(tex => tex.szTextureSize.Width * tex.szTextureSize.Height * 4);
|
|
||||||
}
|
|
||||||
if (ImGui.BeginCombo("Change Sort", sortType != -1 ? sortNames[sortType] : "(Default)")) {
|
|
||||||
if (ImGui.Selectable(sortNames[0], sortType == 0)) {
|
if (ImGui.Selectable(sortNames[0], sortType == 0)) {
|
||||||
OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1).CompareTo(tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1));
|
OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1).CompareTo(tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1));
|
||||||
sortType = 0;
|
sortType = 0;
|
||||||
@ -366,17 +363,93 @@ namespace OpenTaiko {
|
|||||||
}
|
}
|
||||||
ImGui.EndCombo();
|
ImGui.EndCombo();
|
||||||
}
|
}
|
||||||
|
if (OpenTaiko.r現在のステージ.eStageID != CStage.EStage.StartUp)
|
||||||
if (ImGui.TreeNodeEx("Show All Textures###TEXTURE_SHOWALL")) {
|
CTextureListPopup(OpenTaiko.Tx.listTexture, "Show listTexture", "TEXTURE_ALL");
|
||||||
int index = 0;
|
|
||||||
if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.StartUp)
|
|
||||||
ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage.");
|
|
||||||
else
|
else
|
||||||
foreach (CTexture tex in OpenTaiko.Tx.listTexture) {
|
ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage.");
|
||||||
CTexturePopup(tex, $"#{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###TEXTURE_SHOW_POPUP_{index++}");
|
|
||||||
|
currentStageMemoryUsage = 0;
|
||||||
|
|
||||||
|
#region Script.lua Memory Usage
|
||||||
|
int index = 0;
|
||||||
|
foreach (CLuaScript luascript in CLuaScript.listScripts)
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(luascript.listDisposables.OfType<CTexture>(),
|
||||||
|
$"Module #{index}", $"MODULE{index++}_TEXTURES");
|
||||||
|
|
||||||
|
switch (OpenTaiko.r現在のステージ.eStageID) {
|
||||||
|
#region Game
|
||||||
|
case CStage.EStage.Game:
|
||||||
|
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.UpScript,
|
||||||
|
"Up Background", "TEXTURE_LUA_UPBG");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.DownScript,
|
||||||
|
"Down Background", "TEXTURE_LUA_DOWNBG");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actMob.MobScript,
|
||||||
|
"Mob", "TEXTURE_LUA_MOB");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaScript,
|
||||||
|
"Kusudama", "TEXTURE_LUA_KUSUDAMA");
|
||||||
|
|
||||||
|
#region Endings
|
||||||
|
switch ((Difficulty)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) {
|
||||||
|
case Difficulty.Tower:
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_DropoutScript,
|
||||||
|
"Tower Dropout", "TEXTURE_LUA_TOWERDROPOUT");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PassScript,
|
||||||
|
"Tower Cleared", "TEXTURE_LUA_TOWERCLEAR");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_FullComboScript,
|
||||||
|
"Tower Full Combo", "TEXTURE_LUA_TOWERFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PerfectScript,
|
||||||
|
"Tower Perfect Combo", "TEXTURE_LUA_TOWERPFC");
|
||||||
|
break;
|
||||||
|
case Difficulty.Dan:
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_FailScript,
|
||||||
|
"Dan Clear Failed", "TEXTURE_LUA_DANFAILED");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript,
|
||||||
|
"Dan Red Clear", "TEXTURE_LUA_DANCLEAR");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript,
|
||||||
|
"Dan Red Full Combo", "TEXTURE_LUA_DANFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript,
|
||||||
|
"Dan Red Perfect", "TEXTURE_LUA_DANPFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript,
|
||||||
|
"Dan Gold Clear", "TEXTURE_LUA_DANGOLDCLEAR");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript,
|
||||||
|
"Dan Gold Full Combo", "TEXTURE_LUA_DANGOLDFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript,
|
||||||
|
"Dan Gold Perfect", "TEXTURE_LUA_DANGOLDPFC");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (OpenTaiko.ConfigIni.bAIBattleMode) {
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AILoseScript,
|
||||||
|
"AI Clear Failed", "TEXTURE_LUA_AIFAILED");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWinScript,
|
||||||
|
"AI Cleared", "TEXTURE_LUA_AICLEAR");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_FullComboScript,
|
||||||
|
"AI Full Combo", "TEXTURE_LUA_AIFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_PerfectScript,
|
||||||
|
"AI Perfect Combo", "TEXTURE_LUA_AIPFC");
|
||||||
}
|
}
|
||||||
ImGui.TreePop();
|
else {
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FailedScript,
|
||||||
|
"Clear Failed", "TEXTURE_LUA_GAMEFAILED");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.ClearScript,
|
||||||
|
"Cleared", "TEXTURE_LUA_GAMECLEAR");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FullComboScript,
|
||||||
|
"Full Combo", "TEXTURE_LUA_GAMEFC");
|
||||||
|
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.PerfectComboScript,
|
||||||
|
"Perfect Combo", "TEXTURE_LUA_GAMEPFC");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Text("Script.lua Tex Memory Usage: " + GetMemAllocationInMegabytes(currentStageMemoryUsage) + "MB");
|
||||||
|
#endregion
|
||||||
|
|
||||||
ImGui.EndTabItem();
|
ImGui.EndTabItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,6 +482,22 @@ namespace OpenTaiko {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static int CTextureListPopup(IEnumerable<CTexture> textureList, string label, string id) {
|
||||||
|
if (textureList == null) return 0;
|
||||||
|
int memoryCount = GetTotalMemoryUsageFromCTextureList(textureList);
|
||||||
|
|
||||||
|
if (ImGui.TreeNodeEx($"{label} Textures: ({textureList.Count()} / {String.Format("{0:0.###}", GetMemAllocationInMegabytes(memoryCount))}MB)###{id}")) {
|
||||||
|
int index = 0;
|
||||||
|
foreach (CTexture tex in textureList) {
|
||||||
|
CTexturePopup(tex, $"Texture #{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###{id}_{index++}");
|
||||||
|
}
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
return memoryCount;
|
||||||
|
}
|
||||||
|
private static int CTextureListPopup(ScriptBG script, string label, string id) {
|
||||||
|
return script != null ? CTextureListPopup(script.Textures.Values, label, id) : 0;
|
||||||
|
}
|
||||||
private static bool DrawCTextureForImGui(CTexture texture) {
|
private static bool DrawCTextureForImGui(CTexture texture) {
|
||||||
if (texture == null) return false;
|
if (texture == null) return false;
|
||||||
return DrawCTextureForImGui(texture,
|
return DrawCTextureForImGui(texture,
|
||||||
@ -446,12 +535,18 @@ namespace OpenTaiko {
|
|||||||
return (float)GetTextureMemAllocation(texture) / (1024 * 1024);
|
return (float)GetTextureMemAllocation(texture) / (1024 * 1024);
|
||||||
}
|
}
|
||||||
private static int GetTextureMemAllocation(CTexture texture) {
|
private static int GetTextureMemAllocation(CTexture texture) {
|
||||||
if (texture == null) return 0;
|
return texture != null ? (texture.szTextureSize.Width * texture.szTextureSize.Height * 4) : 0;
|
||||||
return texture.szTextureSize.Width * texture.szTextureSize.Height * 4;
|
|
||||||
}
|
}
|
||||||
private static Vector4 ColorToVector4(Color color) {
|
private static Vector4 ColorToVector4(Color color) {
|
||||||
return new Vector4((float)color.R / 255, (float)color.G / 255, (float)color.B / 255, (float)color.A / 255);
|
return new Vector4((float)color.R / 255, (float)color.G / 255, (float)color.B / 255, (float)color.A / 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetTotalMemoryUsageFromCTextureList(IEnumerable<CTexture> textureList) {
|
||||||
|
return textureList.Where(tex => tex != null).Sum(GetTextureMemAllocation);
|
||||||
|
}
|
||||||
|
private static int GetTotalMemoryUsageFromCTextureList(ScriptBG script) {
|
||||||
|
return script != null ? GetTotalMemoryUsageFromCTextureList(script.Textures.Values) : 0;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ using NLua;
|
|||||||
|
|
||||||
namespace OpenTaiko {
|
namespace OpenTaiko {
|
||||||
class CLuaScript : IDisposable {
|
class CLuaScript : IDisposable {
|
||||||
private static List<CLuaScript> listScripts = new List<CLuaScript>();
|
public static List<CLuaScript> listScripts { get; private set; } = new List<CLuaScript>();
|
||||||
public static void tReloadLanguage(string lang) {
|
public static void tReloadLanguage(string lang) {
|
||||||
foreach (var item in listScripts) {
|
foreach (var item in listScripts) {
|
||||||
item.ReloadLanguage(lang);
|
item.ReloadLanguage(lang);
|
||||||
@ -32,7 +32,7 @@ namespace OpenTaiko {
|
|||||||
private CLuaInfo luaInfo;
|
private CLuaInfo luaInfo;
|
||||||
private CLuaFps luaFPS = new CLuaFps();
|
private CLuaFps luaFPS = new CLuaFps();
|
||||||
|
|
||||||
private List<IDisposable> listDisposables = new List<IDisposable>();
|
public List<IDisposable> listDisposables { get; private set; } = new List<IDisposable>();
|
||||||
|
|
||||||
protected bool Available {
|
protected bool Available {
|
||||||
get {
|
get {
|
||||||
|
@ -602,7 +602,6 @@ namespace OpenTaiko {
|
|||||||
Gauge_Dan[5] = TxC(GAME + GAUGE + @$"1P_Dan_Right.png");
|
Gauge_Dan[5] = TxC(GAME + GAUGE + @$"1P_Dan_Right.png");
|
||||||
|
|
||||||
Gauge_Soul = TxC(GAME + GAUGE + @$"Soul.png");
|
Gauge_Soul = TxC(GAME + GAUGE + @$"Soul.png");
|
||||||
Gauge_Flash = TxC(GAME + GAUGE + @$"Flash.png");
|
|
||||||
Gauge_Soul_Fire = TxC(GAME + GAUGE + @$"Fire.png");
|
Gauge_Soul_Fire = TxC(GAME + GAUGE + @$"Fire.png");
|
||||||
Gauge_Soul_Explosion = new CTexture[2];
|
Gauge_Soul_Explosion = new CTexture[2];
|
||||||
Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @$"1P_Explosion.png");
|
Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @$"1P_Explosion.png");
|
||||||
@ -875,7 +874,6 @@ namespace OpenTaiko {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 6_結果発表
|
#region 6_結果発表
|
||||||
Result_FadeIn = TxC(RESULT + @$"FadeIn.png");
|
|
||||||
|
|
||||||
Result_Gauge[0] = TxC(RESULT + @$"Gauge.png");
|
Result_Gauge[0] = TxC(RESULT + @$"Gauge.png");
|
||||||
Result_Gauge_Base[0] = TxC(RESULT + @$"Gauge_Base.png");
|
Result_Gauge_Base[0] = TxC(RESULT + @$"Gauge_Base.png");
|
||||||
@ -2529,7 +2527,6 @@ namespace OpenTaiko {
|
|||||||
Gauge_Killzone,
|
Gauge_Killzone,
|
||||||
Gauge_Soul_Explosion;
|
Gauge_Soul_Explosion;
|
||||||
public CTexture Gauge_Soul,
|
public CTexture Gauge_Soul,
|
||||||
Gauge_Flash,
|
|
||||||
Gauge_Soul_Fire;
|
Gauge_Soul_Fire;
|
||||||
public CTexture[] Gauge_Dan;
|
public CTexture[] Gauge_Dan;
|
||||||
public CTexture[] Gauge_Dan_Rainbow;
|
public CTexture[] Gauge_Dan_Rainbow;
|
||||||
@ -2672,8 +2669,7 @@ namespace OpenTaiko {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 6_結果発表
|
#region 6_結果発表
|
||||||
public CTexture Result_FadeIn,
|
public CTexture Result_Header,
|
||||||
Result_Header,
|
|
||||||
Result_Number,
|
Result_Number,
|
||||||
Result_Panel,
|
Result_Panel,
|
||||||
Result_Panel_2P,
|
Result_Panel_2P,
|
||||||
|
@ -182,7 +182,7 @@ namespace OpenTaiko {
|
|||||||
return base.Draw();
|
return base.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
private KusudamaScript KusudamaScript;
|
public KusudamaScript KusudamaScript { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
private CCounter ct風船終了;
|
private CCounter ct風船終了;
|
||||||
|
@ -742,29 +742,29 @@ namespace OpenTaiko {
|
|||||||
#region[ private ]
|
#region[ private ]
|
||||||
//-----------------
|
//-----------------
|
||||||
|
|
||||||
private EndAnimeScript FailedScript;
|
public EndAnimeScript FailedScript { get; private set; }
|
||||||
private EndAnimeScript ClearScript;
|
public EndAnimeScript ClearScript { get; private set; }
|
||||||
private EndAnimeScript FullComboScript;
|
public EndAnimeScript FullComboScript { get; private set; }
|
||||||
private EndAnimeScript PerfectComboScript;
|
public EndAnimeScript PerfectComboScript { get; private set; }
|
||||||
|
|
||||||
private EndAnimeScript AILoseScript;
|
public EndAnimeScript AILoseScript { get; private set; }
|
||||||
private EndAnimeScript AIWinScript;
|
public EndAnimeScript AIWinScript { get; private set; }
|
||||||
private EndAnimeScript AIWin_FullComboScript;
|
public EndAnimeScript AIWin_FullComboScript { get; private set; }
|
||||||
private EndAnimeScript AIWin_PerfectScript;
|
public EndAnimeScript AIWin_PerfectScript { get; private set; }
|
||||||
|
|
||||||
private EndAnimeScript Tower_DropoutScript;
|
public EndAnimeScript Tower_DropoutScript { get; private set; }
|
||||||
private EndAnimeScript Tower_TopReached_PassScript;
|
public EndAnimeScript Tower_TopReached_PassScript { get; private set; }
|
||||||
private EndAnimeScript Tower_TopReached_FullComboScript;
|
public EndAnimeScript Tower_TopReached_FullComboScript { get; private set; }
|
||||||
private EndAnimeScript Tower_TopReached_PerfectScript;
|
public EndAnimeScript Tower_TopReached_PerfectScript { get; private set; }
|
||||||
|
|
||||||
private EndAnimeScript Dan_FailScript;
|
public EndAnimeScript Dan_FailScript { get; private set; }
|
||||||
private EndAnimeScript Dan_Red_PassScript;
|
public EndAnimeScript Dan_Red_PassScript { get; private set; }
|
||||||
private EndAnimeScript Dan_Red_FullComboScript;
|
public EndAnimeScript Dan_Red_FullComboScript { get; private set; }
|
||||||
private EndAnimeScript Dan_Red_PerfectScript;
|
public EndAnimeScript Dan_Red_PerfectScript { get; private set; }
|
||||||
|
|
||||||
private EndAnimeScript Dan_Gold_PassScript;
|
public EndAnimeScript Dan_Gold_PassScript { get; private set; }
|
||||||
private EndAnimeScript Dan_Gold_FullComboScript;
|
public EndAnimeScript Dan_Gold_FullComboScript { get; private set; }
|
||||||
private EndAnimeScript Dan_Gold_PerfectScript;
|
public EndAnimeScript Dan_Gold_PerfectScript { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -804,8 +804,8 @@ namespace OpenTaiko {
|
|||||||
CSound soundAIWinFullCombo;
|
CSound soundAIWinFullCombo;
|
||||||
CSound soundAIWinPerfectCombo;
|
CSound soundAIWinPerfectCombo;
|
||||||
|
|
||||||
EndMode[] Mode;
|
public EndMode[] Mode { get; private set; }
|
||||||
enum EndMode {
|
public enum EndMode {
|
||||||
StageFailed,
|
StageFailed,
|
||||||
StageCleared,
|
StageCleared,
|
||||||
StageFullCombo,
|
StageFullCombo,
|
||||||
|
@ -240,8 +240,6 @@ namespace OpenTaiko {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (OpenTaiko.Tx.Gauge_Line[0] != null) {
|
|
||||||
#region [Rainbow]
|
#region [Rainbow]
|
||||||
|
|
||||||
if (this.db現在のゲージ値[0] >= 100.0) {
|
if (this.db現在のゲージ値[0] >= 100.0) {
|
||||||
@ -276,6 +274,7 @@ namespace OpenTaiko {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
if (OpenTaiko.Tx.Gauge_Line[0] != null) {
|
||||||
|
|
||||||
OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.X = scale;
|
OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.X = scale;
|
||||||
OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.Y = scale;
|
OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.Y = scale;
|
||||||
|
@ -78,7 +78,7 @@ namespace OpenTaiko {
|
|||||||
}
|
}
|
||||||
#region[ private ]
|
#region[ private ]
|
||||||
//-----------------
|
//-----------------
|
||||||
private ScriptBG MobScript;
|
public ScriptBG MobScript { get; private set; }
|
||||||
//-----------------
|
//-----------------
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user