Commit 0e6145a4 authored by Florian Oetke's avatar Florian Oetke
Browse files

Batman! (this commit has no parents)

parents
Pipeline #3209 passed with stage
in 7 minutes and 31 seconds
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
ExperimentalAutoDetectBinPacking: true
BraceWrapping: {AfterClass: false, AfterControlStatement: false, AfterEnum: true,
AfterFunction: false, AfterNamespace: false, AfterObjCDeclaration: false, AfterStruct: false,
AfterUnion: false, BeforeCatch: false, BeforeElse: false, IndentBraces: false}
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: WebKit
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakStringLiterals: true
ColumnLimit: 110
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: true
ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
IncludeCategories:
- {Priority: 1, Regex: ^<.*\.h>}
- {Priority: 2, Regex: ^<.*}
- {Priority: 3, Regex: .*}
IncludeIsMainRegex: ([-_](test|unittest))?$
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 3
NamespaceIndentation: All
ObjCBlockIndentWidth: 1
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 5
PenaltyBreakComment: 400
PenaltyBreakFirstLessLess: 200
PenaltyBreakString: 150
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 1000000
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
*.hpp linguist-language=c++
*.hxx linguist-language=c++
*.cpp linguist-language=c++
*.cxx linguist-language=c++
*.inl linguist-language=c++
*.h linguist-language=c
*.c linguist-language=c
dependencies/assimp/*.h linguist-language=c++
dependencies/asyncplusplus/*.h linguist-language=c++
dependencies/doctest/*.h linguist-language=c++
dependencies/moodycamel/*.h linguist-language=c++
dependencies/plog/*.h linguist-language=c++
dependencies/robin-map/*.h linguist-language=c++
*.mmf filter=lfs diff=lfs merge=lfs -text
*.ktx filter=lfs diff=lfs merge=lfs -text
*.opus filter=lfs diff=lfs merge=lfs -text
*.spv filter=lfs diff=lfs merge=lfs -text
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
*~
cmake-build-debug
CMakeLists.txt.user.*
CMakeLists.txt.user
.idea
assets/*.log
assets/write_dir/*
assets/ImageTool.jar
compile_commands.json
.vscode
image: lowkey42/build-env:latest
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
.cache-paths-spec: &cache-paths
- build
.linux-cache-spec: &linux-cache-spec
cache:
key: ${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}
paths: *cache-paths
.windows-cache-spec: &windows-cache-spec
cache:
paths: *cache-paths
key: "%CI_COMMIT_REF_SLUG%-%CI_JOB_NAME%-%CI_RUNNER_ID%"
.windows-task: &windows-task
tags:
- windows
only:
variables:
- $WINDOWS_CI
.artifact-spec: &artifact-spec
artifacts:
name: "phase_shifter"
paths:
- phase_shifter
expire_in: 1 day
.build-ninja-linux: &build-ninja-linux
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../phase_shifter -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON -DMIRRAGE_ENABLE_COTIRE=OFF ..
- cmake --build .
- cmake --build . --target src/install
- cmake --build . --target test
<<: *linux-cache-spec
<<: *artifact-spec
build-gcc:
image: lowkey42/gdw-build-gcc
variables:
CC: "gcc"
CXX: "g++"
<<: *build-ninja-linux
build-clang:
image: lowkey42/gdw-build-clang
variables:
CC: "clang"
CXX: "clang++"
<<: *build-ninja-linux
build-scanbuild:
image: lowkey42/gdw-build-clang
stage: build
script:
- export CC=clang
- export CXX=clang++
- export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc --all)
- echo "Build parallelism:" ${CMAKE_BUILD_PARALLEL_LEVEL}
- mkdir -p build
- cd build
- scan-build --use-c++=clang++ --use-cc=clang cmake -DMIRRAGE_FORCE_LIBCPP=ON -DMIRRAGE_ENABLE_COTIRE=OFF -G "Unix Makefiles" ..
- scan-build -o result --use-c++=clang++ --use-cc=clang -enable-checker deadcode.DeadStores -enable-checker security.insecureAPI.UncheckedReturn --status-bugs -v cmake --build . || true
artifacts:
paths:
- build/result
expire_in: 1 week
when: always
only:
variables:
- $SCANBUILD_CI
build-mingw:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../phase_shifter -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_ENABLE_COTIRE=OFF -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake --build .
- cmake --build . --target src/install
- cmake --build . --target test
variables:
CC: "gcc"
CXX: "g++"
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
build-msvc:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX:PATH=../../phase_shifter -DMIRRAGE_ENABLE_COTIRE=OFF -DMIRRAGE_EXPORT_EXECUTABLE=ON -DMIRRAGE_ENABLE_BACKWARD=OFF ..
- cmake --build . --config Release -- /m
- cmake --build . --config Release --target src/install
- cmake --build . --config Release --target RUN_TESTS
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
[submodule "external/mirrage"]
path = external/mirrage
url = https://gitlab.fsi.hochschule-trier.de/GameDevWeek/dependencies/cpp/mirrage.git
[submodule "external/eam-lite"]
path = external/eam-lite
url = https://gitlab.fsi.hochschule-trier.de/GameDevWeek/dependencies/cpp/eam-lite.git
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(phase_shifter)
include(external/mirrage/globals.cmake)
get_property(cotire_ignores GLOBAL PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH)
set_property(GLOBAL PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${cotire_ignores};${CMAKE_CURRENT_LIST_DIR}/src")
add_subdirectory(external)
add_subdirectory(src)
# custom target that does nothing but references all files so they show up in QtCreator
file(GLOB_RECURSE ALL_PROJECT_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.*)
list(FILTER ALL_PROJECT_FILES EXCLUDE REGEX "^.+\\.(h|c)+")
list(FILTER ALL_PROJECT_FILES EXCLUDE REGEX "^.*CMakeLists.txt")
add_custom_target(zz_all_phase_shifter_project_files SOURCES ${ALL_PROJECT_FILES})
The MIT License (MIT)
Copyright (c) 2019 Benjamin Albsmeier, Stefan Bodenschatz, Alexander Brendel,
Thomas Eppers, Michael Ochmann, Florian Oetke, Georg Schäfer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](/LICENSE)
## PhaseShifter | Stealth is optional for this mission
C++-GDW-Projekt vom SS 1019
GDD: <https://docs.google.com/document/d/1KmGQNSsxApRNjwxsvaBgfI01kEvXilgodRMOtaKsUoo>
Engine Documentation: <https://gitlab.com/lowkey42/mirrage/wikis/Documentation>
### Dependencies
Required:
- CMake >= 3.9
- Vulkan + Vulkan-HPP >= 1.1.80
- GLSLC
- git LFS
### Supported Compilers
- GCC >= 8
- Clang >= 6
- MSVC >= 19.14 (Visual Studio 2017 15.7)
### Build from Source
- git lfs install
- git clone --recurse-submodules git@gitlab.fsi.hochschule-trier.de:GameDevWeek/sommersemester-2019/cpp/phase_shifter.git
- mkdir phase_shifter_build
- cd phase_shifter_build
- cmake ../phase_shifter
- cmake --build .
The project can be further configured by setting the following CMake-Properties (-DPROP=ON/OFF):
- MIRRAGE_BUILD_DEMO: Build the demo application (Default: ON when building the engine directly, OFF when including it from another CMake-Project)
- MIRRAGE_BUILD_MESH_CONVERTER: Also build the mesh converter that can be used to converter models into the engine specific data format (Default: OFF)
- MIRRAGE_ENABLE_BACKWARD: Enable stacktraces (Default: ON on Linux, OFF on Windows because the underlying library backward-cpp doesn't currently support Windows)
- MIRRAGE_ENABLE_CLANG_FORMAT: Includes an additional clangformat target, that can be used to automatically format all source files in the project
- MIRRAGE_ENABLE_LTO: Activates link time optimizations on gcc/clang (Default: OFF)
- MIRRAGE_SAN: Build with clang sanatizers (address, integer, undefined and address-use-after-scope) (Default: OFF)
- MIRRAGE_ENABLE_COTIRE: Enables automatic precompiled headers through cotire
- MIRRAGE_USE_LIBCPP: Uses libc++ instead of libstdc++ when compiling with clang (Default: ON)
- MIRRAGE_OPTIMIZE_NATIVE: Compile with -march=native (Default: OFF)
skel: = models/*.mbf
anim: = animations/*.maf
blueprint: = blueprints/*.json
model: = models/*.mmf
mat: = materials/*.msf
{
"Transform": {
},
"Camera": {
"fov": 50.0,
"near": 0.05,
"far": 80.0
}
}
{
"Transform":{
"scale": {"x": 0.5, "y": 0.5, "z": 0.5}
},
"Model": {
"aid": "model:cube"
},
"Shadowcaster": {
}
}
{
"Transform":{
"scale": {"x": 1.0, "y": 1.0, "z": 1.0}
},
"Model": {
"aid": "model:plane"
}
}
{
"Transform": {
},
"Directional_light": {
"source_radius": 1.0,
"intensity": 4000.0,
"color": {
"r": 1,
"g": 1,
"b": 1
},
"shadow_intensity": 2.0,
"shadow_size": 25,
"near_plane": 10.0,
"far_plane": 100,
"update_frequency": 1,
"light_particles": true
},
"Shadowcaster": {
}
}
{
"substance_id": "default",
"albedo_aid": "default_white.ktx"
}
{
"substance_id": "default",
"albedo_aid": "plane_none_albedo.ktx",
"normal_aid": "plane_none_normal.ktx",
"brdf_aid": "plane_none_brdf.ktx",
"emission_aid": ""
}
{
"fonts": [
{
"id" : "default",
"aid" : "font:ui/RobotoCondensed-Regular.ttf",
"size" : 20
}
]
}
\ No newline at end of file
{
"initial": "main",
"contexts": {
"main": {
"keys": {
"Escape": {"type":"once", "action":"quit"},
"F1": {"type":"once", "action":"fast_quit"},
"W": {"type":"continuous", "action":"move_up"},
"Up": {"type":"continuous", "action":"move_up"},
"S": {"type":"continuous", "action":"move_down"},
"Down": {"type":"continuous", "action":"move_down"},
"A": {"type":"continuous", "action":"move_left"},
"Left": {"type":"continuous", "action":"move_left"},
"D": {"type":"continuous", "action":"move_right"},
"Right": {"type":"continuous", "action":"move_right"},
"Caret": {"type":"once", "action":"console"},
"F11": {"type":"once", "action":"console"},
"LShift": {"type":"continuous", "action":"multi_select"}
},
"pad_sticks": {
"left": {"type": "range", "action": "move"},
"right": {"type": "range", "action": "move"}
},
"pad_buttons": {
"x": {"type":"continuous", "action":"jump"}
},
"mouse_buttons": {
{"button":1, "clicks":0}: {"type":"once", "action":"select"},
{"button":2, "clicks":0}: {"type":"continuous", "action":"rotate"},
{"button":3, "clicks":1}: {"type":"once", "action":"action"}
},
"mouse_movement": {"type": "range", "action": "mouse_look"},
"mouse_wheel_up": {"type": "range", "action": "zoom_in"},
"mouse_wheel_down": {"type": "range", "action": "zoom_out"}
}
}
}
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
add_subdirectory(mirrage)
add_subdirectory(eam-lite)
Subproject commit 37b1de8804afffe6e12e18d76ce0ddf8b7eb136e
Subproject commit f7fae963c2e1590f14268203b9fe2a1b76551f95
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(phase_shifter)
file(GLOB_RECURSE SRC_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.h*
${CMAKE_CURRENT_SOURCE_DIR}/*.c*
)
add_executable(phase_shifter ${SRC_FILES} ${BACKWARD_ENABLE})
if(${MIRRAGE_ENABLE_BACKWARD})
add_backward(phase_shifter)
endif()
target_compile_features(phase_shifter PUBLIC cxx_std_17)
set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_compile_options(phase_shifter PRIVATE ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_link_libraries(phase_shifter
PRIVATE
mirrage::mirrage
mirrage::renderer
plog
glm::glm
sf2
doctest
ogg
opus
opusfile
eam-lite
)
if (WIN32)
if(MINGW)
target_link_libraries(phase_shifter PRIVATE mingw32)
endif()
target_link_libraries(phase_shifter PRIVATE mirrage::deps::SDL2main)
endif()
if (APPLE)
target_link_libraries(phase_shifter PUBLIC "-framework IOKit -framework Foundation")
endif()
option(MIRRAGE_EXPORT_EXECUTABLE "Export executable" OFF)
if(MIRRAGE_EXPORT_EXECUTABLE)
install(DIRECTORY ${MIRRAGE_ROOT_PROJECT_DIR}/assets/ DESTINATION bin)
install(TARGETS phase_shifter RUNTIME DESTINATION bin)
endif()
option(PHASE_SHIFTER_TESTS "Enable PhaseShifter tests." ON)
if(PHASE_SHIFTER_TESTS)
enable_testing()
add_test(NAME phase-shifter-tests COMMAND phase_shifter -e --no-run=false)
endif()
if(COMMAND cotire)
cotire(phase_shifter)
endif()
if(MSVC_IDE)
set_property(TARGET phase_shifter PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${MIRRAGE_ROOT_PROJECT_DIR}/assets")
file(GLOB_RECURSE _source_list *.cpp* *.h* *.hpp*)
foreach(_source IN ITEMS ${_source_list})
get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${CMAKE_SOURCE_DIR}" "" _group_path "${_source_path}")
string(REPLACE "/" "\\" _group_path "${_group_path}")
source_group("${_group_path}" FILES "${_source}")
endforeach()
endif()
#pragma once
#include <mirrage/asset/asset_manager.hpp>
#include <sources/opus.hpp>
#include <cassert>
#include <memory>
namespace mirrage