Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0a91703
Update IBT and readme.
Dandielo Feb 13, 2023
9e29078
Extended some container API's
Dandielo Feb 28, 2023
8b4c1b8
Updated IBT to version 1.2.4
Dandielo Feb 28, 2023
6dd9f78
Moved around string utility functions.
Dandielo Feb 28, 2023
234921c
Initial implementation of the updated Task API
Dandielo Feb 28, 2023
fc928cb
Updated scripts for IBT 1.4.0
Dandielo Apr 15, 2023
03a6c0e
Updated tests after updating to Catch2 v3
Dandielo Apr 17, 2023
0a46b00
Fixed atomic linked queue 'push' declaration.
Dandielo Apr 17, 2023
2667f1b
Fixed 'stringid_hint' function.
Dandielo Apr 17, 2023
d1d2158
Cleaning up the Task library.
Dandielo Apr 29, 2023
5c32b9c
Cleaned up namig of Task library.
Dandielo Apr 29, 2023
1253849
Updating all code after changes to 'Task', 'Resource' and 'Asset' lib…
Dandielo Apr 29, 2023
5a730a9
Refactored 'task' utility functions.
Dandielo May 1, 2023
b7cba38
Exetned utility functions for tasks.
Dandielo May 1, 2023
1d0af7f
More changes to AssetStorage
Dandielo May 6, 2023
62af6ff
Remove last remaining values from MSVC coro bug.
Dandielo May 7, 2023
7aaaf84
More fixes to thread pools.
Dandielo May 9, 2023
c0dcb3f
Moved 'path' utils.
Dandielo May 9, 2023
9d6120a
Refactoring entry points.
Dandielo May 9, 2023
5b2b003
Move application project.
Dandielo May 9, 2023
254221c
Fixing non-unity builds.
Dandielo May 9, 2023
9e4e3e1
Small changes
Dandielo May 9, 2023
8fd2929
Cleaned up frame scheduling API.
Dandielo May 11, 2023
225c288
Detect conan profiles.
Dandielo May 13, 2023
29e612a
See if '@head' works for workflow selection.
Dandielo May 13, 2023
5b2f96e
Can't use 'HEAD' as workflow selection.
Dandielo May 13, 2023
52a3f8b
Addressing some issues found during the review.
Dandielo May 13, 2023
b4e87df
Updating 3rdparty license information.
Dandielo May 13, 2023
79fc8f0
Updating source code license headers.
Dandielo May 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/workflows/cw_build_parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
pip3 install wheel
pip3 install conan
conan config install https://github.com/iceshard-engine/conan-config.git
conan profile detect

- name: Install tools (GCC 12)
if: ${{ startsWith(inputs.host, 'ubuntu') }}
Expand All @@ -63,7 +64,7 @@ jobs:
shell: pwsh
run: |
.\tools\gh_ice.ps1 init

- name: Build targets
shell: pwsh
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cw_build_single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
pip3 install wheel
pip3 install conan
conan config install https://github.com/iceshard-engine/conan-config.git
conan profile detect

