Skip to content

Commit

Permalink
Merge branch 'develop/premake' of https://github.com/Rythe-Interactiv…
Browse files Browse the repository at this point in the history
…e/Rythe-Core into develop/premake
  • Loading branch information
GlynLeine committed Sep 22, 2023
2 parents 625cc24 + 111771e commit 80c14a0
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 31 deletions.
10 changes: 10 additions & 0 deletions src/core/async/async.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
#include "core/async/async_operation.hpp"
#include "core/async/async_runnable.hpp"
#include "core/async/job_pool.hpp"
#include "core/async/lock_guard.hpp"
#include "core/async/ring_sync_lock.hpp"
#include "core/async/rw_spinlock.hpp"
#include "core/async/spinlock.hpp"
#include "core/async/thread_util.hpp"
#include "core/async/wait_priority.hpp"
7 changes: 4 additions & 3 deletions src/core/async/rw_spinlock.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <core/async/rw_spinlock.hpp>
#include <sstream>

#include "core/async/rw_spinlock.hpp"

namespace rythe::core::async
{
bool rw_spinlock::m_forceRelease = false;
Expand Down Expand Up @@ -231,7 +232,7 @@ namespace rythe::core::async
if (m_forceRelease)
return;

assert_msg("Attempted to move a rw_spinlock that was locked.", source.m_lockState.load(std::memory_order_relaxed) == static_cast<int>(lock_state::idle));
rsl_assert_msg(source.m_lockState.load(std::memory_order_relaxed) == static_cast<int>(lock_state::idle), "Attempted to move a rw_spinlock that was locked.");
m_id = source.m_id;
}

Expand All @@ -240,7 +241,7 @@ namespace rythe::core::async
if (m_forceRelease)
return *this;

assert_msg("Attempted to move a rw_spinlock that was locked.", source.m_lockState.load(std::memory_order_relaxed) == static_cast<int>(lock_state::idle));
rsl_assert_msg(source.m_lockState.load(std::memory_order_relaxed) == static_cast<int>(lock_state::idle), "Attempted to move a rw_spinlock that was locked.");
m_id = source.m_id;
return *this;
}
Expand Down
7 changes: 4 additions & 3 deletions src/core/async/rw_spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#include <array>
#include <thread>
#include <functional>

#include <rsl/primitives>
#include <rsl/type_util>
#include <core/containers/sparse_set.hpp>
#include <core/common/assert.hpp>
#include <core/async/wait_priority.hpp>
#include <rsl/containers>

#include "core/async/wait_priority.hpp"

/**
* @file rw_spinlock.hpp
Expand Down
4 changes: 2 additions & 2 deletions src/core/async/spinlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace rythe::core::async
if (m_forceRelease)
return;

assert_msg("Attempted to move a spinlock that was locked.", !source.m_lock.load(std::memory_order_relaxed));
rsl_assert_msg("Attempted to move a spinlock that was locked.", !source.m_lock.load(std::memory_order_relaxed));
m_id = source.m_id;
}

Expand All @@ -25,7 +25,7 @@ namespace rythe::core::async
if (m_forceRelease)
return *this;

assert_msg("Attempted to move a spinlock that was locked.", !source.m_lock.load(std::memory_order_relaxed));
rsl_assert_msg("Attempted to move a spinlock that was locked.", !source.m_lock.load(std::memory_order_relaxed));
m_id = source.m_id;
return *this;
}
Expand Down
2 changes: 0 additions & 2 deletions src/core/async/spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <rsl/type_util>
#include <rsl/logging>

#include "core/common/assert.hpp"

/**@file spinlock.hpp
*/

Expand Down
2 changes: 1 addition & 1 deletion src/core/common/managed_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <type_traits>

#include <rsl/delegate>
#include <rsl/utilities>

#include "core/common/assert.hpp"
#include "core/async/rw_spinlock.hpp"

namespace rythe::core::common
Expand Down
2 changes: 1 addition & 1 deletion src/core/compute/buffer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "detail/cl_include.hpp" // cl_context , cl_mem , cl_mem_flags
#include <cl_platform.h>// cl_context , cl_mem , cl_mem_flags
#include <rsl/primitives> // rsl::byte, size_t

