Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vblanco20-1 committed Jun 29, 2024
1 parent 84eb90f commit 3e0a9a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target_include_directories(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

option(BUILD_TESTING "Enable testing with ctest." ON)
option(BUILD_TESTING "Enable testing with ctest." OFF)


if(BUILD_TESTING)
Expand All @@ -34,7 +34,7 @@ if(BUILD_TESTING)
FetchContent_Declare(googletest
#ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
GIT_TAG main
SOURCE_DIR "${GOOGLETEST_DEPS_DIR}/src"
BINARY_DIR "${GOOGLETEST_DEPS_DIR}/build"
CONFIGURE_COMMAND ""
Expand Down
9 changes: 7 additions & 2 deletions src/decs.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ namespace decs {
data = (T*)pointer;
chunkOwner = owner;
index = cindex;
bitf = reinterpret_cast<uint64_t*>(data + chunkOwner->chunk_headers->componentList->chunkCapacity);
if constexpr (std::is_same_v<T, EntityID>) {
bitf = reinterpret_cast<uint64_t*>(data + chunkOwner->chunk_headers->componentList->chunkCapacity);
}
else {
bitf = nullptr;
}
}

const T& operator[](size_t index) const {
Expand Down Expand Up @@ -1314,7 +1319,7 @@ namespace decs {
uint64_t separator = get_entity_separator(world,id);
Archetype* oldarch = get_entity_archetype(world, id);

Archetype* newarch = make_archetype_by_adding_component(oldarch, type);
Archetype* newarch = make_archetype_by_removing_component(oldarch, type);

set_entity_archetype(newarch, id,separator);
}
Expand Down
2 changes: 1 addition & 1 deletion test/base_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST(Basic, NullEntities)

int count = 0;
for (auto chnk : world.archetypes[0]->chunks) {
count += chnk->header.last;
count += chnk.chunk->header()->alive;
}
EXPECT_EQ(count, 1000);
}
Expand Down

0 comments on commit 3e0a9a5

Please sign in to comment.