Skip to content

Commit 8961262

Browse files
committed
2 parents f7be919 + 9b8a3bf commit 8961262

File tree

280 files changed

+12634
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+12634
-691
lines changed

.gitlab/.gitlab-ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.job_rules_template: &job_rules
2+
stage: build
3+
rules:
4+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"
5+
&& $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
6+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"
7+
&& $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "upstream"'
8+
9+
build_in_mac:
10+
tags:
11+
- mac
12+
- shell
13+
<<: *job_rules
14+
script:
15+
- ./build_macos.sh release
16+
17+
build_in_ubuntu:
18+
image: cmake:3.23 # you can build it with Dockerfile offered in this project
19+
tags:
20+
- ubuntu
21+
- docker
22+
<<: *job_rules
23+
script:
24+
- ./build_linux.sh release
25+
26+
build_in_windows:
27+
tags:
28+
- windows
29+
- shell
30+
<<: *job_rules
31+
script:
32+
- ./build_windows.bat
33+

.gitlab/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:20.04
2+
RUN apt update
3+
RUN DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai apt install -y \
4+
libxrandr-dev libxrender-dev libxinerama-dev libxcursor-dev \
5+
libxi-dev libglvnd-dev libvulkan-dev clang libc++-dev libglew-dev \
6+
libglfw3-dev vulkan-validationlayers mesa-vulkan-drivers wget \
7+
build-essential libssl-dev
8+
RUN cd && wget https://cmake.org/files/v3.23/cmake-3.23.1.tar.gz \
9+
&& tar xf cmake-3.23.1.tar.gz \
10+
&& cd cmake-3.23.1 \
11+
&& ./bootstrap \
12+
&& make \
13+
&& make install \
14+
&& ln -s /usr/local/bin/cmake /usr/bin/cmake
15+

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

3-
project(Pilot VERSION 0.1.0)
3+
project(Piccolo VERSION 0.1.0)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -16,8 +16,8 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
1616
)
1717
endif()
1818

