mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 15:50:25 +01:00
Out of courtesy/consistency move all the DebugHookIdInfo compares into ifndef block.
This commit is contained in:
parent
f959c417fe
commit
e7712ff103
12
imgui.cpp
12
imgui.cpp
@ -7967,9 +7967,11 @@ ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
|
|||||||
{
|
{
|
||||||
ImGuiID seed = IDStack.back();
|
ImGuiID seed = IDStack.back();
|
||||||
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
|
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
ImGuiContext& g = *Ctx;
|
ImGuiContext& g = *Ctx;
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
|
ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
|
||||||
|
#endif
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7977,9 +7979,11 @@ ImGuiID ImGuiWindow::GetID(const void* ptr)
|
|||||||
{
|
{
|
||||||
ImGuiID seed = IDStack.back();
|
ImGuiID seed = IDStack.back();
|
||||||
ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
|
ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
ImGuiContext& g = *Ctx;
|
ImGuiContext& g = *Ctx;
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
|
ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
|
||||||
|
#endif
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7987,9 +7991,11 @@ ImGuiID ImGuiWindow::GetID(int n)
|
|||||||
{
|
{
|
||||||
ImGuiID seed = IDStack.back();
|
ImGuiID seed = IDStack.back();
|
||||||
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
ImGuiContext& g = *Ctx;
|
ImGuiContext& g = *Ctx;
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
|
ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
|
||||||
|
#endif
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8039,8 +8045,10 @@ void ImGui::PushOverrideID(ImGuiID id)
|
|||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
ImGuiWindow* window = g.CurrentWindow;
|
ImGuiWindow* window = g.CurrentWindow;
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL);
|
DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL);
|
||||||
|
#endif
|
||||||
window->IDStack.push_back(id);
|
window->IDStack.push_back(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8050,18 +8058,22 @@ void ImGui::PushOverrideID(ImGuiID id)
|
|||||||
ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
|
ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
|
||||||
{
|
{
|
||||||
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
|
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
|
DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
|
||||||
|
#endif
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed)
|
ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed)
|
||||||
{
|
{
|
||||||
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
||||||
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
if (g.DebugHookIdInfo == id)
|
if (g.DebugHookIdInfo == id)
|
||||||
DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
|
DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
|
||||||
|
#endif
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user