Fix editor scene persistence and XC scene workflow
This commit is contained in:
@@ -3,14 +3,22 @@
|
||||
namespace XCEngine {
|
||||
namespace Debug {
|
||||
|
||||
EditorConsoleSink* EditorConsoleSink::s_instance = nullptr;
|
||||
|
||||
EditorConsoleSink* EditorConsoleSink::GetInstance() {
|
||||
static EditorConsoleSink instance;
|
||||
return &instance;
|
||||
static EditorConsoleSink fallbackInstance;
|
||||
return s_instance ? s_instance : &fallbackInstance;
|
||||
}
|
||||
|
||||
EditorConsoleSink::EditorConsoleSink() = default;
|
||||
EditorConsoleSink::EditorConsoleSink() {
|
||||
s_instance = this;
|
||||
}
|
||||
|
||||
EditorConsoleSink::~EditorConsoleSink() = default;
|
||||
EditorConsoleSink::~EditorConsoleSink() {
|
||||
if (s_instance == this) {
|
||||
s_instance = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorConsoleSink::Log(const LogEntry& entry) {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
@@ -26,7 +34,8 @@ void EditorConsoleSink::Log(const LogEntry& entry) {
|
||||
void EditorConsoleSink::Flush() {
|
||||
}
|
||||
|
||||
const std::vector<LogEntry>& EditorConsoleSink::GetLogs() const {
|
||||
std::vector<LogEntry> EditorConsoleSink::GetLogs() const {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_logs;
|
||||
}
|
||||
|
||||
@@ -40,4 +49,4 @@ void EditorConsoleSink::SetCallback(std::function<void()> callback) {
|
||||
}
|
||||
|
||||
} // namespace Debug
|
||||
} // namespace XCEngine
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user