19-
set(PILOT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
20-
set(CMAKE_INSTALL_PREFIX "${PILOT_ROOT_DIR}/bin")
19+
set(PICCOLO_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
20+
set(CMAKE_INSTALL_PREFIX "${PICCOLO_ROOT_DIR}/bin")
2121
set(BINARY_ROOT_DIR "${CMAKE_INSTALL_PREFIX}/")
2222

2323

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
| Build Type | Status |
1414
| :---------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
15-
| **Build Windows** | [![Build Windows](https://github.com/BoomingTech/Pilot/actions/workflows/build_windows.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_windows.yml) |
16-
| **Build Linux** | [![Build Linux](https://github.com/BoomingTech/Pilot/actions/workflows/build_linux.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_linux.yml) |
17-
| **Build macOS** | [![Build macOS](https://github.com/BoomingTech/Pilot/actions/workflows/build_macos.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_macos.yml) |
15+
| **Build Windows** | [![Build Windows](https://github.com/BoomingTech/Piccolo/actions/workflows/build_windows.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_windows.yml) |
16+
| **Build Linux** | [![Build Linux](https://github.com/BoomingTech/Piccolo/actions/workflows/build_linux.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_linux.yml) |
17+
| **Build macOS** | [![Build macOS](https://github.com/BoomingTech/Piccolo/actions/workflows/build_macos.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_macos.yml) |
1818

1919
## Prerequisites
2020

@@ -96,3 +96,14 @@ For Windows:
9696
cmake -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S . -B compile_db_temp -G "Unix Makefiles"
9797
copy compile_db_temp\compile_commands.json .
9898
```
99+
100+
### Using Physics Debug Renderer
101+
Currently Physics Debug Renderer is only available on Windows. You can use the following command to generate the solution with the debugger project.
102+
103+
``` powershell
104+
cmake -S . -B build -DENABLE_PHYSICS_DEBUG_RENDERER=ON
105+
```
106+
107+
Note:
108+
1. Please clean the build directory before regenerating the solution. We've encountered building problems in regenerating directly with previous CMakeCache.
109+
2. Physics Debug Renderer will run when you start PiccoloEditor. We've synced the camera position between both scenes. But the initial camera mode in Physics Debug Renderer is wrong. Scrolling down the mouse wheel once will change the camera of Physics Debug Renderer to the correct mode.

cmake/ShaderCompile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function(compile_shader SHADERS TARGET_NAME SHADER_INCLUDE_FOLDER GENERATED_DIR
2929
add_custom_command(
3030
OUTPUT ${CPP_FILE}
3131
COMMAND ${CMAKE_COMMAND} -DPATH=${SPV_FILE} -DHEADER="${CPP_FILE}"
32-
-DGLOBAL="${GLOBAL_SHADER_VAR}" -P "${PILOT_ROOT_DIR}/cmake/GenerateShaderCPPFile.cmake"
32+
-DGLOBAL="${GLOBAL_SHADER_VAR}" -P "${PICCOLO_ROOT_DIR}/cmake/GenerateShaderCPPFile.cmake"
3333
DEPENDS ${SPV_FILE}
3434
WORKING_DIRECTORY "${working_dir}")
3535

engine/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
generated/
2-
!bin/
2+
bin/

engine/3rdparty/JoltPhysics/Jolt/Core/Memory.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ JPH_SUPPRESS_WARNINGS_STD_BEGIN
1010
JPH_SUPPRESS_WARNINGS_STD_END
1111
#include <stdlib.h>
1212

13+
#if defined(__APPLE__)
14+
#include <AvailabilityMacros.h>
15+
#endif
16+
1317
JPH_NAMESPACE_BEGIN
1418

1519
void *AlignedAlloc(size_t inSize, size_t inAlignment)
@@ -19,6 +23,14 @@ void *AlignedAlloc(size_t inSize, size_t inAlignment)
1923
return _aligned_malloc(inSize, inAlignment);
2024
#elif defined(JPH_PLATFORM_ANDROID)
2125
return memalign(inAlignment, AlignUp(inSize, inAlignment));
26+
#elif defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16)) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
27+
// For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only
28+
// with the MacOSX11.0 SDK in Xcode 12 (which is what adds
29+
// MAC_OS_X_VERSION_10_16), even though the function is marked
30+
// availabe for 10.15. That's why the preprocessor checks for 10.16 but
31+
// the __builtin_available checks for 10.15.
32+
// People who use C++17 could call aligned_alloc with the 10.15 SDK already.
33+
return aligned_alloc(inAlignment, AlignUp(inSize, inAlignment));
2234
#else
2335
return std::aligned_alloc(inAlignment, AlignUp(inSize, inAlignment));
2436
#endif

engine/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
set(ENGINE_ROOT_DIR "${PILOT_ROOT_DIR}/engine")
2+
set(ENGINE_ROOT_DIR "${PICCOLO_ROOT_DIR}/engine")
33
set(THIRD_PARTY_DIR "${ENGINE_ROOT_DIR}/3rdparty")
44
set(ENGINE_ASSET_DIR "/asset")
55

@@ -22,42 +22,44 @@ endif()
2222

2323
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
2424
add_compile_options("/MP")
25-
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PilotEditor)
25+
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PiccoloEditor)
2626
endif()
2727

2828
set(vulkan_include ${THIRD_PARTY_DIR}/VulkanSDK/include)
2929

3030
if(WIN32)
3131
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/Win32/vulkan-1.lib)
3232
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32/glslangValidator.exe)
33-
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32")
33+
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32")
3434
elseif(UNIX)
3535
if(APPLE)
3636
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/MacOS/libvulkan.1.dylib)
3737
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/glslangValidator)
38-
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS")
39-
add_compile_definitions("PILOT_VK_ICD_FILENAMES=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/MoltenVK_icd.json")
38+
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS")
39+
add_compile_definitions("PICCOLO_VK_ICD_FILENAMES=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/MoltenVK_icd.json")
4040
else()
4141
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/Linux/libvulkan.so.1)
4242
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux/glslangValidator)
43-
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux")
43+
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux")
4444
endif()
4545
else()
4646
message(FATAL_ERROR "Unknown Platform")
4747
endif()
4848

4949

50-
set(SHADER_COMPILE_TARGET PilotShaderCompile)
50+
set(SHADER_COMPILE_TARGET PiccoloShaderCompile)
5151
add_subdirectory(shader)
5252

5353
add_subdirectory(3rdparty)
5454

5555
add_subdirectory(source/runtime)
5656
add_subdirectory(source/editor)
57+
add_subdirectory(source/meta_parser)
5758
#add_subdirectory(source/test)
5859

59-
set(CODEGEN_TARGET "PilotPreCompile")
60+
set(CODEGEN_TARGET "PiccoloPreCompile")
6061
include(source/precompile/precompile.cmake)
6162
set_target_properties("${CODEGEN_TARGET}" PROPERTIES FOLDER "Engine" )
6263

63-
add_dependencies(PilotRuntime "${CODEGEN_TARGET}")
64+
add_dependencies(PiccoloRuntime "${CODEGEN_TARGET}")
65+
add_dependencies("${CODEGEN_TARGET}" "PiccoloParser")

engine/asset/level/1-1.level.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"gravity": 15,
2+
"gravity": {
3+
"x": 0,
4+
"y": 0,
5+
"z": -15
6+
},
37
"character_name": "Player",
48
"objects": [
59
{
Binary file not shown.

0 commit comments

Comments
 (0)