#include <string> // string
Expand Down
3 changes: 3 additions & 0 deletions src/core/data/data.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once
#include "core/data/mesh.hpp"
#include "core/data/image.hpp"
16 changes: 8 additions & 8 deletions src/core/defaults/coremodule.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once
#include <core/engine/module.hpp>
#include <core/engine/module.inl>
#include <core/data/loaders/objmeshloader.hpp>
#include <core/data/loaders/gltfmeshloader.hpp>
#include <core/data/loaders/stbimageloader.hpp>
#include <core/filesystem/provider_registry.hpp>
#include <core/filesystem/basic_resolver.hpp>
#include <core/compute/context.hpp>
#include "core/engine/module.hpp"
#include "core/engine/module.inl"
#include "core/data/loaders/objmeshloader.hpp"
#include "core/data/loaders/gltfmeshloader.hpp"
#include "core/data/loaders/stbimageloader.hpp"
#include "core/filesystem/provider_registry.hpp"
#include "core/filesystem/basic_resolver.hpp"
//#include <core/compute/context.hpp>

/**
* @file coremodule.hpp
Expand Down
12 changes: 6 additions & 6 deletions src/core/ecs/containers/component_pool.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#pragma once
#include <rsl/type_util>
#include <rsl/primitives>
#include <core/containers/sparse_map.hpp>
#include <core/events/events.hpp>

#include <core/ecs/prototypes/component_prototype.hpp>
#include <core/ecs/containers/component_container.hpp>
#include <core/ecs/handles/entity.hpp>
#include <core/ecs/filters/filterregistry.hpp>
#include "core/containers/sparse_map.hpp"
#include "core/events/events.hpp"
#include "core/ecs/prototypes/component_prototype.hpp"
#include "core/ecs/containers/component_container.hpp"
#include "core/ecs/handles/entity.hpp"
#include "core/ecs/filters/filterregistry.hpp"

/**
* @file component_pool.hpp
Expand Down
8 changes: 8 additions & 0 deletions src/core/ecs/ecs.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include "core/ecs/registry.hpp"
#include "core/ecs/filters/filterregistry.hpp"
#include "core/ecs/data/entity_data.hpp"
#include "core/ecs/handles/component.hpp"
#include "core/ecs/handles/entity.hpp"
#include "core/ecs/handles/filter.hpp"
4 changes: 4 additions & 0 deletions src/core/events/events.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
#include "core/events/defaultevents.hpp"
#include "core/events/event.hpp"
#include "core/events/eventbus.hpp"
6 changes: 3 additions & 3 deletions src/core/filesystem/filemanip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <rsl/type_util> // R_NODISCARD
#include <rsl/primitives> // rsl::byte, rsl::byte_vec
#include "core/common/assert.hpp" // assert_msg
#include <rsl/utilities> // rsl_assert_msg



Expand Down Expand Up @@ -39,7 +39,7 @@ namespace rythe::core::filesystem {
{
std::ifstream file(path.data(), std::ios::ate | std::ios::binary);

assert_msg("could not open file", file.is_open());
rsl_assert_msg("could not open file", file.is_open());

size_t fileSize = (size_t)file.tellg();
rsl::byte_vec buffer(fileSize);
Expand All @@ -66,7 +66,7 @@ namespace rythe::core::filesystem {
fclose
);

assert_msg("could not open file",file);
rsl_assert_msg("could not open file",file);

// read data
fwrite(container.data(),sizeof(rsl::byte),container.size(),file.get());
Expand Down
4 changes: 2 additions & 2 deletions src/core/scheduling/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace rythe::core::scheduling
reportDependency<events::EventBus>();
reportDependency<Clock>();

rsl::delegate<void(events::exit)> del;
rsl::delegate<void(events::exit&)> del;

del = [](events::exit evnt)
del = [](events::exit& evnt)
{
instance.m_exitFromEvent.store(true, std::memory_order_release);
Scheduler::exit(evnt.exitcode);
Expand Down

0 comments on commit 80c14a0

Please sign in to comment.