Skip to content

Commit

Permalink
xrEngine/editor_base.h: reorganize ide class memory layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 7, 2025
1 parent e91b8ce commit 16e7911
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/xrEngine/editor_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ENGINE_API ide final :
friend class ide_tool;

public:
enum class visible_state
enum class visible_state : u8
{
hidden, // all ide windows are hidden
full, // input captured, opaque windows
Expand Down Expand Up @@ -109,16 +109,16 @@ class ENGINE_API ide final :

private:
visible_state m_state{};
bool m_text_input_enabled{};

xr_vector<ide_tool*> m_tools;

struct ImGuiBackend
{
Uint32 mouse_window_id{};
int mouse_last_leave_frame{};
bool mouse_can_report_hovered_viewport{};
Uint32 mouse_window_id{};
int mouse_last_leave_frame{};
bool mouse_can_report_hovered_viewport{};
bool text_input_enabled{};
};
ImGuiBackend m_imgui_backend{};

xr_vector<ide_tool*> m_tools;
};
} // namespace xray::editor
10 changes: 5 additions & 5 deletions src/xrEngine/editor_base_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ void ide::UpdateTextInput(bool force_disable /*= false*/)
{
if (force_disable)
{
if (m_text_input_enabled)
if (m_imgui_backend.text_input_enabled)
{
pInput->DisableTextInput();
m_text_input_enabled = false;
m_imgui_backend.text_input_enabled = false;
}
return;
}

const ImGuiIO& io = ImGui::GetIO();

if (m_text_input_enabled != io.WantTextInput)
if (m_imgui_backend.text_input_enabled != io.WantTextInput)
{
m_text_input_enabled = io.WantTextInput;
m_imgui_backend.text_input_enabled = io.WantTextInput;

if (m_text_input_enabled)
if (m_imgui_backend.text_input_enabled)
pInput->EnableTextInput();
else
pInput->DisableTextInput();
Expand Down

0 comments on commit 16e7911

Please sign in to comment.