1
0
mirror of synced 2024-11-30 18:24:32 +01:00

fix a crash DRT didnt notice 👀

This commit is contained in:
0auBSQ 2024-10-24 01:02:03 +09:00
parent fcf4f80b34
commit 3b2cef2636

View File

@ -39,7 +39,7 @@ public static class ImGuiDebugWindow {
#endregion
ImGui.SetNextWindowPos(new System.Numerics.Vector2(0, 0), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSize(new System.Numerics.Vector2(400,300), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSize(new System.Numerics.Vector2(400, 300), ImGuiCond.FirstUseEver);
if (ImGui.Begin("Debug Window (Toggle Visbility with F11)###DEBUG")) {
#region Debug Info
@ -48,7 +48,7 @@ public static class ImGuiDebugWindow {
ImGui.Separator();
ImGui.Text($"Game Version: {OpenTaiko.VERSION}");
ImGui.Text($"Allocated Memory: {pagedmemory} bytes ({String.Format("{0:0.###}",(float)pagedmemory / (1024 * 1024 * 1024))}GB)");
ImGui.Text($"Allocated Memory: {pagedmemory} bytes ({String.Format("{0:0.###}", (float)pagedmemory / (1024 * 1024 * 1024))}GB)");
ImGui.Text($"FPS: {(OpenTaiko.FPS != null ? OpenTaiko.FPS.NowFPS : "???")}");
ImGui.Text("Current Stage: " + OpenTaiko.r現在のステージ.eStageID.ToString() + " (StageID " + ((int)OpenTaiko.r現在のステージ.eStageID).ToString() + ")");
#endregion
@ -179,7 +179,7 @@ public static class ImGuiDebugWindow {
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
string preview = OpenTaiko.SaveFileInstances[save].data.TitleId == 0 ? "初心者" : OpenTaiko.Databases.DBNameplateUnlockables.data[OpenTaiko.SaveFileInstances[save].data.TitleId].nameplateInfo.cld.GetString("");
string preview = OpenTaiko.SaveFileInstances[save].data.TitleId == -1 ? "初心者" : OpenTaiko.Databases.DBNameplateUnlockables.data[OpenTaiko.SaveFileInstances[save].data.TitleId].nameplateInfo.cld.GetString("");
if (ImGui.BeginCombo("Nameplate", preview)) {
foreach (long id in OpenTaiko.Databases.DBNameplateUnlockables.data.Keys) {
@ -285,7 +285,7 @@ public static class ImGuiDebugWindow {
break;
case CStage.EStage.Game:
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
if (ImGui.TreeNodeEx($"Player {i+1}###GAME_CHART_{i}", ImGuiTreeNodeFlags.Framed)) {
if (ImGui.TreeNodeEx($"Player {i + 1}###GAME_CHART_{i}", ImGuiTreeNodeFlags.Framed)) {
Difficulty game_difficulty = OpenTaiko.DifficultyNumberToEnum(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]);
var dtx = OpenTaiko.GetDTX(i);
@ -428,8 +428,7 @@ public static class ImGuiDebugWindow {
"AI Full Combo", "TEXTURE_LUA_AIFC");
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_PerfectScript,
"AI Perfect Combo", "TEXTURE_LUA_AIPFC");
}
else {
} else {
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FailedScript,
"Clear Failed", "TEXTURE_LUA_GAMEFAILED");
currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.ClearScript,
@ -474,9 +473,8 @@ public static class ImGuiDebugWindow {
if (DrawCTextureForImGui(texture, 800, 800)) {
ImGui.Text("Pointer: " + texture.Pointer);
ImGui.Text("Size: x" + texture.szTextureSize.Width + ",y" + texture.szTextureSize.Height);
ImGui.Text("Memory allocated: " + String.Format("{0:0.###}",GetTextureMemAllocationInMegabytes(texture)) + "MB");
}
else {
ImGui.Text("Memory allocated: " + String.Format("{0:0.###}", GetTextureMemAllocationInMegabytes(texture)) + "MB");
} else {
ImGui.TextDisabled("Texture is not loaded.");
}
ImGui.EndTooltip();
@ -503,7 +501,7 @@ public static class ImGuiDebugWindow {
if (texture == null) return false;
return DrawCTextureForImGui(texture,
new Vector2(texture.szTextureSize.Width, texture.szTextureSize.Height),
new Vector2(0,0), new Vector2(1,1));
new Vector2(0, 0), new Vector2(1, 1));
}
private static bool DrawCTextureForImGui(CTexture texture, int max_width, int max_height) {
if (texture == null) return false;