Compare commits
No commits in common. "main" and "ui-system" have entirely different histories.
@ -1,41 +0,0 @@
|
|||||||
name: Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Dependencies installieren
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y \
|
|
||||||
cmake \
|
|
||||||
build-essential \
|
|
||||||
libfreetype-dev \
|
|
||||||
libgl1-mesa-dev
|
|
||||||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
|
|
||||||
gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
|
|
||||||
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | \
|
|
||||||
sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y cmake
|
|
||||||
|
|
||||||
- name: Submodules laden
|
|
||||||
run: git submodule update --init --recursive
|
|
||||||
|
|
||||||
- name: Konfigurieren
|
|
||||||
run: cmake -B build -DBUILD_GAME=OFF
|
|
||||||
|
|
||||||
- name: Nur Test-Target bauen
|
|
||||||
run: cmake --build build --target LayoutEngineTests
|
|
||||||
|
|
||||||
- name: Tests ausführen
|
|
||||||
run: ctest --test-dir build --output-on-failure
|
|
||||||
3
.gitignore
vendored
@ -84,6 +84,7 @@ fabric.properties
|
|||||||
# Object files
|
# Object files
|
||||||
*.o
|
*.o
|
||||||
*.ko
|
*.ko
|
||||||
|
*.obj
|
||||||
*.elf
|
*.elf
|
||||||
|
|
||||||
# Linker output
|
# Linker output
|
||||||
@ -138,7 +139,7 @@ dkms.conf
|
|||||||
*.slo
|
*.slo
|
||||||
*.lo
|
*.lo
|
||||||
*.o
|
*.o
|
||||||
|
*.obj
|
||||||
|
|
||||||
# Precompiled Headers
|
# Precompiled Headers
|
||||||
*.gch
|
*.gch
|
||||||
|
|||||||
3
.gitmodules
vendored
@ -4,6 +4,3 @@
|
|||||||
[submodule "lib/glm"]
|
[submodule "lib/glm"]
|
||||||
path = lib/glm
|
path = lib/glm
|
||||||
url = https://github.com/g-truc/glm.git
|
url = https://github.com/g-truc/glm.git
|
||||||
[submodule "lib/tinyobjloader"]
|
|
||||||
path = lib/tinyobjloader
|
|
||||||
url = https://github.com/tinyobjloader/tinyobjloader.git
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
<module classpath="CIDR" type="CPP_MODULE" version="4" />
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
@ -257,6 +257,7 @@
|
|||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||||
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALLOW_FAR_ALIGNMENT/@EntryValue" value="true" type="bool" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/cmake-build-debug/_deps/catch2-src" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/cmake-build-debug/_deps/spdlog-src" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/lib/glfw" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/lib/glfw" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/lib/glm" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/lib/glm" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/lib/tinyobjloader" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/lib/tinyobjloader" vcs="Git" />
|
||||||
|
|||||||
212
CMakeLists.txt
@ -1,14 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.31)
|
||||||
project(Dicewars_Siedler)
|
project(Dicewars_Siedler)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
option(BUILD_GAME "Build the game executable" ON)
|
|
||||||
|
|
||||||
# GLFW/OpenGL/Freetype nur laden wenn das Spiel gebaut wird
|
|
||||||
if(BUILD_GAME)
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(lib/glfw)
|
add_subdirectory(lib/glfw)
|
||||||
|
|
||||||
add_library(glad STATIC
|
add_library(glad STATIC
|
||||||
@ -20,42 +17,8 @@ if(BUILD_GAME)
|
|||||||
|
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||||
endif()
|
|
||||||
|
|
||||||
# Catch2 und Tests immer verfügbar
|
|
||||||
include(FetchContent)
|
|
||||||
FetchContent_Declare(
|
|
||||||
Catch2
|
|
||||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
||||||
GIT_TAG v3.7.1
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
add_executable(LayoutEngineTests
|
|
||||||
tests/layout/LayoutEngineTest.cpp
|
|
||||||
)
|
|
||||||
target_include_directories(LayoutEngineTests PRIVATE
|
|
||||||
src
|
|
||||||
lib/glm
|
|
||||||
)
|
|
||||||
|
|
||||||
include(FetchContent)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
spdlog
|
|
||||||
GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
|
||||||
GIT_TAG v1.17.0
|
|
||||||
)
|
|
||||||
|
|
||||||
FetchContent_MakeAvailable(Catch2 spdlog)
|
|
||||||
|
|
||||||
target_link_libraries(LayoutEngineTests PRIVATE Catch2::Catch2WithMain spdlog::spdlog_header_only)
|
|
||||||
|
|
||||||
include(CTest)
|
|
||||||
include(Catch)
|
|
||||||
catch_discover_tests(LayoutEngineTests)
|
|
||||||
|
|
||||||
if(BUILD_GAME)
|
|
||||||
add_executable(Dicewars_Siedler src/main.cpp
|
add_executable(Dicewars_Siedler src/main.cpp
|
||||||
src/engine/core/Window.cpp
|
src/engine/core/Window.cpp
|
||||||
src/engine/core/Window.h
|
src/engine/core/Window.h
|
||||||
@ -111,8 +74,8 @@ if(BUILD_GAME)
|
|||||||
src/engine/renderer/TerrainRenderer.h
|
src/engine/renderer/TerrainRenderer.h
|
||||||
src/engine/renderer/shaders/TerrainShader.cpp
|
src/engine/renderer/shaders/TerrainShader.cpp
|
||||||
src/engine/renderer/shaders/TerrainShader.h
|
src/engine/renderer/shaders/TerrainShader.h
|
||||||
src/engine/renderer/loader/AssetManager.cpp
|
src/engine/renderer/model/AssetManager.cpp
|
||||||
src/engine/renderer/loader/AssetManager.h
|
src/engine/renderer/model/AssetManager.h
|
||||||
src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.cpp
|
src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.cpp
|
||||||
src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.h
|
src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.h
|
||||||
src/game/hexWorld/tileGenerator/ForestTileGenerator.cpp
|
src/game/hexWorld/tileGenerator/ForestTileGenerator.cpp
|
||||||
@ -144,8 +107,8 @@ if(BUILD_GAME)
|
|||||||
src/game/hexWorld/ecs/systems/BuildingPlacementSystem.h
|
src/game/hexWorld/ecs/systems/BuildingPlacementSystem.h
|
||||||
src/game/GameMode.cpp
|
src/game/GameMode.cpp
|
||||||
src/game/GameMode.h
|
src/game/GameMode.h
|
||||||
src/game/player/PlayerInventory.cpp
|
src/game/PlayerInventory.cpp
|
||||||
src/game/player/PlayerInventory.h
|
src/game/PlayerInventory.h
|
||||||
src/game/player/Player.cpp
|
src/game/player/Player.cpp
|
||||||
src/game/player/Player.h
|
src/game/player/Player.h
|
||||||
src/game/hexWorld/ecs/components/OwnerComponent.cpp
|
src/game/hexWorld/ecs/components/OwnerComponent.cpp
|
||||||
@ -171,8 +134,8 @@ if(BUILD_GAME)
|
|||||||
src/engine/core/gui/uiComponent/UiText.h
|
src/engine/core/gui/uiComponent/UiText.h
|
||||||
src/engine/core/gui/text/Font.cpp
|
src/engine/core/gui/text/Font.cpp
|
||||||
src/engine/core/gui/text/Font.h
|
src/engine/core/gui/text/Font.h
|
||||||
src/engine/renderer/components/UiRenderBundle.cpp
|
src/engine/core/gui/uiComponent/UiRenderBundle.cpp
|
||||||
src/engine/renderer/components/UiRenderBundle.h
|
src/engine/core/gui/uiComponent/UiRenderBundle.h
|
||||||
src/engine/renderer/shaders/TextShader.cpp
|
src/engine/renderer/shaders/TextShader.cpp
|
||||||
src/engine/renderer/shaders/TextShader.h
|
src/engine/renderer/shaders/TextShader.h
|
||||||
src/engine/renderer/TextRenderer.cpp
|
src/engine/renderer/TextRenderer.cpp
|
||||||
@ -184,169 +147,13 @@ if(BUILD_GAME)
|
|||||||
src/engine/core/gui/uiComponent/UiButton.h
|
src/engine/core/gui/uiComponent/UiButton.h
|
||||||
src/engine/renderer/model/GUIText.cpp
|
src/engine/renderer/model/GUIText.cpp
|
||||||
src/engine/renderer/model/GUIText.h
|
src/engine/renderer/model/GUIText.h
|
||||||
src/game/ui/components/UiRessourceWidget.cpp
|
|
||||||
src/game/ui/components/UiRessourceWidget.h
|
|
||||||
src/game/ui/components/factorys/RessourceWidgetFactory.cpp
|
|
||||||
src/game/ui/components/factorys/RessourceWidgetFactory.h
|
|
||||||
src/game/ui/components/UiInventoryContainer.cpp
|
|
||||||
src/game/ui/components/UiInventoryContainer.h
|
|
||||||
src/game/hexWorld/building/BuildingDefinition.h
|
|
||||||
src/game/hexWorld/building/TemporaryBuildingDefinitionFactory.h
|
|
||||||
src/game/hexWorld/building/BuildingRules.cpp
|
|
||||||
src/game/hexWorld/building/BuildingRules.h
|
|
||||||
src/game/hexWorld/building/BuildingFactory.cpp
|
|
||||||
src/game/hexWorld/building/BuildingFactory.h
|
|
||||||
src/game/hexWorld/building/BuildingConfig.cpp
|
|
||||||
src/game/hexWorld/building/BuildingConfig.h
|
|
||||||
src/engine/toolbox/util.h
|
|
||||||
src/engine/core/events/EventBus.cpp
|
|
||||||
src/engine/core/events/EventBus.h
|
|
||||||
src/game/hexWorld/events/TurnChangedEvent.cpp
|
|
||||||
src/game/hexWorld/events/TurnChangedEvent.h
|
|
||||||
src/game/hexWorld/events/ResourceCollectEvent.cpp
|
|
||||||
src/game/hexWorld/events/ResourceCollectEvent.h
|
|
||||||
src/game/hexWorld/gameplay/TurnSystem.cpp
|
|
||||||
src/game/hexWorld/gameplay/TurnSystem.h
|
|
||||||
src/game/hexWorld/gameplay/TurnState.h
|
|
||||||
src/engine/renderer/model/SubModel.h
|
|
||||||
src/engine/renderer/model/ModelStageConfiguration.cpp
|
|
||||||
src/engine/renderer/model/ModelStageConfiguration.h
|
|
||||||
src/engine/renderer/model/ModelStageCondition.h
|
|
||||||
src/engine/renderer/model/ModelStages.cpp
|
|
||||||
src/engine/renderer/model/ModelStages.h
|
|
||||||
src/engine/toolbox/IndexedMap.cpp
|
|
||||||
src/engine/toolbox/IndexedMap.h
|
|
||||||
src/engine/core/ECS/ModelStateComponent.cpp
|
|
||||||
src/engine/core/ECS/ModelStateComponent.h
|
|
||||||
src/game/hexWorld/ecs/components/ProducingComponent.cpp
|
|
||||||
src/game/hexWorld/ecs/components/ProducingComponent.h
|
|
||||||
src/game/hexWorld/ecs/systems/ProducingSystem.cpp
|
|
||||||
src/game/hexWorld/ecs/systems/ProducingSystem.h
|
|
||||||
src/engine/core/ECS/WorldSpriteComponent.cpp
|
|
||||||
src/engine/core/ECS/WorldSpriteComponent.h
|
|
||||||
src/engine/renderer/WorldSpriteRenderer.cpp
|
|
||||||
src/engine/renderer/WorldSpriteRenderer.h
|
|
||||||
src/engine/renderer/components/WorldSpriteRenderingData.h
|
|
||||||
src/engine/renderer/shaders/WorldSpriteShader.cpp
|
|
||||||
src/engine/renderer/shaders/WorldSpriteShader.h
|
|
||||||
src/engine/core/animations/AnimationCurve.h
|
|
||||||
src/engine/core/animations/AnimationTrack.h
|
|
||||||
src/engine/core/animations/AnimationComponent.cpp
|
|
||||||
src/engine/core/animations/AnimationComponent.h
|
|
||||||
src/engine/core/animations/AnimationSystem.cpp
|
|
||||||
src/engine/core/animations/AnimationSystem.h
|
|
||||||
src/engine/core/EngineTime.cpp
|
|
||||||
src/engine/core/EngineTime.h
|
|
||||||
src/game/hexWorld/ecs/systems/CollectResourceSystem.cpp
|
|
||||||
src/game/hexWorld/ecs/systems/CollectResourceSystem.h
|
|
||||||
src/engine/renderer/model/FramebufferObject.cpp
|
|
||||||
src/engine/renderer/model/FramebufferObject.h
|
|
||||||
src/engine/renderer/MinimapRenderer.cpp
|
|
||||||
src/engine/renderer/MinimapRenderer.h
|
|
||||||
src/engine/renderer/components/MinimapRenderData.h
|
|
||||||
src/engine/renderer/shaders/MinimapShader.cpp
|
|
||||||
src/engine/renderer/shaders/MinimapShader.h
|
|
||||||
src/engine/renderer/model/RenderTargets.cpp
|
|
||||||
src/engine/renderer/model/RenderTargets.h
|
|
||||||
src/engine/renderer/model/GuiTextureBuilder.cpp
|
|
||||||
src/engine/renderer/model/GuiTextureBuilder.h
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuContainer.cpp
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuContainer.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/IState.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/IState.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/InputUser.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/InputUser.h
|
|
||||||
src/engine/core/inputsOutputs/inputs/Keyboard.cpp
|
|
||||||
src/engine/core/inputsOutputs/inputs/Keyboard.h
|
|
||||||
src/engine/core/inputsOutputs/inputs/Mouse.cpp
|
|
||||||
src/engine/core/inputsOutputs/inputs/Mouse.h
|
|
||||||
src/engine/core/inputsOutputs/inputs/MouseButton.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/RegisteredUsers.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/RegisteredUsers.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/StateManager.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/StateManager.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/State.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/State.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/EmptyState.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/states/EmptyState.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/inputUser/GameInputUser.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/inputUser/GameInputUser.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/StateRegistry.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/StateRegistry.h
|
|
||||||
src/engine/core/gui/uiComponent/ClickableUiComponent.cpp
|
|
||||||
src/engine/core/gui/uiComponent/ClickableUiComponent.h
|
|
||||||
src/engine/core/inputsOutputs/stateControl/inputUser/UiInputUser.cpp
|
|
||||||
src/engine/core/inputsOutputs/stateControl/inputUser/UiInputUser.h
|
|
||||||
src/engine/core/gui/uiComponent/EventData.cpp
|
|
||||||
src/engine/core/gui/uiComponent/EventData.h
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuButton.cpp
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuButton.h
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuCostContainer.cpp
|
|
||||||
src/game/ui/components/buildingMenu/UiBuildingMenuCostContainer.h
|
|
||||||
src/game/hexWorld/events/BuildingTypeSelectEvent.cpp
|
|
||||||
src/game/hexWorld/events/BuildingTypeSelectEvent.h
|
|
||||||
src/game/hexWorld/ecs/components/UpgradeComponent.cpp
|
|
||||||
src/game/hexWorld/ecs/components/UpgradeComponent.h
|
|
||||||
src/game/hexWorld/ecs/systems/UpgradeSystem.cpp
|
|
||||||
src/game/hexWorld/ecs/systems/UpgradeSystem.h
|
|
||||||
src/game/hexWorld/ecs/systems/SelectionSystem.cpp
|
|
||||||
src/game/hexWorld/ecs/systems/SelectionSystem.h
|
|
||||||
src/engine/core/ECS/RenderStateComponent.cpp
|
|
||||||
src/engine/core/ECS/RenderStateComponent.h
|
|
||||||
src/game/hexWorld/ecs/systems/BuildPreviewSystem.cpp
|
|
||||||
src/game/hexWorld/ecs/systems/BuildPreviewSystem.h
|
|
||||||
src/game/hexWorld/ecs/components/BuildingPreviewComponent.cpp
|
|
||||||
src/game/hexWorld/ecs/components/BuildingPreviewComponent.h
|
|
||||||
src/game/GameWorldSystems.cpp
|
|
||||||
src/game/GameWorldSystems.h
|
|
||||||
src/engine/core/gui/uiComponent/layout/LayoutEngine.h
|
|
||||||
src/engine/renderer/config/MinimapConfig.h
|
|
||||||
src/engine/core/Types.h
|
|
||||||
src/engine/core/gui/text/UiTheme.h
|
|
||||||
src/engine/renderer/loader/async/RawSubModelData.h
|
|
||||||
src/engine/renderer/loader/async/RawModelData.h
|
|
||||||
src/engine/renderer/loader/async/RawTextureData.h
|
|
||||||
src/engine/renderer/loader/async/RawModelStageData.h
|
|
||||||
src/engine/renderer/loader/async/RawStagedModelData.h
|
|
||||||
src/engine/renderer/loader/async/AssetLoader.cpp
|
|
||||||
src/engine/renderer/loader/async/AssetLoader.h
|
|
||||||
src/engine/renderer/loader/async/AssetLoadingProgressEvent.h
|
|
||||||
src/engine/core/scenes/Scene.cpp
|
|
||||||
src/engine/core/scenes/Scene.h
|
|
||||||
src/engine/core/scenes/SceneManager.cpp
|
|
||||||
src/engine/core/scenes/SceneManager.h
|
|
||||||
src/engine/core/scenes/SplashScreen.cpp
|
|
||||||
src/engine/core/scenes/SplashScreen.h
|
|
||||||
src/engine/core/scenes/SplashScreenLayer.cpp
|
|
||||||
src/engine/core/scenes/SplashScreenLayer.h
|
|
||||||
src/engine/core/gui/uiComponent/UiProgressbar.cpp
|
|
||||||
src/engine/core/gui/uiComponent/UiProgressbar.h
|
|
||||||
src/game/scenes/main/MainMenu.cpp
|
|
||||||
src/game/scenes/main/MainMenu.h
|
|
||||||
src/game/scenes/main/MainUiLayer.cpp
|
|
||||||
src/game/scenes/main/MainUiLayer.h
|
|
||||||
src/game/scenes/main/events/QuitEvent.h
|
|
||||||
src/engine/core/gui/uiMain/UiStack.cpp
|
|
||||||
src/engine/core/gui/uiMain/UiStack.h
|
|
||||||
src/engine/core/EngineContext.cpp
|
|
||||||
src/engine/core/EngineContext.h
|
|
||||||
src/engine/core/gui/uiMain/UiConfig.h
|
|
||||||
src/engine/renderer/RenderContext.h
|
|
||||||
)
|
)
|
||||||
target_compile_options(Dicewars_Siedler PRIVATE
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wpedantic
|
|
||||||
-Werror=return-type
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
target_include_directories(Dicewars_Siedler PRIVATE
|
target_include_directories(Dicewars_Siedler PRIVATE
|
||||||
lib/glfw/include
|
lib/glfw/include
|
||||||
lib/glm
|
lib/glm
|
||||||
lib/stb_image
|
lib/stb_image
|
||||||
lib/tinyobjloader
|
lib/tinyobjloader
|
||||||
lib/nlohmann
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Dicewars_Siedler
|
target_link_libraries(Dicewars_Siedler
|
||||||
@ -355,7 +162,4 @@ if(BUILD_GAME)
|
|||||||
glad
|
glad
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
${FREETYPE_LIBRARIES}
|
${FREETYPE_LIBRARIES}
|
||||||
spdlog::spdlog_header_only
|
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 2.9 MiB |
BIN
assets/bar.png
|
Before Width: | Height: | Size: 548 B |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "cabin",
|
|
||||||
"allowedTileResources" : ["stone"],
|
|
||||||
"cost" : {"wood": 15},
|
|
||||||
"modelStages": [
|
|
||||||
{
|
|
||||||
"name": "cabin-base",
|
|
||||||
"filename": "cabin.obj",
|
|
||||||
"conditionKey": "level",
|
|
||||||
"minValue": 1,
|
|
||||||
"maxValue": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cabin-level2",
|
|
||||||
"filename": "cabin2.obj",
|
|
||||||
"conditionKey": "level",
|
|
||||||
"minValue": 2,
|
|
||||||
"maxValue": 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'Untitled.blend'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Material_0.003
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd textures/forest_hut.png
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'None'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Material.001
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd cabin.jpg
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'Untitled.blend'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Log_Mat
|
|
||||||
Ns 63.117920
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 1.000000 1.000000 1.000000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd textures/Log_C1.jpg
|
|
||||||
#map_Bump -bm 1.000000 textures/Log_NRM.jpg
|
|
||||||
|
|
||||||
newmtl Material_0.003
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd /home/sebastian/Downloads/textures/forest_hut.png
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'Untitled.blend'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Log_Mat
|
|
||||||
Ns 63.117920
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 1.000000 1.000000 1.000000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd textures/Log_C1.jpg
|
|
||||||
#map_Bump -bm 1.000000 /home/sebastian/Downloads/log/source/Log/Log_NRM.jpg
|
|
||||||
|
|
||||||
newmtl Material_0.003
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd /home/sebastian/Downloads/textures/forest_hut.png
|
|
||||||
|
Before Width: | Height: | Size: 2.8 MiB |
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "cabin2",
|
|
||||||
"allowedTileResources" : ["stone"],
|
|
||||||
"cost" : {"wood": 15},
|
|
||||||
"modelStages": [
|
|
||||||
{
|
|
||||||
"name": "cabin2-base",
|
|
||||||
"filename": "cabin2.obj",
|
|
||||||
"conditionKey": "fillRatio",
|
|
||||||
"minValue": 0.0,
|
|
||||||
"maxValue": 0.1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'None'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Material.001
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd cabin.jpg
|
|
||||||
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 909 KiB |
|
Before Width: | Height: | Size: 909 KiB |
|
Before Width: | Height: | Size: 809 KiB |
|
Before Width: | Height: | Size: 4.0 MiB |
|
Before Width: | Height: | Size: 105 KiB |
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'None'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Material.001
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd cabin.jpg
|
|
||||||
|
Before Width: | Height: | Size: 234 KiB |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "stoneMason",
|
|
||||||
"allowedTileResources" : ["stone"],
|
|
||||||
"cost" : {"wood": 15, "stone": 10},
|
|
||||||
"modelStages": [
|
|
||||||
{
|
|
||||||
"name": "stone_mason_empty",
|
|
||||||
"filename": "stone_mason.obj",
|
|
||||||
"conditionKey": "fillRatio",
|
|
||||||
"minValue": 0.0,
|
|
||||||
"maxValue": 0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stone_mason_full",
|
|
||||||
"filename": "stone_mason_full.obj",
|
|
||||||
"conditionKey": "fillRatio",
|
|
||||||
"minValue": 0.5,
|
|
||||||
"maxValue": 1.0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'Untitled.blend'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Material_0.002
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd stone_mason.png
|
|
||||||
|
Before Width: | Height: | Size: 4.0 MiB |
|
Before Width: | Height: | Size: 197 KiB |
@ -1,32 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'Untitled.blend'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl Cobblestone_tjemdayjw
|
|
||||||
Ns 0.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.000000 0.000000 0.000000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 1
|
|
||||||
map_Kd textures/tjemdayjw_4K_Albedo_LOD7.jpg
|
|
||||||
|
|
||||||
newmtl Cobblestone_tjemdbyiw
|
|
||||||
Ns 0.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.000000 0.000000 0.000000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 1
|
|
||||||
map_Kd textures/tjemdbyiw_4K_Albedo_LOD6.jpg
|
|
||||||
|
|
||||||
newmtl Material_0.002
|
|
||||||
Ns 250.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.500000 0.500000 0.500000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 2
|
|
||||||
map_Kd textures/stone_mason.png
|
|
||||||
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.0 MiB |
|
Before Width: | Height: | Size: 5.6 MiB |
|
Before Width: | Height: | Size: 8.5 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 3.8 MiB |
|
Before Width: | Height: | Size: 5.4 MiB |
|
Before Width: | Height: | Size: 7.8 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 4.1 MiB |
31
assets/cabin/20958_Log_Cabin_v1_NEW.mtl
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
|
||||||
|
# File Created: 03.06.2013 16:07:05
|
||||||
|
|
||||||
|
newmtl 20958_Log_Cabin_v1
|
||||||
|
Ns 18.0000
|
||||||
|
Ni 1.5000
|
||||||
|
d 1.0000
|
||||||
|
Tr 0.0000
|
||||||
|
Tf 1.0000 1.0000 1.0000
|
||||||
|
illum 2
|
||||||
|
Ka 1.0000 1.0000 1.0000
|
||||||
|
Kd 1.0000 1.0000 1.0000
|
||||||
|
Ks 0.3240 0.3240 0.3240
|
||||||
|
Ke 0.0000 0.0000 0.0000
|
||||||
|
map_Ka cabin.jpg
|
||||||
|
map_Kd cabin.jpg
|
||||||
|
map_Ks 20958_Log_Cabin_v1_specular.jpg
|
||||||
|
|
||||||
|
newmtl 02___Default
|
||||||
|
Ns 10.0000
|
||||||
|
Ni 1.5000
|
||||||
|
d 1.0000
|
||||||
|
Tr 0.0000
|
||||||
|
Tf 1.0000 1.0000 1.0000
|
||||||
|
illum 2
|
||||||
|
Ka 1.0000 1.0000 1.0000
|
||||||
|
Kd 1.0000 1.0000 1.0000
|
||||||
|
Ks 0.0000 0.0000 0.0000
|
||||||
|
Ke 0.0000 0.0000 0.0000
|
||||||
|
map_Ka disc_diffuse.JPG
|
||||||
|
map_Kd disc_diffuse.JPG
|
||||||
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.8 MiB |
200007
assets/dragon/dragon.obj
BIN
assets/logo.png
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 8.4 MiB |
|
Before Width: | Height: | Size: 7.0 MiB |
|
Before Width: | Height: | Size: 28 MiB |
@ -1,12 +0,0 @@
|
|||||||
# Blender 5.0.1 MTL File: 'None'
|
|
||||||
# www.blender.org
|
|
||||||
|
|
||||||
newmtl _Faerberhaus_FaerberhausFaerberhaus
|
|
||||||
Ns 0.000000
|
|
||||||
Ka 1.000000 1.000000 1.000000
|
|
||||||
Ks 0.000000 0.000000 0.000000
|
|
||||||
Ke 0.000000 0.000000 0.000000
|
|
||||||
Ni 1.500000
|
|
||||||
d 1.000000
|
|
||||||
illum 1
|
|
||||||
map_Kd /home/sebastian/Downloads/prehistoric-house-asparn/source/Asparn_Weberhaus3/Faerberhaus.jpg
|
|
||||||
@ -1,586 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="192"
|
|
||||||
height="24"
|
|
||||||
id="svg2"
|
|
||||||
version="1.1"
|
|
||||||
inkscape:version="0.48.2 r9819"
|
|
||||||
sodipodi:docname="progress bar.svg">
|
|
||||||
<defs
|
|
||||||
id="defs4">
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4693">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#272726;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4695" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#808080;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop4697" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4685">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4687" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#6f8a91;stop-opacity:1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4689" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4644">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#464646;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4646" />
|
|
||||||
<stop
|
|
||||||
id="stop4648"
|
|
||||||
offset="0.32966033"
|
|
||||||
style="stop-color:#000000;stop-opacity:1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#6f917c;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop4650" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4630">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#00ff00;stop-opacity:1"
|
|
||||||
offset="0"
|
|
||||||
id="stop4632" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#008000;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop4634" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4552">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#97e4f3;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4554" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#80b3ff;stop-opacity:1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4556" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4450">
|
|
||||||
<stop
|
|
||||||
id="stop4452"
|
|
||||||
offset="0"
|
|
||||||
style="stop-color:#464646;stop-opacity:1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#000000;stop-opacity:1;"
|
|
||||||
offset="0.32966033"
|
|
||||||
id="stop4454" />
|
|
||||||
<stop
|
|
||||||
id="stop4456"
|
|
||||||
offset="1"
|
|
||||||
style="stop-color:#3c3c3c;stop-opacity:1;" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4272">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#464646;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4274" />
|
|
||||||
<stop
|
|
||||||
id="stop4448"
|
|
||||||
offset="0.5"
|
|
||||||
style="stop-color:#000000;stop-opacity:1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#3c3c3c;stop-opacity:1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4276" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient3757">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#090a0c;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop3759" />
|
|
||||||
<stop
|
|
||||||
id="stop3773"
|
|
||||||
offset="0.28483504"
|
|
||||||
style="stop-color:#414141;stop-opacity:1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#1c2017;stop-opacity:1;"
|
|
||||||
offset="0.65175718"
|
|
||||||
id="stop3775" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#373737;stop-opacity:1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop3761" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter4136"
|
|
||||||
inkscape:label="Chalk and sponge"
|
|
||||||
inkscape:menu="Distort"
|
|
||||||
inkscape:menu-tooltip="Low turbulence gives sponge look and high turbulence chalk"
|
|
||||||
width="1.6"
|
|
||||||
height="2"
|
|
||||||
y="-0.5"
|
|
||||||
x="-0.3"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feTurbulence
|
|
||||||
id="feTurbulence4138"
|
|
||||||
baseFrequency="0.4"
|
|
||||||
type="fractalNoise"
|
|
||||||
seed="0"
|
|
||||||
numOctaves="5"
|
|
||||||
result="result1" />
|
|
||||||
<feOffset
|
|
||||||
id="feOffset4140"
|
|
||||||
dx="-5"
|
|
||||||
dy="-5"
|
|
||||||
result="result2" />
|
|
||||||
<feDisplacementMap
|
|
||||||
id="feDisplacementMap4142"
|
|
||||||
in2="result1"
|
|
||||||
xChannelSelector="R"
|
|
||||||
yChannelSelector="G"
|
|
||||||
scale="30"
|
|
||||||
in="SourceGraphic" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
id="filter4228"
|
|
||||||
inkscape:label="Chalk and sponge"
|
|
||||||
inkscape:menu="Distort"
|
|
||||||
inkscape:menu-tooltip="Low turbulence gives sponge look and high turbulence chalk"
|
|
||||||
width="1.6"
|
|
||||||
height="2"
|
|
||||||
y="-0.5"
|
|
||||||
x="-0.3"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feTurbulence
|
|
||||||
id="feTurbulence4230"
|
|
||||||
baseFrequency="0.4"
|
|
||||||
type="fractalNoise"
|
|
||||||
seed="0"
|
|
||||||
numOctaves="5"
|
|
||||||
result="result1" />
|
|
||||||
<feOffset
|
|
||||||
id="feOffset4232"
|
|
||||||
dx="-5"
|
|
||||||
dy="-5"
|
|
||||||
result="result2" />
|
|
||||||
<feDisplacementMap
|
|
||||||
id="feDisplacementMap4234"
|
|
||||||
in2="result1"
|
|
||||||
xChannelSelector="R"
|
|
||||||
yChannelSelector="G"
|
|
||||||
scale="30"
|
|
||||||
in="SourceGraphic" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
id="filter4264"
|
|
||||||
inkscape:label="Torn edges"
|
|
||||||
inkscape:menu="Distort"
|
|
||||||
inkscape:menu-tooltip="Displace the outside of shapes and pictures without altering their content"
|
|
||||||
height="1.4"
|
|
||||||
y="-0.2"
|
|
||||||
width="1.4"
|
|
||||||
x="-0.2"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feTurbulence
|
|
||||||
id="feTurbulence4266"
|
|
||||||
baseFrequency="0.05"
|
|
||||||
numOctaves="5"
|
|
||||||
type="fractalNoise"
|
|
||||||
result="result91" />
|
|
||||||
<feDisplacementMap
|
|
||||||
id="feDisplacementMap4268"
|
|
||||||
in2="result91"
|
|
||||||
scale="25"
|
|
||||||
result="result5"
|
|
||||||
xChannelSelector="R"
|
|
||||||
in="SourceGraphic" />
|
|
||||||
<feComposite
|
|
||||||
id="feComposite4270"
|
|
||||||
in2="result5"
|
|
||||||
in="SourceGraphic"
|
|
||||||
operator="atop" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
id="filter4378"
|
|
||||||
height="2"
|
|
||||||
width="1.6"
|
|
||||||
y="-0.5"
|
|
||||||
x="-0.3"
|
|
||||||
inkscape:label="Chalk and sponge"
|
|
||||||
inkscape:menu="Distort"
|
|
||||||
inkscape:menu-tooltip="Low turbulence gives sponge look and high turbulence chalk"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feTurbulence
|
|
||||||
id="feTurbulence4380"
|
|
||||||
type="fractalNoise"
|
|
||||||
numOctaves="3"
|
|
||||||
baseFrequency="1"
|
|
||||||
seed="0"
|
|
||||||
result="result0" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix4382"
|
|
||||||
result="result4"
|
|
||||||
values="0"
|
|
||||||
type="saturate" />
|
|
||||||
<feComposite
|
|
||||||
id="feComposite4384"
|
|
||||||
in2="result4"
|
|
||||||
in="SourceGraphic"
|
|
||||||
operator="arithmetic"
|
|
||||||
k1="1.25"
|
|
||||||
k2="0.5"
|
|
||||||
k3="0.5"
|
|
||||||
result="result2" />
|
|
||||||
<feBlend
|
|
||||||
id="feBlend4386"
|
|
||||||
in2="SourceGraphic"
|
|
||||||
result="result5"
|
|
||||||
mode="normal"
|
|
||||||
in="result2" />
|
|
||||||
<feComposite
|
|
||||||
id="feComposite4388"
|
|
||||||
in2="SourceGraphic"
|
|
||||||
in="result5"
|
|
||||||
operator="in"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphicAlpha"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
|
||||||
id="feColorMatrix4396" />
|
|
||||||
<feTurbulence
|
|
||||||
id="feTurbulence4398"
|
|
||||||
baseFrequency="0.4"
|
|
||||||
type="fractalNoise"
|
|
||||||
seed="0"
|
|
||||||
numOctaves="5"
|
|
||||||
result="result1"
|
|
||||||
in="fbSourceGraphic" />
|
|
||||||
<feOffset
|
|
||||||
id="feOffset4400"
|
|
||||||
dx="-5"
|
|
||||||
dy="-5"
|
|
||||||
result="result2" />
|
|
||||||
<feDisplacementMap
|
|
||||||
id="feDisplacementMap4402"
|
|
||||||
in2="result1"
|
|
||||||
xChannelSelector="R"
|
|
||||||
yChannelSelector="G"
|
|
||||||
scale="30"
|
|
||||||
in="fbSourceGraphic" />
|
|
||||||
</filter>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4450-7"
|
|
||||||
id="radialGradient4444-1"
|
|
||||||
cx="64.285774"
|
|
||||||
cy="1043.2878"
|
|
||||||
fx="64.285774"
|
|
||||||
fy="1043.2878"
|
|
||||||
r="88.002487"
|
|
||||||
gradientTransform="matrix(1.1992386,5.9441478e-4,-3.5638716e-5,0.07009077,-3.2838697,967.86618)"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4450-7">
|
|
||||||
<stop
|
|
||||||
id="stop4452-4"
|
|
||||||
offset="0"
|
|
||||||
style="stop-color:#464646;stop-opacity:1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#000000;stop-opacity:1;"
|
|
||||||
offset="0.32966033"
|
|
||||||
id="stop4454-0" />
|
|
||||||
<stop
|
|
||||||
id="stop4456-9"
|
|
||||||
offset="1"
|
|
||||||
style="stop-color:#3c3c3c;stop-opacity:1;" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4552"
|
|
||||||
id="radialGradient4558"
|
|
||||||
cx="50.773666"
|
|
||||||
cy="6.0489755"
|
|
||||||
fx="50.773666"
|
|
||||||
fy="6.0489755"
|
|
||||||
r="87.131035"
|
|
||||||
gradientTransform="matrix(2.0085717,-0.00289837,8.7720163e-5,0.06079008,-11.424877,69.805546)"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4552"
|
|
||||||
id="radialGradient4602"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(2.0085717,-0.00289837,8.7720163e-5,0.06079008,-9.4248769,-24.194454)"
|
|
||||||
cx="50.773666"
|
|
||||||
cy="6.0489755"
|
|
||||||
fx="50.773666"
|
|
||||||
fy="6.0489755"
|
|
||||||
r="87.131035" />
|
|
||||||
<filter
|
|
||||||
id="filter4612"
|
|
||||||
inkscape:label="Evanescent"
|
|
||||||
inkscape:menu="Blurs"
|
|
||||||
inkscape:menu-tooltip="Blur the contents of objects, preserving the outline and adding progressive transparency at edges"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feGaussianBlur
|
|
||||||
id="feGaussianBlur4614"
|
|
||||||
result="result6"
|
|
||||||
stdDeviation="3"
|
|
||||||
in="SourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix4616"
|
|
||||||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 "
|
|
||||||
result="result7"
|
|
||||||
in="SourceGraphic" />
|
|
||||||
<feComposite
|
|
||||||
id="feComposite4618"
|
|
||||||
in2="result7"
|
|
||||||
operator="in"
|
|
||||||
in="result6" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4552"
|
|
||||||
id="linearGradient4624"
|
|
||||||
x1="97.76786"
|
|
||||||
y1="31.357143"
|
|
||||||
x2="97.85714"
|
|
||||||
y2="40.107143"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4630"
|
|
||||||
id="linearGradient4636"
|
|
||||||
x1="105.68665"
|
|
||||||
y1="51.994923"
|
|
||||||
x2="105.68665"
|
|
||||||
y2="63.066353"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(1.0105035,0,0,1,-1.9753048,-53.494924)" />
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4685"
|
|
||||||
id="radialGradient4691"
|
|
||||||
cx="119.76596"
|
|
||||||
cy="1013.6822"
|
|
||||||
fx="119.76596"
|
|
||||||
fy="1013.6822"
|
|
||||||
r="96.000001"
|
|
||||||
gradientTransform="matrix(0,-0.12228403,1.1786193,1.0993711e-8,-1093.9826,1055.1382)"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4693"
|
|
||||||
id="linearGradient4701"
|
|
||||||
x1="87.75"
|
|
||||||
y1="1036.1122"
|
|
||||||
x2="87.5"
|
|
||||||
y2="1045.8622"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
gradientTransform="translate(-0.71736204,-985.07272)"
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4693-7"
|
|
||||||
id="linearGradient4701-1"
|
|
||||||
x1="87.75"
|
|
||||||
y1="1036.1122"
|
|
||||||
x2="87.5"
|
|
||||||
y2="1045.8622"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4693-7">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#272726;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4695-4" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#808080;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop4697-0" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4685-4"
|
|
||||||
id="radialGradient4691-9"
|
|
||||||
cx="119.76596"
|
|
||||||
cy="1013.6822"
|
|
||||||
fx="119.76596"
|
|
||||||
fy="1013.6822"
|
|
||||||
r="96"
|
|
||||||
gradientTransform="matrix(0,-0.12228403,1.1786193,1.0993711e-8,-1093.9826,1055.1382)"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4685-4">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4687-8" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#6f8a91;stop-opacity:1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4689-8" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
r="96"
|
|
||||||
fy="1013.6822"
|
|
||||||
fx="119.76596"
|
|
||||||
cy="1013.6822"
|
|
||||||
cx="119.76596"
|
|
||||||
gradientTransform="matrix(0,-0.12228403,1.1786193,1.0993711e-8,-1094.7,70.065524)"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
id="radialGradient3092"
|
|
||||||
xlink:href="#linearGradient4685-4"
|
|
||||||
inkscape:collect="always" />
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4685-4"
|
|
||||||
id="radialGradient3122"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(0,-0.12228403,1.1786193,1.0993711e-8,-1093.9754,26.778383)"
|
|
||||||
cx="119.76596"
|
|
||||||
cy="1013.6822"
|
|
||||||
fx="119.76596"
|
|
||||||
fy="1013.6822"
|
|
||||||
r="96" />
|
|
||||||
</defs>
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="5.6568543"
|
|
||||||
inkscape:cx="122.54678"
|
|
||||||
inkscape:cy="-5.1363583"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer4"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1018"
|
|
||||||
inkscape:window-x="-8"
|
|
||||||
inkscape:window-y="-8"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer5"
|
|
||||||
inkscape:label="bg color"
|
|
||||||
style="display:none">
|
|
||||||
<rect
|
|
||||||
style="fill:#ff00ff;fill-opacity:1;fill-rule:nonzero;stroke:#ff00ff;stroke-width:0.64324963;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
|
||||||
id="rect4519"
|
|
||||||
width="191.35675"
|
|
||||||
height="23.35675"
|
|
||||||
x="0.32162482"
|
|
||||||
y="0.32162377" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
inkscape:label="bg"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-1028.3622)"
|
|
||||||
style="display:inline">
|
|
||||||
<rect
|
|
||||||
style="fill:url(#linearGradient4701);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.86400735;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
|
||||||
id="rect3803"
|
|
||||||
width="177.1826"
|
|
||||||
height="11.4773"
|
|
||||||
x="7.2250452"
|
|
||||||
y="1034.7675" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer2"
|
|
||||||
inkscape:label="bar"
|
|
||||||
style="display:inline"
|
|
||||||
transform="translate(0,8)">
|
|
||||||
<rect
|
|
||||||
style="fill:url(#radialGradient4602);fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
||||||
id="rect4600"
|
|
||||||
width="174.26207"
|
|
||||||
height="10.593416"
|
|
||||||
x="9.6705065"
|
|
||||||
y="-29.273685" />
|
|
||||||
<rect
|
|
||||||
y="64.726318"
|
|
||||||
x="7.6705065"
|
|
||||||
height="10.593416"
|
|
||||||
width="174.26207"
|
|
||||||
id="rect4474"
|
|
||||||
style="fill:url(#radialGradient4558);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter4612)" />
|
|
||||||
<rect
|
|
||||||
y="30.369171"
|
|
||||||
x="9.6705065"
|
|
||||||
height="10.593416"
|
|
||||||
width="174.26207"
|
|
||||||
id="rect4620"
|
|
||||||
style="fill:url(#linearGradient4624);fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
|
||||||
<rect
|
|
||||||
style="fill:url(#linearGradient4636);fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
||||||
id="rect4626"
|
|
||||||
width="176.09242"
|
|
||||||
height="10.593416"
|
|
||||||
x="7.7967758"
|
|
||||||
y="-1.1257526"
|
|
||||||
inkscape:export-filename="D:\gdev tools\Sprites\propios\Math Defense\progress-bar.png"
|
|
||||||
inkscape:export-xdpi="90"
|
|
||||||
inkscape:export-ydpi="90" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer4"
|
|
||||||
inkscape:label="fg"
|
|
||||||
style="display:inline">
|
|
||||||
<path
|
|
||||||
style="fill:url(#radialGradient3122);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.26178133;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
|
|
||||||
d="m 6.6308907,0.61910933 c -3.324,0 -6.00000003,2.67599997 -6.00000003,5.99999997 l 0,10.7499997 c 0,3.324 2.67600003,6 6.00000003,6 l 178.7499993,0 c 3.324,0 6,-2.676 6,-6 l 0,-10.7499997 c 0,-3.324 -2.676,-5.99999997 -6,-5.99999997 l -178.7499993,0 z m 0.59375,5.78124997 177.1874993,0 0,11.4999997 -177.1874993,0 0,-11.4999997 z"
|
|
||||||
id="rect4638-2"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
inkscape:export-filename="D:\gdev tools\Sprites\propios\Math Defense\progressbar-sample2.png"
|
|
||||||
inkscape:export-xdpi="90"
|
|
||||||
inkscape:export-ydpi="90" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer3"
|
|
||||||
inkscape:label="marker"
|
|
||||||
style="display:inline"
|
|
||||||
transform="translate(0,8)">
|
|
||||||
<path
|
|
||||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.08829999;stroke-miterlimit:4;stroke-opacity:1"
|
|
||||||
d="m 113.3769,-7.4558505 c -1.97469,0 -3.54957,1.4550698 -3.54957,3.2467467 0,1.0952171 0.59171,2.0690031 1.50779,2.656429 l 0,11.105349 c -0.91608,0.5874258 -1.5392,1.5612108 -1.5392,2.6564288 0,1.791676 1.60629,3.246747 3.58098,3.246747 1.97469,0 3.58099,-1.455071 3.58099,-3.246747 0,-1.212544 -0.73584,-2.2472668 -1.8219,-2.8040082 l 0,-10.8101902 c 1.08606,-0.5567417 1.8219,-1.5914648 1.8219,-2.8040084 0,-1.7916769 -1.6063,-3.2467467 -3.58099,-3.2467467 z"
|
|
||||||
id="rect4652"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
inkscape:export-filename="D:\gdev tools\Sprites\propios\Math Defense\progress-marker.png"
|
|
||||||
inkscape:export-xdpi="90"
|
|
||||||
inkscape:export-ydpi="90" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
@ -9,10 +9,6 @@ out vec4 outColor;
|
|||||||
uniform sampler2D textureSampler;
|
uniform sampler2D textureSampler;
|
||||||
uniform vec3 lightColor;
|
uniform vec3 lightColor;
|
||||||
|
|
||||||
uniform vec3 ghostColor;
|
|
||||||
uniform float pulse;
|
|
||||||
uniform bool ghostMode;
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 unitNormal = normalize(surfaceNormal);
|
vec3 unitNormal = normalize(surfaceNormal);
|
||||||
vec3 unitToLightDir = normalize(toLightVector);
|
vec3 unitToLightDir = normalize(toLightVector);
|
||||||
@ -20,11 +16,5 @@ void main(void) {
|
|||||||
float cosTheta = dot(unitNormal, unitToLightDir);
|
float cosTheta = dot(unitNormal, unitToLightDir);
|
||||||
float brightness = max(cosTheta, 0.2);
|
float brightness = max(cosTheta, 0.2);
|
||||||
vec3 diffuse = brightness * lightColor;
|
vec3 diffuse = brightness * lightColor;
|
||||||
|
outColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
||||||
vec4 finalColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
|
||||||
if(ghostMode) {
|
|
||||||
finalColor = vec4(mix(finalColor.xyz, ghostColor, 0.5) * pulse, 1.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
outColor = finalColor;
|
|
||||||
}
|
}
|
||||||
@ -5,23 +5,14 @@ in vec2 textureCoords;
|
|||||||
out vec4 color;
|
out vec4 color;
|
||||||
|
|
||||||
uniform sampler2D guiTexture;
|
uniform sampler2D guiTexture;
|
||||||
uniform sampler2D backgroundTexture;
|
|
||||||
|
|
||||||
uniform float brightness; // 1.0 = normal
|
uniform float brightness; // 1.0 = normal
|
||||||
uniform vec3 tintColor; // (0,0,0) = kein Tint
|
uniform vec3 tintColor; // (0,0,0) = kein Tint
|
||||||
uniform float tintStrength; // 0.0 = aus
|
uniform float tintStrength; // 0.0 = aus
|
||||||
|
|
||||||
uniform bool hasForeground;
|
|
||||||
uniform bool hasBackground;
|
|
||||||
|
|
||||||
uniform float dimFactor;
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 fg = hasForeground ? texture(guiTexture, textureCoords) : vec4(0.0);
|
vec4 textureColor = texture(guiTexture, textureCoords);
|
||||||
vec4 bg = hasBackground ? texture(backgroundTexture, textureCoords) : vec4(0.0);
|
|
||||||
|
|
||||||
|
|
||||||
vec4 textureColor = mix(bg, fg, fg.a);
|
|
||||||
|
|
||||||
textureColor.rgb *= brightness;
|
textureColor.rgb *= brightness;
|
||||||
|
|
||||||
@ -29,5 +20,4 @@ void main(void) {
|
|||||||
textureColor.rgb = mix(textureColor.rgb, tintColor, tintStrength);
|
textureColor.rgb = mix(textureColor.rgb, tintColor, tintStrength);
|
||||||
|
|
||||||
color = textureColor;
|
color = textureColor;
|
||||||
color *= dimFactor;
|
|
||||||
}
|
}
|
||||||
@ -8,5 +8,5 @@ uniform mat4 transformationMatrix;
|
|||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
gl_Position = transformationMatrix * vec4(position, 0.0, 1.0);
|
gl_Position = transformationMatrix * vec4(position, 0.0, 1.0);
|
||||||
textureCoords = vec2((position.x + 1.0)/ 2.0, (position.y + 1.0)/2.0);
|
textureCoords = vec2((position.x + 1.0)/ 2.0, 1 - (position.y + 1.0)/2.0);
|
||||||
}
|
}
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#version 400 core
|
|
||||||
|
|
||||||
uniform vec3 color;
|
|
||||||
|
|
||||||
out vec4 fragColor;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
fragColor = vec4(color, 1.0);
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#version 400 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 position;
|
|
||||||
|
|
||||||
uniform mat4 transformationMatrix;
|
|
||||||
uniform mat4 viewProjectionMatrix;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_Position = viewProjectionMatrix * transformationMatrix * vec4(position, 1.0);
|
|
||||||
}
|
|
||||||
@ -10,7 +10,6 @@ uniform sampler2D textureSampler;
|
|||||||
uniform vec3 lightColor;
|
uniform vec3 lightColor;
|
||||||
|
|
||||||
uniform bool isHighlighted;
|
uniform bool isHighlighted;
|
||||||
uniform vec3 highLightColor;
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec3 unitNormal = normalize(surfaceNormal);
|
vec3 unitNormal = normalize(surfaceNormal);
|
||||||
@ -21,7 +20,7 @@ void main(void) {
|
|||||||
vec3 diffuse = brightness * lightColor;
|
vec3 diffuse = brightness * lightColor;
|
||||||
|
|
||||||
if(isHighlighted) {
|
if(isHighlighted) {
|
||||||
outColor = vec4(highLightColor, 1.0);
|
outColor = vec4(1.0f, 1.0f, 0.0f, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
outColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
outColor = vec4(diffuse, 1.0f) * texture(textureSampler, pass_textureCoords);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,8 @@ out vec4 outColor;
|
|||||||
|
|
||||||
uniform sampler2D text;
|
uniform sampler2D text;
|
||||||
uniform vec3 textColor;
|
uniform vec3 textColor;
|
||||||
uniform float dimFactor;
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
float alpha = texture(text, pass_texCoords).r;
|
float alpha = texture(text, pass_texCoords).r;
|
||||||
outColor = vec4(textColor, alpha);
|
outColor = vec4(textColor, alpha);
|
||||||
outColor *= dimFactor;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
#version 400 core
|
|
||||||
|
|
||||||
in vec2 passTexCoords;
|
|
||||||
out vec4 outColor;
|
|
||||||
|
|
||||||
uniform sampler2D spriteTexture;
|
|
||||||
uniform float alpha;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
vec4 tex = texture(spriteTexture, passTexCoords);
|
|
||||||
outColor = vec4(tex.rgb, tex.a * alpha);
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#version 400 core
|
|
||||||
|
|
||||||
layout (location = 0) in vec3 position;
|
|
||||||
layout (location = 1) in vec2 texCoords;
|
|
||||||
|
|
||||||
out vec2 passTexCoords;
|
|
||||||
|
|
||||||
uniform mat4 projectionViewMatrix;
|
|
||||||
uniform mat4 modelMatrix;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_Position = projectionViewMatrix * modelMatrix * vec4(position, 1.0);
|
|
||||||
passTexCoords = texCoords;
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 553 KiB |
|
Before Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 54 KiB |
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"font": {
|
|
||||||
"path": "/usr/share/fonts/TTF/DejaVuSans.ttf",
|
|
||||||
"sizes": {
|
|
||||||
"small": 18,
|
|
||||||
"medium": 28,
|
|
||||||
"large": 48
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 10 KiB |
25526
lib/nlohmann/json.hpp
@ -4,28 +4,19 @@
|
|||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
#include "EngineTime.h"
|
#include "../layer/Layer.h"
|
||||||
#include "../../game/scenes/main/events/QuitEvent.h"
|
|
||||||
#include "../platform/glfw/InputManager.h"
|
#include "../platform/glfw/InputManager.h"
|
||||||
#include "inputsOutputs/stateControl/StateRegistry.h"
|
|
||||||
#include "../core/scenes/SceneManager.h"
|
|
||||||
#include "../core/scenes/Scene.h"
|
|
||||||
Application* Application::instance = nullptr;
|
Application* Application::instance = nullptr;
|
||||||
|
|
||||||
void Application::updateTime() {
|
void Application::pushLayer(Layer* layer) {
|
||||||
const auto now = static_cast<float>(glfwGetTime());
|
layers.push_back(layer);
|
||||||
EngineTime::deltaTime = now - lastFrame;
|
layer->onAttach();
|
||||||
EngineTime::totalTime += EngineTime::deltaTime;
|
|
||||||
lastFrame = now;
|
|
||||||
|
|
||||||
// printf("Frametime: %f\n", EngineTime::deltaTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::Application()
|
Application::Application()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
context = std::make_unique<EngineContext>();
|
|
||||||
sceneManager = std::make_unique<SceneManager>(*context.get());
|
|
||||||
|
|
||||||
WindowProps window_props = WindowProps();
|
WindowProps window_props = WindowProps();
|
||||||
window_props.Width = 1280;
|
window_props.Width = 1280;
|
||||||
@ -34,13 +25,6 @@ Application::Application()
|
|||||||
window_props.VSync = true;
|
window_props.VSync = true;
|
||||||
|
|
||||||
window.reset(Window::Create(window_props));
|
window.reset(Window::Create(window_props));
|
||||||
keyboard = std::make_unique<Keyboard>(*window);
|
|
||||||
mouse = std::make_unique<Mouse>(*window);
|
|
||||||
stateManager = std::make_unique<StateManager>(StateRegistry::get().empty, StateRegistry::get().game);
|
|
||||||
|
|
||||||
EventBus::getInstance().subscribe<QuitEvent>([this](const QuitEvent& e) {
|
|
||||||
window->close();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application()
|
Application::~Application()
|
||||||
@ -50,17 +34,12 @@ Application::~Application()
|
|||||||
void Application::run() {
|
void Application::run() {
|
||||||
while (!window->shouldClose())
|
while (!window->shouldClose())
|
||||||
{
|
{
|
||||||
|
for (Layer* layer : layers)
|
||||||
|
{
|
||||||
|
layer->onUpdate();
|
||||||
|
}
|
||||||
window->OnUpdate();
|
window->OnUpdate();
|
||||||
updateTime();
|
|
||||||
|
|
||||||
sceneManager->update();
|
|
||||||
sceneManager->render();
|
|
||||||
|
|
||||||
InputManager::update();
|
InputManager::update();
|
||||||
|
|
||||||
mouse->update();
|
|
||||||
keyboard->update();
|
|
||||||
stateManager->updateState();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,17 +7,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "EngineContext.h"
|
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "events/EventBus.h"
|
|
||||||
#include "inputsOutputs/inputs/Keyboard.h"
|
|
||||||
#include "inputsOutputs/inputs/Mouse.h"
|
|
||||||
#include "inputsOutputs/stateControl/StateManager.h"
|
|
||||||
#include "inputsOutputs/stateControl/states/State.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
class Layer;
|
||||||
class SceneManager;
|
|
||||||
|
|
||||||
class Application
|
class Application
|
||||||
{
|
{
|
||||||
@ -30,21 +23,16 @@ public:
|
|||||||
|
|
||||||
static Application& getInstance();
|
static Application& getInstance();
|
||||||
[[nodiscard]] Window& getWindow() const {return *window;}
|
[[nodiscard]] Window& getWindow() const {return *window;}
|
||||||
std::unique_ptr<Keyboard> keyboard;
|
|
||||||
std::unique_ptr<Mouse> mouse;
|
|
||||||
std::unique_ptr<StateManager> stateManager;
|
|
||||||
std::shared_ptr<GameState> gameState;
|
|
||||||
std::unique_ptr<SceneManager> sceneManager;
|
|
||||||
std::unique_ptr<EngineContext> context;
|
|
||||||
private:
|
private:
|
||||||
bool running = true;
|
bool running = true;
|
||||||
std::unique_ptr<Window> window;
|
std::unique_ptr<Window> window;
|
||||||
|
|
||||||
static Application* instance;
|
static Application* instance;
|
||||||
|
|
||||||
|
std::vector<Layer*> layers;
|
||||||
|
|
||||||
void updateTime();
|
protected:
|
||||||
|
void pushLayer(Layer* layer);
|
||||||
float lastFrame;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,17 +4,17 @@
|
|||||||
|
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ranges>
|
|
||||||
|
|
||||||
EntityID EntityManager::createEntity() {
|
EntityID EntityManager::createEntity() {
|
||||||
const EntityID id = nextID++;
|
const EntityID id = nextID++;
|
||||||
entities.push_back(id);
|
entities.push_back(id);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityManager::destroyEntity(const EntityID entity) {
|
void EntityManager::destroyEntity(EntityID entity) {
|
||||||
std::erase(entities, entity);
|
entities.erase(std::remove(entities.begin(), entities.end(), entity), entities.end());
|
||||||
for (auto &compMap: components | std::views::values) {
|
transforms.erase(entity);
|
||||||
compMap.erase(entity);
|
models.erase(entity);
|
||||||
}
|
tileRenderComponents.erase(entity);
|
||||||
|
tileGameplayComponents.erase(entity);
|
||||||
|
buildings.erase(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
#define ENTITYMANAGER_H
|
#define ENTITYMANAGER_H
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <typeindex>
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -27,7 +26,13 @@ private:
|
|||||||
EntityID nextID = 1;
|
EntityID nextID = 1;
|
||||||
std::vector<EntityID> entities;
|
std::vector<EntityID> entities;
|
||||||
|
|
||||||
std::unordered_map<std::type_index, std::unordered_map<EntityID, std::shared_ptr<Component>>> components;
|
std::unordered_map<EntityID, std::shared_ptr<TransformComponent>> transforms;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<ModelComponent>> models;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<TileRenderComponent>> tileRenderComponents;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<TileGameplayComponent>> tileGameplayComponents;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<MapEntityComponent>> mapEntityComponents;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<BuildingComponent>> buildings;
|
||||||
|
std::unordered_map<EntityID, std::shared_ptr<OwnerComponent>> owners;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EntityID createEntity();
|
EntityID createEntity();
|
||||||
@ -35,28 +40,50 @@ public:
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void addComponent(EntityID entity, std::shared_ptr<T> component) {
|
void addComponent(EntityID entity, std::shared_ptr<T> component) {
|
||||||
auto& compMap = components[typeid(T)];
|
if constexpr (std::is_same_v<T, TransformComponent>) {
|
||||||
compMap[entity] = component;
|
transforms[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, ModelComponent>) {
|
||||||
|
models[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, TileRenderComponent>) {
|
||||||
|
tileRenderComponents[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, TileGameplayComponent>) {
|
||||||
|
tileGameplayComponents[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, MapEntityComponent>) {
|
||||||
|
mapEntityComponents[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, BuildingComponent>) {
|
||||||
|
buildings[entity] = component;
|
||||||
|
} else if constexpr (std::is_same_v<T, OwnerComponent>) {
|
||||||
|
owners[entity] = component;
|
||||||
|
} else {
|
||||||
|
static_assert(sizeof(T) == 0, "Component-Typ nicht unterstützt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::shared_ptr<T> getComponent(EntityID entity) {
|
std::shared_ptr<T> getComponent(EntityID entity) {
|
||||||
auto it = components.find(typeid(T));
|
if constexpr (std::is_same_v<T, TransformComponent>) {
|
||||||
if (it != components.end()) {
|
auto it = transforms.find(entity);
|
||||||
auto& compMap = it->second;
|
return (it != transforms.end()) ? it->second : nullptr;
|
||||||
auto compIt = compMap.find(entity);
|
} else if constexpr (std::is_same_v<T, ModelComponent>) {
|
||||||
if (compIt != compMap.end()) {
|
auto it = models.find(entity);
|
||||||
return std::static_pointer_cast<T>(compIt->second);
|
return (it != models.end()) ? it->second : nullptr;
|
||||||
}
|
} else if constexpr (std::is_same_v<T, TileRenderComponent>) {
|
||||||
}
|
auto it = tileRenderComponents.find(entity);
|
||||||
return nullptr;
|
return (it != tileRenderComponents.end()) ? it->second : nullptr;
|
||||||
}
|
} else if constexpr (std::is_same_v<T, TileGameplayComponent>) {
|
||||||
|
auto it = tileGameplayComponents.find(entity);
|
||||||
template<typename T>
|
return (it != tileGameplayComponents.end()) ? it->second : nullptr;
|
||||||
void removeComponent(EntityID entity) {
|
} else if constexpr (std::is_same_v<T, MapEntityComponent>) {
|
||||||
auto it = components.find(typeid(T));
|
auto it = mapEntityComponents.find(entity);
|
||||||
if (it != components.end()) {
|
return (it != mapEntityComponents.end()) ? it->second : nullptr;
|
||||||
it->second.erase(entity);
|
} else if constexpr (std::is_same_v<T, BuildingComponent>) {
|
||||||
|
auto it = buildings.find(entity);
|
||||||
|
return (it != buildings.end()) ? it->second : nullptr;
|
||||||
|
} else if constexpr (std::is_same_v<T, OwnerComponent>) {
|
||||||
|
auto it = owners.find(entity);
|
||||||
|
return (it != owners.end()) ? it->second : nullptr;
|
||||||
|
} else {
|
||||||
|
static_assert(sizeof(T) == 0, "Component-Typ nicht unterstützt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,47 +4,16 @@
|
|||||||
|
|
||||||
#ifndef MODELCOMPONENT_H
|
#ifndef MODELCOMPONENT_H
|
||||||
#define MODELCOMPONENT_H
|
#define MODELCOMPONENT_H
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "../../renderer/model/ModelStages.h"
|
|
||||||
#include "../../renderer/model/TexturedModel.h"
|
#include "../../renderer/model/TexturedModel.h"
|
||||||
#include "../../toolbox/IndexedMap.h"
|
|
||||||
|
|
||||||
|
|
||||||
class ModelComponent: public Component {
|
class ModelComponent: public Component {
|
||||||
public:
|
public:
|
||||||
ModelComponent(const std::shared_ptr<ModelStages> &modelStages, std::string modelname): modelName(std::move(modelname)), currentStage(0) {
|
std::shared_ptr<TexturedModel> model;
|
||||||
for (const auto& stage : modelStages->getModelStages()) {
|
ModelComponent(std::shared_ptr<TexturedModel> model) : model(std::move(model)) {};
|
||||||
stages.insert(stage.getStageName(), stage.getModelOfModelStage());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ModelComponent(std::shared_ptr<TexturedModel> model, std::string modelname): modelName(std::move(modelname)), currentStage(0) {
|
|
||||||
stages["default"] = std::move(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateStage(const std::string& updatedStage) {
|
|
||||||
if (stages.containsKey(updatedStage)) {
|
|
||||||
size_t updatedStageIndex = stages.indexOfKey(updatedStage);
|
|
||||||
currentStage = updatedStageIndex;
|
|
||||||
} else {
|
|
||||||
std::cerr << "Stage " << updatedStage << " not found!" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] std::shared_ptr<TexturedModel> getActiveModel() const{
|
|
||||||
return stages.atIndex(currentStage);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] const std::string& getModelName() const {return modelName;}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string modelName;
|
|
||||||
IndexedMap<std::string, std::shared_ptr<TexturedModel>> stages;
|
|
||||||
size_t currentStage;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by sebastian on 14.02.26.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "ModelStateComponent.h"
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by sebastian on 14.02.26.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef DICEWARS_SIEDLER_MODELSTATECOMPONENT_H
|
|
||||||
#define DICEWARS_SIEDLER_MODELSTATECOMPONENT_H
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "Component.h"
|
|
||||||
|
|
||||||
|
|
||||||
class ModelStateComponent : public Component{
|
|
||||||
public:
|
|
||||||
std::unordered_map<std::string, float> params;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //DICEWARS_SIEDLER_MODELSTATECOMPONENT_H
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by sebastian on 21.02.26.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "RenderStateComponent.h"
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by sebastian on 21.02.26.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef DICEWARS_SIEDLER_RENDERSTATECOMPONENT_H
|
|
||||||
#define DICEWARS_SIEDLER_RENDERSTATECOMPONENT_H
|
|
||||||
#include "Component.h"
|
|
||||||
|
|
||||||
|
|
||||||
class RenderStateComponent: public Component {
|
|
||||||
public:
|
|
||||||
bool visible = true;
|
|
||||||
glm::vec3 ghostColor = glm::vec3(1.0, 1.0,1.0f);
|
|
||||||
bool ghostMode = false;
|
|
||||||
float pulse = 1.0f;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //DICEWARS_SIEDLER_RENDERSTATECOMPONENT_H
|
|
||||||
@ -4,61 +4,21 @@
|
|||||||
|
|
||||||
#include "RenderSystem.h"
|
#include "RenderSystem.h"
|
||||||
|
|
||||||
#include "ModelStateComponent.h"
|
|
||||||
#include "RenderStateComponent.h"
|
|
||||||
#include "../../renderer/loader/AssetManager.h"
|
|
||||||
|
|
||||||
void RenderSystem::render(EntityManager &entityManager, MasterRenderer &renderer) {
|
void RenderSystem::render(EntityManager &entityManager, MasterRenderer &renderer) {
|
||||||
for (auto id : entityManager.getAllEntities()) {
|
for (auto id : entityManager.getAllEntities()) {
|
||||||
|
|
||||||
auto transform = entityManager.getComponent<TransformComponent>(id);
|
auto transform = entityManager.getComponent<TransformComponent>(id);
|
||||||
auto model = entityManager.getComponent<ModelComponent>(id);
|
auto model = entityManager.getComponent<ModelComponent>(id);
|
||||||
auto tileRenderingComponent = entityManager.getComponent<TileRenderComponent>(id);
|
auto tileRenderingComponent = entityManager.getComponent<TileRenderComponent>(id);
|
||||||
auto modelStateComponent = entityManager.getComponent<ModelStateComponent>(id);
|
|
||||||
auto ownerComponent = entityManager.getComponent<OwnerComponent>(id);
|
|
||||||
auto worldSpriteComponent = entityManager.getComponent<WorldSpriteComponent>(id);
|
|
||||||
auto renderStateComponent = entityManager.getComponent<RenderStateComponent>(id);
|
|
||||||
|
|
||||||
if (renderStateComponent && !renderStateComponent->visible) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modelStateComponent) {
|
|
||||||
updateModelStage(model.get(), modelStateComponent.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!transform || !model) continue;
|
if (!transform || !model) continue;
|
||||||
|
|
||||||
if (worldSpriteComponent) {
|
|
||||||
renderer.submitWorldSprite(transform, worldSpriteComponent, worldSpriteComponent->texture);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tileRenderingComponent) {
|
if (tileRenderingComponent) {
|
||||||
renderer.submitTerrainTile(transform, model, tileRenderingComponent, ownerComponent);
|
renderer.submitTerrainTile(transform, model, tileRenderingComponent);
|
||||||
} else {
|
} else {
|
||||||
Entity entity = Entity(model->getActiveModel(), transform->position, transform->rotation.x, transform->rotation.y, transform->rotation.z, transform->scale);
|
Entity entity = Entity(model->model, transform->position, transform->rotation.x, transform->rotation.y, transform->rotation.z, transform->scale);
|
||||||
entity.setRenderState(renderStateComponent);
|
|
||||||
renderer.submitEntity(std::make_unique<Entity>(entity));
|
renderer.submitEntity(std::make_unique<Entity>(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderSystem::updateModelStage(ModelComponent *model, ModelStateComponent *state) {
|
|
||||||
std::string bestStage = "default";
|
|
||||||
|
|
||||||
auto modelStages = AssetManager::getModelStages(model->getModelName());
|
|
||||||
|
|
||||||
|
|
||||||
for (const auto& stage : modelStages->getModelStages()) {
|
|
||||||
auto it = state->params.find(stage.getCondition().key);
|
|
||||||
if (it == state->params.end()) continue;
|
|
||||||
|
|
||||||
float value = it->second;
|
|
||||||
if (value >= stage.getCondition().min && value <= stage.getCondition().max) {
|
|
||||||
bestStage = stage.getStageName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
model->updateStage(bestStage);
|
|
||||||
}
|
|
||||||
|
|||||||