Fix editor scene persistence and XC scene workflow
This commit is contained in:
@@ -6,24 +6,30 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Editor {
|
||||
|
||||
template<typename T>
|
||||
struct EventTypeId {
|
||||
static uint32_t Get() {
|
||||
static const uint32_t id = s_nextId++;
|
||||
return id;
|
||||
class EventTypeRegistry {
|
||||
public:
|
||||
static uint32_t NextId() {
|
||||
return s_nextId.fetch_add(1, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
private:
|
||||
static uint32_t s_nextId;
|
||||
inline static std::atomic<uint32_t> s_nextId{0};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
uint32_t EventTypeId<T>::s_nextId = 0;
|
||||
struct EventTypeId {
|
||||
static uint32_t Get() {
|
||||
static const uint32_t id = EventTypeRegistry::NextId();
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
||||
class EventBus {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user