Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite console rendering code to use ImGui #1744

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/xrCore/Threading/TaskManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ void TaskManager::RunTask(Task& task)
ExecuteTask(task);
}

void TaskManager::Wait(const Task& task) const
void TaskManager::Wait(const Task& task, bool updateSystemEvents /*= false*/) const
{
ZoneScoped;
while (!task.IsFinished())
{
ExecuteOneTask();
if (s_tl_worker.id == 0 && xrDebug::ProcessingFailure())
if (s_tl_worker.id == 0 && (xrDebug::ProcessingFailure() || updateSystemEvents))
SDL_PumpEvents(); // Necessary to prevent dead locks
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/Threading/TaskManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class XRCORE_API TaskManager final
}

public:
void Wait(const Task& task) const;
void Wait(const Task& task, bool updateSystemEvents = false) const;
bool ExecuteOneTask() const;

void Pause(bool pause) { shouldPause.store(pause, std::memory_order_release); }
Expand Down
8 changes: 0 additions & 8 deletions src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ target_sources_grouped(
edit_actions.h
)

target_sources_grouped(
TARGET xrEngine
NAME "Engine\\text_editor\\line_editor"
FILES
line_editor.cpp
line_editor.h
)

target_sources_grouped(
TARGET xrEngine
NAME "Engine\\text_editor\\line_editor_control"
Expand Down
7 changes: 4 additions & 3 deletions src/xrEngine/IGame_Persistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,10 @@ void IGame_Persistent::LoadDraw() const
if (!Device.RenderBegin())
return;

if (GEnv.isDedicatedServer)
Console->OnRender();
else
// XXX: fix dedicated server
//if (GEnv.isDedicatedServer)
// Console->OnRender();
//else
load_draw_internal();

Device.RenderEnd();
Expand Down
7 changes: 4 additions & 3 deletions src/xrEngine/Text_Console.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#include "stdafx.h"
#include "Text_Console.h"
#include "line_editor.h"

#include <windowsx.h>

extern char const* const ioc_prompt;
extern char const* const ch_cursor;
constexpr pcstr ch_cursor = "_";
int g_svTextConsoleUpdateRate = 1;

CTextConsole::CTextConsole()
Expand Down Expand Up @@ -213,6 +212,8 @@ void CTextConsole::OnPaint()

void CTextConsole::DrawLog(HDC hDC, RECT* pRect)
{
// XXX: fix dedicated server
/*
TEXTMETRIC tm;
GetTextMetrics(hDC, &tm);

Expand Down Expand Up @@ -309,7 +310,7 @@ void CTextConsole::DrawLog(HDC hDC, RECT* pRect)
{
break;
}
}
}*/
}
/*
void CTextConsole::IR_OnKeyboardPress( int dik ) !!!!!!!!!!!!!!!!!!!!!
Expand Down
Loading
Loading