- name: Install tools (GCC 12)
if: ${{ startsWith(inputs.host, 'ubuntu') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
name: 'Build (Windows)'
needs: setup_workflow
if: ${{ contains(needs.setup_workflow.outputs.tags, 'parallel') == false }}
uses: iceshard-engine/engine/.github/workflows/cw_build_single.yaml@master
uses: iceshard-engine/engine/.github/workflows/cw_build_single.yaml@ms-2303010415
with:
host: windows-latest
configs: ${{ needs.setup_workflow.outputs.build_configs }}
Expand All @@ -76,7 +76,7 @@ jobs:
name: 'Build (Linux)'
needs: setup_workflow
if: ${{ contains(needs.setup_workflow.outputs.tags, 'parallel') == false }}
uses: iceshard-engine/engine/.github/workflows/cw_build_single.yaml@master
uses: iceshard-engine/engine/.github/workflows/cw_build_single.yaml@ms-2303010415
with:
host: ubuntu-22.04
configs: ${{ needs.setup_workflow.outputs.build_configs }}
Expand All @@ -92,7 +92,7 @@ jobs:
name: 'Build (Windows), Parallel'
needs: setup_workflow
if: ${{ contains(needs.setup_workflow.outputs.tags, 'parallel') == true }}
uses: iceshard-engine/engine/.github/workflows/cw_build_parallel.yaml@master
uses: iceshard-engine/engine/.github/workflows/cw_build_parallel.yaml@ms-2303010415
with:
host: windows-latest
configs: ${{ needs.setup_workflow.outputs.build_configs }}
Expand All @@ -104,7 +104,7 @@ jobs:
name: 'Build (Linux), Parallel'
needs: setup_workflow
if: ${{ contains(needs.setup_workflow.outputs.tags, 'parallel') == true }}
uses: iceshard-engine/engine/.github/workflows/cw_build_parallel.yaml@master
uses: iceshard-engine/engine/.github/workflows/cw_build_parallel.yaml@ms-2303010415
with:
host: ubuntu-22.04
configs: ${{ needs.setup_workflow.outputs.build_configs }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Local data
/source/data/temp
/source/data/local
/tools/scripts/generate_version.moon

# Temporary files to ignore
compile_commands.json
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
> Development on the engine is going to be paused for the time beeing, due to lots of changes outside the webz.
> Dandielo

# IceShard

A small game engine project with the sole purpose to learn, improve and invent.
Expand Down
23 changes: 18 additions & 5 deletions ice.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ IF NOT EXIST build\tools\ (
CALL :_initialize
)

IF NOT EXIST build\tools\activate.bat (
IF NOT EXIST build\tools\conanrun.bat (
ECHO Rebuilding enviroment...
CALL :_initialize
)
Expand All @@ -29,6 +29,10 @@ IF "%1" == "init" (
GOTO :_exit
)

IF "%1" == "script" (
GOTO :_run_mini
)

:: Move to the application
GOTO :_run

Expand All @@ -49,21 +53,30 @@ GOTO :_exit
:: Initialize the project environment
:_initialize
PUSHD build\tools
conan install ..\..\tools --build=missing --profile %CONAN_PROFILE%
conan install ..\..\tools -of . --build=missing --profile %CONAN_PROFILE%
POPD
ECHO Workspace initialized...
GOTO :_exit

:: Application runtime
:_run
CALL build\tools\activate.bat
:_run_mini
CALL build\tools\conanrunenv_mini.bat
CALL "%ICE_SCRIPT%" workspace.moon %*

:: Save this value as it so the call to 'deactivate' wont erase it in some caes
set ERROR_CODE=%ERRORLEVEL%
CALL build\tools\deactivate_conanrun.bat

GOTO :_errcheck

CALL build\tools\deactivate.bat
:_run
CALL build\tools\conanrun.bat
CALL "%ICE_SCRIPT%" workspace.moon %*
:: Save this value as it so the call to 'deactivate' wont erase it in some caes
set ERROR_CODE=%ERRORLEVEL%
CALL build\tools\deactivate_conanrun.bat

:_errcheck
:: Check the command return code
IF "%ERROR_CODE%" == "0" (
GOTO :_exit
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/collections/collections.bff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

.Project =
Expand Down
2 changes: 1 addition & 1 deletion source/code/core/collections/collections_tests.bff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

.Project =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down Expand Up @@ -47,12 +47,18 @@ namespace ice
inline auto values(ice::HashMap<Type, Logic>& map) noexcept -> ice::Span<Type>;


template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline auto count(HashMapType const& map) noexcept -> ice::ucount;

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool full(HashMapType const& map) noexcept;

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool empty(HashMapType const& map) noexcept;

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool any(HashMapType const& map) noexcept;

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool has(HashMapType const& map, ice::u64 key) noexcept;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

namespace ice
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

namespace ice
Expand Down Expand Up @@ -639,6 +639,15 @@ namespace ice
}
}

template<typename Type, ice::ContainerLogic Logic>
inline auto try_get(ice::HashMap<Type, Logic>& map, ice::u64 key) noexcept -> Type*
{
ice::ucount const index = ice::hashmap::detail::find_or_fail(map, key);
return index == ice::hashmap::detail::Constant_EndOfList
? nullptr
: map._data + index;
}

template<typename Type, ice::ContainerLogic Logic>
inline void remove(ice::HashMap<Type, Logic>& map, ice::u64 key) noexcept
{
Expand All @@ -652,6 +661,13 @@ namespace ice
}



template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline auto count(HashMapType const& map) noexcept -> ice::ucount
{
return map._count;
}

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool full(HashMapType const& map) noexcept
{
Expand All @@ -667,6 +683,12 @@ namespace ice
return map._count == 0;
}

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool any(HashMapType const& map) noexcept
{
return ice::hashmap::empty(map) == false;
}

template<typename HashMapType> requires HashMapReadAccess<HashMapType>
inline bool has(HashMapType const& map, ice::u64 key) noexcept
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

namespace ice
Expand Down Expand Up @@ -120,8 +120,8 @@ namespace ice
return std::atomic_load_explicit(&queue._head, std::memory_order_relaxed) == nullptr;
}

template<typename NodeType>
inline void push(ice::AtomicLinkedQueue<NodeType>& queue, NodeType* node) noexcept
template<typename NodeType, typename DerivedNodeType>
inline void push(ice::AtomicLinkedQueue<NodeType>& queue, DerivedNodeType* node) noexcept
{
NodeType* const previous_tail = std::atomic_exchange_explicit(
&queue._tail, node, std::memory_order_relaxed
Expand Down Expand Up @@ -185,7 +185,7 @@ namespace ice
NodeType* previous = std::atomic_exchange_explicit(
&queue._head, result->next, std::memory_order_relaxed
);
assert(previous == nullptr);
ICE_ASSERT_CORE(previous == nullptr);
}
}
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

namespace ice
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down Expand Up @@ -76,8 +76,8 @@ namespace ice
template<typename NodeType>
inline bool empty(ice::AtomicLinkedQueue<NodeType> const& queue) noexcept;

template<typename NodeType>
inline void push(ice::AtomicLinkedQueue<NodeType>& queue, NodeType* node) noexcept;
template<typename NodeType, typename DerivedNodeType = NodeType>
inline void push(ice::AtomicLinkedQueue<NodeType>& queue, DerivedNodeType* node) noexcept;

template<typename NodeType>
inline auto pop(ice::AtomicLinkedQueue<NodeType>& queue) noexcept -> NodeType*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
59 changes: 58 additions & 1 deletion source/code/core/collections/public/ice/sort.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand All @@ -18,6 +18,9 @@ namespace ice
template<typename K, typename V, typename Pred>
inline void sort(ice::Span<K> keys, ice::Span<V> values, Pred&& pred) noexcept;

template<typename Node, typename Pred>
inline auto sort_linked_list(Node* left_list, ice::u32 size, Pred&& pred) noexcept -> Node*;

namespace detail
{

Expand Down Expand Up @@ -84,4 +87,58 @@ namespace ice
ice::detail::qsort(keys, values, std::forward<Pred>(pred), first_index, last_index);
}

template<typename Node, typename Pred>
inline auto sort_linked_list(Node* left_list, ice::u32 size, Pred&& pred) noexcept -> Node*
{
Node* right_list = left_list;
if (size == 1)
{
left_list->next = nullptr;
return left_list;
}
else if (size == 2)
{
right_list = right_list->next;
right_list->next = nullptr;
left_list->next = nullptr;
}
else
{
uint32_t const half_size = size / 2;
for (uint32_t idx = half_size; idx > 0; --idx)
{
right_list = right_list->next;
}

Node* next = right_list->next;
right_list->next = nullptr;
right_list = next;

left_list = ice::sort_linked_list(left_list, half_size + 1, pred);
right_list = ice::sort_linked_list(right_list, size - (half_size + 1), pred);
}

Node result{ .next = left_list }; // Keep the head of the list
left_list = &result;
while (left_list->next != nullptr && right_list != nullptr)
{
Node* temp = left_list->next;
if (pred(*temp, *right_list) == false) // TRUE == IS OKAY, FALSE == NEEDS SWAP
{
// We swapped the whole lists...
left_list->next = right_list;
right_list = temp;
}

// We can advance the left list
left_list = left_list->next;
}

// Attach the rest of the right list
left_list->next = right_list;

// Return the 'next' element of the result.
return result.next;
}

} // namespace ice
2 changes: 1 addition & 1 deletion source/code/core/collections/public/ice/span.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2022 - 2022, Dandielo <dandielo@iceshard.net>
/// Copyright 2022 - 2023, Dandielo <dandielo@iceshard.net>
/// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Loading