Skip to content

Commit 7fba5e9

Browse files
Merge pull request #159 from JacobDomagala/151-v003-release
[#151]: `v0.0.3` release
2 parents 0be5072 + 17ea5b8 commit 7fba5e9

24 files changed

+155
-110
lines changed

.github/workflows/code_quality.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ jobs:
1818
echo "#!/bin/bash
1919
root_dir=\${1}
2020
build_dir=\${2}
21-
pip install conan==1.59.0 --break-system-packages
22-
conan install \$root_dir --install-folder=build --build=missing --settings=build_type=Release -c tools.system.package_manager:mode=install
21+
pip install conan --break-system-packages
22+
conan profile detect
23+
conan install \$root_dir --output-folder=build --build=missing --settings=build_type=Release -c tools.system.package_manager:mode=install
2324
wget https://sdk.lunarg.com/sdk/download/1.3.216.0/linux/vulkansdk-linux-x86_64-1.3.216.0.tar.gz
24-
tar xf vulkansdk-linux-x86_64-1.3.216.0.tar.gz -C \$root_dir/dependencies
25-
source \$root_dir/dependencies/1.3.216.0/setup-env.sh" > init_script.sh
25+
mkdir vulkan
26+
tar xf vulkansdk-linux-x86_64-1.3.216.0.tar.gz -C \$root_dir/vulkan
27+
source \$root_dir/vulkan/1.3.216.0/setup-env.sh" > init_script.sh
2628
2729
- name: Run static analysis
2830
uses: JacobDomagala/StaticAnalysis@master
2931
with:
30-
exclude_dir: dependencies
32+
cmake_args: -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
33+
exclude_dir: vulkan
3134
init_script: init_script.sh
3235
apt_pckgs: xorg-dev python3-pip
3336
verbose: true

.github/workflows/ubuntu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev \
2929
libxcb-util-dev libxcb-cursor-dev
3030
31-
pip install conan==1.59.0
31+
pip install conan
3232
3333
wget https://sdk.lunarg.com/sdk/download/$SDK_VERSION/linux/vulkansdk-linux-x86_64-$SDK_VERSION.tar.gz
3434
tar xf vulkansdk-linux-x86_64-$SDK_VERSION.tar.gz
@@ -46,8 +46,7 @@ jobs:
4646
working-directory: ${{runner.workspace}}/build
4747
run: |
4848
# Use newer ABI
49-
conan profile new default --detect
50-
conan profile update settings.compiler.libcxx=libstdc++11 default
49+
conan profile detect
5150
conan install $GITHUB_WORKSPACE --output-folder=build --build=missing --settings=build_type=$BUILD_TYPE
5251
5352
- name: Run CMake
@@ -56,7 +55,8 @@ jobs:
5655
run: |
5756
source ${{runner.workspace}}/Looper/$SDK_VERSION/setup-env.sh
5857
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWARNINGS_AS_ERRORS=ON -DENABLE_INCLUDE_WHAT_YOU_USE=OFF\
59-
-DENABLE_SANITIZER_ADDRESS=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=OFF -DENABLE_SANITIZER_LEAK=ON -DUNITY_BUILD=ON
58+
-DENABLE_SANITIZER_ADDRESS=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=OFF -DENABLE_SANITIZER_LEAK=ON -DUNITY_BUILD=ON\
59+
-DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
6060
6161
- name: Build
6262
working-directory: ${{runner.workspace}}/build

.github/workflows/windows.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
- name: Install Conan
4040
id: conan
4141
uses: turtlebrowser/get-conan@main
42-
with:
43-
version: 1.59.0
4442

4543
- name: Cache Conan packages
4644
id: cache-conan
@@ -60,7 +58,7 @@ jobs:
6058
run: |
6159
$env:VULKAN_SDK="$env:VULKAN_DIR\$env:SDK_VERSION"
6260
63-
cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE
61+
cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${{runner.workspace}}\build\build\conan_toolchain.cmake
6462
cmake --build . --config $env:BUILD_TYPE > output.txt
6563
cat output.txt
6664

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,5 @@ dependencies/glfw/glfw*
318318
*imgui.ini
319319
/CMakeSettings.json
320320
*.cache/*
321-
compile_commands.json
321+
compile_commands.json
322+
CMakeUserPresets.json

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3636

3737
include(cmake/util_functions.cmake)
3838

39-
add_subdirectory(dependencies)
4039
add_subdirectory(engine)
4140
add_subdirectory(game)
4241
add_subdirectory(editor)
@@ -47,4 +46,4 @@ compile_shader(SOURCE_FILE "${SHADERS_PATH}/default.frag" OUTPUT_FILE_NAME "${S
4746
compile_shader(SOURCE_FILE "${SHADERS_PATH}/ui.vert" OUTPUT_FILE_NAME "${SHADERS_PATH}/ui.vert.spv")
4847
compile_shader(SOURCE_FILE "${SHADERS_PATH}/ui.frag" OUTPUT_FILE_NAME "${SHADERS_PATH}/ui.frag.spv")
4948
compile_shader(SOURCE_FILE "${SHADERS_PATH}/line.vert" OUTPUT_FILE_NAME "${SHADERS_PATH}/line.vert.spv")
50-
compile_shader(SOURCE_FILE "${SHADERS_PATH}/line.frag" OUTPUT_FILE_NAME "${SHADERS_PATH}/line.frag.spv")
49+
compile_shader(SOURCE_FILE "${SHADERS_PATH}/line.frag" OUTPUT_FILE_NAME "${SHADERS_PATH}/line.frag.spv")

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# Looper
55
Looper is a game engine with an integrated editor and a 2D type game with a level editor, all written in modern C++20. It uses Vulkan for rendering and ImGui/glfw3 for UI and window/input handling. The project is compatible with Ubuntu and Windows.
66

7-
8-
[![Watch the video](https://raw.githubusercontent.com/wiki/JacobDomagala/Looper/Looper_github.gif)](https://www.youtube.com/watch?v=Qh-vOKMPQGQ)
7+
![gif](https://raw.githubusercontent.com/wiki/JacobDomagala/Looper/Looper_github.gif)
98

109
## Requirements
1110
- C++20 compatible compiler (e.g. GCC, Clang, MSVC)
@@ -22,9 +21,6 @@ The typical build process would look like this:
2221
# Create build directory
2322
mkdir build && cd build
2423

25-
# Use newer ABI
26-
conan profile new default --detect
27-
conan profile update settings.compiler.libcxx=libstdc++11 default
2824
conan install .. --output-folder=build --build=missing --settings=build_type=Release
2925

3026
# Generate build system for Windows/Linux
@@ -43,5 +39,9 @@ cmake --build .
4339
## Contributing
4440
If you would like to contribute to the project, please fork the repository and submit a pull request with your proposed changes. We welcome any improvements or new features that enhance the functionality and user experience of Looper.
4541

42+
## Youtube
43+
For past and future video logs, please visit my [Youtube](https://www.youtube.com/watch?v=Qh-vOKMPQGQ&list=PLRLVUsGGaSH-s0A_2w_eo2LQEfTZuqi7Y) channel. <br>
44+
[![Playlist](https://img.youtube.com/vi/cyZFLKrvoPc/0.jpg)](https://www.youtube.com/watch?v=cyZFLKrvoPc&list=PLRLVUsGGaSH-s0A_2w_eo2LQEfTZuqi7Y "YouTube Playlist")
45+
4646
## License
4747
Please refer to the LICENSE file in the repository for details on the licensing of this project.

conanfile.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
fmt/10.1.0
55
glfw/3.3.8
66
imgui/1.89.9
7-
stb/20200203
7+
stb/cci.20230920
88
glm/0.9.9.8
99
nlohmann_json/3.11.2
1010

1111
[generators]
12-
cmake_find_package_multi
13-
cmake
12+
CMakeToolchain
13+
CMakeDeps

dependencies/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

dependencies/stb_image/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

editor/editor.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ Editor::Render(VkCommandBuffer cmdBuffer)
593593
const auto idx = static_cast< size_t >(layer);
594594
const auto& numObjects = renderData.numMeshes.at(idx);
595595
const auto renderThisLayer = renderLayerToDraw_ == -1 ? true : renderLayerToDraw_ == layer;
596-
596+
597597
if (numObjects == 0 or !renderThisLayer)
598598
{
599599
continue;
@@ -804,6 +804,8 @@ Editor::CreateLevel(const std::string& name, const glm::ivec2& size)
804804
m_levelFileName = (LEVELS_DIR / (name + ".dgl")).string();
805805
gui_.LevelLoaded(m_currentLevel);
806806

807+
m_currentLevel->GenerateTextureForCollision();
808+
807809
SetupRendererData();
808810
}
809811

@@ -1037,14 +1039,20 @@ Editor::Update()
10371039

10381040
if (m_animateGameObject && m_currentSelectedGameObject)
10391041
{
1040-
auto moveBy = std::dynamic_pointer_cast< Animatable >(m_currentSelectedGameObject)
1041-
->SingleAnimate(m_deltaTime);
1042+
const auto& animatable = std::dynamic_pointer_cast< Animatable >(m_currentSelectedGameObject);
1043+
auto moveBy = animatable->SingleAnimate(deltaTime_);
10421044

10431045
if (glm::length(moveBy) > 0.0f)
10441046
{
1047+
const auto prevPosition = m_currentSelectedGameObject->GetPreviousPosition();
1048+
const auto direction = m_currentSelectedGameObject->GetPosition() - prevPosition;
1049+
1050+
const auto viewAngle = glm::atan(direction.y, direction.x);
1051+
1052+
m_currentSelectedGameObject->Rotate(viewAngle);
10451053
m_currentSelectedGameObject->Move(moveBy);
10461054
}
1047-
else
1055+
else if (animatable->AnimationFinished())
10481056
{
10491057
m_animateGameObject = false;
10501058
}
@@ -1123,6 +1131,8 @@ Editor::MainLoop()
11231131
while (IsRunning() and (singleFrameTimer.count() >= TARGET_TIME_MICRO))
11241132
{
11251133
const time::ScopedTimer frameTimer(&timeLastFrame_);
1134+
1135+
deltaTime_ = m_timer.GetMsDeltaTime();
11261136
InputManager::PollEvents();
11271137

11281138
// Run all deffered work units
@@ -1159,6 +1169,8 @@ Editor::MainLoop()
11591169
{
11601170
LaunchGameLoop();
11611171
}
1172+
1173+
m_timer.ToggleTimer();
11621174
}
11631175
}
11641176
}

0 commit comments

Comments
 (0)