Skip to content
Snippets Groups Projects
Commit bfbba1a4 authored by bonkt's avatar bonkt
Browse files

[BUILD] Ecs is now Shared library

parent 24daa13d
No related branches found
No related tags found
No related merge requests found
......@@ -32,9 +32,9 @@
[
{
"pos": {
"x": 0.023000001907348633,
"y": 23.0,
"z": -0.023000001907348633
"x": 0.01600000075995922,
"y": 16.0,
"z": -0.01600000075995922
},
"s": {
"x": 1.0,
......@@ -50,9 +50,9 @@
},
{
"pos": {
"x": 0.023000001907348633,
"y": 23.0,
"z": -0.023000001907348633
"x": 0.01600000075995922,
"y": 16.0,
"z": -0.01600000075995922
},
"s": {
"x": 1.0,
......@@ -85,9 +85,9 @@
[
{
"pos": {
"x": 0.023000001907348633,
"y": 23.0,
"z": -0.023000001907348633
"x": 0.01600000075995922,
"y": 16.0,
"z": -0.01600000075995922
},
"s": {
"x": 1.0,
......
......@@ -72,7 +72,7 @@ struct ArchTable {
// special constructor for prexisting DenseTable:
ArchRow count() const;
ECS_API ArchRow count() const;
DenseTable& getDense() {
return *dense_table;
......
......@@ -20,7 +20,7 @@ SET(ECS_SOURCES
# Make into shared:
add_library(Ecs STATIC ${ECS_SOURCES})
add_library(Ecs SHARED ${ECS_SOURCES})
target_compile_definitions(Ecs
PRIVATE
......
......@@ -35,7 +35,7 @@ enum class IdFlags : u8 {
CX_DEFINE_ENUM_BIT_FLAG(IdFlags);
struct IdIndex {
struct ECS_API IdIndex {
u32 index;
IdIndex(const EcsId& id);
......@@ -55,7 +55,7 @@ struct IdIndex {
* Can be an entity(component) or a pair.
* Contains flags, generation, and index.
*/
struct EcsId {
struct ECS_API EcsId {
#ifdef SPEC_DEBUG
const char* debug_str = nullptr;
......@@ -124,11 +124,11 @@ struct EcsId {
return (static_cast<u8>(flags_) & mask) != 0;
}
struct Hash {
struct ECS_API Hash {
u64 operator()(const EcsId& id) const;
};
struct IdRegisterHash {
struct ECS_API IdRegisterHash {
u64 operator()(const EcsId& id) const;
};
......@@ -190,7 +190,7 @@ const EcsId ID_EcsModule = EcsId(6).setFlags(IdFlags::DenseTag);
// fmt
namespace fmt {
template <>
struct formatter<cx::EcsId> : formatter<u64> {
struct ECS_API formatter<cx::EcsId> : formatter<u64> {
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx) {
return ctx.begin();
......
......@@ -66,7 +66,7 @@ private:
class EcsIterator : public impl::EcsIterator {
class ECS_API EcsIterator : public impl::EcsIterator {
public:
EcsIterator(const impl::EcsIterator& iter) : impl::EcsIterator(iter) {}
......
......@@ -19,7 +19,7 @@ class World;
class Query;
struct EcsIterator {
struct ECS_API EcsIterator {
EcsIterator(World* world, Query* query);
......
......@@ -23,7 +23,7 @@ struct Archetype;
*/
// TODO: inherit from EcsId ??
struct Entity {
struct ECS_API Entity {
friend struct World;
......
......@@ -11,7 +11,7 @@ namespace cx {
struct EcsIterator;
struct Query : impl::Query {
struct ECS_API Query : impl::Query {
Query() = default;
......
......@@ -23,7 +23,7 @@ struct ArchTable;
/**
* A query is just a filter with a cache of arch_tables stored in its world.
*/
struct Query {
struct ECS_API Query {
friend class ::cx::EcsIterator;
friend class EcsIterator;
......
......@@ -44,7 +44,7 @@ bool cxLoadPlugin(cx::PluginContext* plugin) {
while (ctx.ecs_it->nextTable()) {
for (auto [transform, name] : ctx.ecs_it->fields<EcsTransform&, EcsName&>()) {
transform.pos += vec3f(0.001, 1, -0.001);
PLUGIN_INFO("(Ppppp: {}): {}", name.name, transform.pos.str());
PLUGIN_INFO("(:AAAA {}): {}", name.name, transform.pos.str());
std::this_thread::sleep_for(std::chrono::milliseconds(400));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment