1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: ImU64 is somehow not the same as u64 on Linux

This commit is contained in:
WerWolv 2022-02-08 22:25:25 +01:00
parent 586bca4bf6
commit 28e5f62c60
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include <hex.hpp>
#include <functional>
#define IMGUI_DEFINE_MATH_OPERATORS
@ -72,8 +74,8 @@ namespace ImGui {
bool ToolBarButton(const char *symbol, ImVec4 color);
bool IconButton(const char *symbol, ImVec4 color, ImVec2 size_arg = ImVec2(0, 0));
bool InputIntegerPrefix(const char* label, const char *prefix, ImU64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None);
bool InputHexadecimal(const char* label, ImU64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None);
bool InputIntegerPrefix(const char* label, const char *prefix, u64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None);
bool InputHexadecimal(const char* label, u64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None);
inline bool HasSecondPassed() {
return static_cast<ImU32>(ImGui::GetTime() * 100) % 100 <= static_cast<ImU32>(ImGui::GetIO().DeltaTime * 100);

View File

@ -495,7 +495,7 @@ namespace ImGui {
return pressed;
}
bool InputIntegerPrefix(const char *label, const char *prefix, ImU64 *value, ImGuiInputTextFlags flags) {
bool InputIntegerPrefix(const char *label, const char *prefix, u64 *value, ImGuiInputTextFlags flags) {
auto window = ImGui::GetCurrentWindow();
const ImGuiID id = window->GetID(label);
const ImGuiStyle &style = GImGui->Style;
@ -527,7 +527,7 @@ namespace ImGui {
return value_changed;
}
bool InputHexadecimal(const char *label, ImU64 *value, ImGuiInputTextFlags flags) {
bool InputHexadecimal(const char *label, u64 *value, ImGuiInputTextFlags flags) {
return InputIntegerPrefix(label, "0x", value, flags | ImGuiInputTextFlags_CharsHexadecimal);
}