From de656d7bbcb74377159ba811a76b91cd92541bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Wed, 22 May 2024 17:15:13 +0200 Subject: [PATCH] Packaging updates (#846) --- .github/workflows/build-nightly.yml | 88 ++--------- .github/workflows/build-pr.yml | 88 ++--------- .github/workflows/build.yml | 88 ++--------- Content/Content.vcxitems | 43 ++++++ Content/Content.vcxitems.filters | 105 +++++++++++++ {Editor => Content}/terrain/base.jpg | Bin {Editor => Content}/terrain/base_nor.jpg | Bin {Editor => Content}/terrain/bricks.jpg | Bin {Editor => Content}/terrain/bricks_nor.jpg | Bin {Editor => Content}/terrain/darkrock.jpg | Bin {Editor => Content}/terrain/darkrock_nor.jpg | Bin {Editor => Content}/terrain/foil.jpg | Bin {Editor => Content}/terrain/foil_nor.jpg | Bin {Editor => Content}/terrain/grass.ini | 0 {Editor => Content}/terrain/grassparticle.dds | Bin {Editor => Content}/terrain/ground.jpg | Bin {Editor => Content}/terrain/ground2.jpg | Bin {Editor => Content}/terrain/ground2_nor.jpg | Bin {Editor => Content}/terrain/ground_nor.jpg | Bin {Editor => Content}/terrain/high_altitude.jpg | Bin .../terrain/high_altitude_nor.jpg | Bin {Editor => Content}/terrain/lava.jpg | Bin {Editor => Content}/terrain/lava_emi.jpg | Bin {Editor => Content}/terrain/lava_nor.jpg | Bin {Editor => Content}/terrain/licenses.txt | 0 {Editor => Content}/terrain/low_altitude.jpg | Bin .../terrain/low_altitude_nor.jpg | Bin {Editor => Content}/terrain/metalplate.jpg | Bin .../terrain/metalplate_nor.jpg | Bin {Editor => Content}/terrain/pavingstone.jpg | Bin .../terrain/pavingstone_nor.jpg | Bin {Editor => Content}/terrain/props.ini | 0 {Editor => Content}/terrain/props.wiscene | Bin {Editor => Content}/terrain/rock.jpg | Bin {Editor => Content}/terrain/rock_nor.jpg | Bin {Editor => Content}/terrain/slope.jpg | Bin {Editor => Content}/terrain/slope_nor.jpg | Bin {Editor => Content}/terrain/tactilepaving.jpg | Bin .../terrain/tactilepaving_nor.jpg | Bin Editor/CMakeLists.txt | 3 - Editor/Editor_SOURCE.vcxitems | 138 ------------------ Editor/Editor_SOURCE.vcxitems.filters | 107 -------------- Editor/TerrainWindow.cpp | 80 +++++----- Editor/Translator.cpp | 8 + WickedEngine/wiTerrain.cpp | 5 +- 45 files changed, 240 insertions(+), 513 deletions(-) rename {Editor => Content}/terrain/base.jpg (100%) rename {Editor => Content}/terrain/base_nor.jpg (100%) rename {Editor => Content}/terrain/bricks.jpg (100%) rename {Editor => Content}/terrain/bricks_nor.jpg (100%) rename {Editor => Content}/terrain/darkrock.jpg (100%) rename {Editor => Content}/terrain/darkrock_nor.jpg (100%) rename {Editor => Content}/terrain/foil.jpg (100%) rename {Editor => Content}/terrain/foil_nor.jpg (100%) rename {Editor => Content}/terrain/grass.ini (100%) rename {Editor => Content}/terrain/grassparticle.dds (100%) rename {Editor => Content}/terrain/ground.jpg (100%) rename {Editor => Content}/terrain/ground2.jpg (100%) rename {Editor => Content}/terrain/ground2_nor.jpg (100%) rename {Editor => Content}/terrain/ground_nor.jpg (100%) rename {Editor => Content}/terrain/high_altitude.jpg (100%) rename {Editor => Content}/terrain/high_altitude_nor.jpg (100%) rename {Editor => Content}/terrain/lava.jpg (100%) rename {Editor => Content}/terrain/lava_emi.jpg (100%) rename {Editor => Content}/terrain/lava_nor.jpg (100%) rename {Editor => Content}/terrain/licenses.txt (100%) rename {Editor => Content}/terrain/low_altitude.jpg (100%) rename {Editor => Content}/terrain/low_altitude_nor.jpg (100%) rename {Editor => Content}/terrain/metalplate.jpg (100%) rename {Editor => Content}/terrain/metalplate_nor.jpg (100%) rename {Editor => Content}/terrain/pavingstone.jpg (100%) rename {Editor => Content}/terrain/pavingstone_nor.jpg (100%) rename {Editor => Content}/terrain/props.ini (100%) rename {Editor => Content}/terrain/props.wiscene (100%) rename {Editor => Content}/terrain/rock.jpg (100%) rename {Editor => Content}/terrain/rock_nor.jpg (100%) rename {Editor => Content}/terrain/slope.jpg (100%) rename {Editor => Content}/terrain/slope_nor.jpg (100%) rename {Editor => Content}/terrain/tactilepaving.jpg (100%) rename {Editor => Content}/terrain/tactilepaving_nor.jpg (100%) diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml index 85d59c7e6..4cb04a4ec 100644 --- a/.github/workflows/build-nightly.yml +++ b/.github/workflows/build-nightly.yml @@ -9,11 +9,7 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: nuget/setup-nuget@v1 - with: - nuget-api-key: ${{ secrets.NuGetAPIKey }} - - run: nuget restore WickedEngine.sln + - uses: actions/checkout@v4 - name: Build shell: cmd run: | @@ -21,7 +17,8 @@ jobs: cd "WickedEngine" "../BUILD/x64/Release/OfflineShaderCompiler/OfflineShaderCompiler.exe" hlsl6 spirv shaderdump strip_reflection cd .. - "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:rebuild /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:clean /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:Editor_Windows /m /p:Configuration=Release /p:Platform=x64 - name: Move files shell: cmd @@ -29,18 +26,14 @@ jobs: move BUILD\x64\Release\Editor_Windows\Editor_Windows.exe .\ move Editor\config.ini .\ move Editor\startup.lua .\ - move Editor\terrain .\ move Editor\languages .\ move Editor\fonts .\ - move Content\Documentation .\ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Windows) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini @@ -51,7 +44,7 @@ jobs: linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies run: | @@ -74,90 +67,33 @@ jobs: - name: Move files run: | - mv build/Editor/WickedEngineEditor ./ + mv build/Editor/WickedEngineEditor ./Editor_Linux mv Editor/config.ini ./ mv Editor/startup.lua ./ - mv Editor/terrain ./ mv Editor/languages ./ mv Editor/fonts ./ - mv Content/Documentation ./ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Linux) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini startup.lua - WickedEngineEditor + Editor_Linux content: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Package Content - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Content path: | + Content/Documentation Content/models Content/scripts - - - #linux-steamdeck: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - - # - name: Install dependencies - # run: | - # sudo apt update - # sudo apt install libsdl2-dev - - # - name: Build - # run: | - # mkdir build - # echo "---Building Command Strings---" - # echo -e "#!/bin/bash \ - # \nmkdir -p $(dirname $PWD) \ - # \nln -s /build $PWD \ - # \ncd /build/build \ - # \ncmake .. -DCMAKE_BUILD_TYPE=Release \ - # \nmake \ - # \necho \"---Generating Shader Dump---\" \ - # \ncd WickedEngine \ - # \n./offlineshadercompiler spirv rebuild shaderdump\nmv wiShaderDump.h ../../WickedEngine/ \ - # \necho \"---Rebuilding with ShaderDump---\" \ - # \ncd .. \ - # \nmake -B" > build.sh - # chmod +x build.sh - # echo "---Executing Containerized Build---" - # podman run --name sniper -v $PWD:/build registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest /build/build.sh - # podman container rm sniper - - # - name: Move files - # run: | - # mv build/Editor/WickedEngineEditor ./ - # mv Editor/config.ini ./ - # mv Editor/startup.lua ./ - # mv Editor/terrain ./ - # mv Editor/languages ./ - # mv Editor/fonts ./ - # mv Content/Documentation ./ - - # - name: Package Editor - # uses: actions/upload-artifact@v2 - # with: - # name: Editor (Linux - Steam Deck) - # path: | - # Documentation/ - # terrain/ - # languages/ - # fonts/ - # config.ini - # startup.lua - # WickedEngineEditor + Content/terrain diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 21a5ad050..f5f4603aa 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -8,11 +8,7 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: nuget/setup-nuget@v1 - with: - nuget-api-key: ${{ secrets.NuGetAPIKey }} - - run: nuget restore WickedEngine.sln + - uses: actions/checkout@v4 - name: Build shell: cmd run: | @@ -20,7 +16,8 @@ jobs: cd "WickedEngine" "../BUILD/x64/Release/OfflineShaderCompiler/OfflineShaderCompiler.exe" hlsl6 spirv shaderdump strip_reflection cd .. - "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:rebuild /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:clean /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:Editor_Windows /m /p:Configuration=Release /p:Platform=x64 - name: Move files shell: cmd @@ -28,18 +25,14 @@ jobs: move BUILD\x64\Release\Editor_Windows\Editor_Windows.exe .\ move Editor\config.ini .\ move Editor\startup.lua .\ - move Editor\terrain .\ move Editor\languages .\ move Editor\fonts .\ - move Content\Documentation .\ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Windows) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini @@ -50,7 +43,7 @@ jobs: linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies run: | @@ -74,90 +67,33 @@ jobs: - name: Move binaries run: | - mv build/Editor/WickedEngineEditor ./ + mv build/Editor/WickedEngineEditor ./Editor_Linux mv Editor/config.ini ./ mv Editor/startup.lua ./ - mv Editor/terrain ./ mv Editor/languages ./ mv Editor/fonts ./ - mv Content/Documentation ./ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Linux) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini startup.lua - WickedEngineEditor + Editor_Linux content: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Package Content - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Content path: | + Content/Documentation Content/models Content/scripts - - - #linux-steamdeck: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - - # - name: Install dependencies - # run: | - # sudo apt update - # sudo apt install libsdl2-dev - - # - name: Build - # run: | - # mkdir build - # echo "---Building Command Strings---" - # echo -e "#!/bin/bash \ - # \nmkdir -p $(dirname $PWD) \ - # \nln -s /build $PWD \ - # \ncd /build/build \ - # \ncmake .. -DCMAKE_BUILD_TYPE=Release \ - # \nmake \ - # \necho \"---Generating Shader Dump---\" \ - # \ncd WickedEngine \ - # \n./offlineshadercompiler spirv rebuild shaderdump\nmv wiShaderDump.h ../../WickedEngine/ \ - # \necho \"---Rebuilding with ShaderDump---\" \ - # \ncd .. \ - # \nmake -B" > build.sh - # chmod +x build.sh - # echo "---Executing Containerized Build---" - # podman run --name sniper -v $PWD:/build registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest /build/build.sh - # podman container rm sniper - - # - name: Move files - # run: | - # mv build/Editor/WickedEngineEditor ./ - # mv Editor/config.ini ./ - # mv Editor/startup.lua ./ - # mv Editor/terrain ./ - # mv Editor/languages ./ - # mv Editor/fonts ./ - # mv Content/Documentation ./ - - # - name: Package Editor - # uses: actions/upload-artifact@v2 - # with: - # name: Editor (Linux - Steam Deck) - # path: | - # Documentation/ - # terrain/ - # languages/ - # fonts/ - # config.ini - # startup.lua - # WickedEngineEditor + Content/terrain diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8b327674..c3124985e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,11 +9,7 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: nuget/setup-nuget@v1 - with: - nuget-api-key: ${{ secrets.NuGetAPIKey }} - - run: nuget restore WickedEngine.sln + - uses: actions/checkout@v4 - name: Build shell: cmd run: | @@ -21,7 +17,8 @@ jobs: cd "WickedEngine" "../BUILD/x64/Release/OfflineShaderCompiler/OfflineShaderCompiler.exe" hlsl6 spirv shaderdump strip_reflection cd .. - "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:rebuild /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:clean /m /p:Configuration=Release /p:Platform=x64 + "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:Editor_Windows /m /p:Configuration=Release /p:Platform=x64 - name: Move files shell: cmd @@ -29,18 +26,14 @@ jobs: move BUILD\x64\Release\Editor_Windows\Editor_Windows.exe .\ move Editor\config.ini .\ move Editor\startup.lua .\ - move Editor\terrain .\ move Editor\languages .\ move Editor\fonts .\ - move Content\Documentation .\ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Windows) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini @@ -51,7 +44,7 @@ jobs: linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies run: | @@ -75,90 +68,33 @@ jobs: - name: Move files run: | - mv build/Editor/WickedEngineEditor ./ + mv build/Editor/WickedEngineEditor ./Editor_Linux mv Editor/config.ini ./ mv Editor/startup.lua ./ - mv Editor/terrain ./ mv Editor/languages ./ mv Editor/fonts ./ - mv Content/Documentation ./ - name: Package Editor - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Editor (Linux) path: | - Documentation/ - terrain/ languages/ fonts/ config.ini startup.lua - WickedEngineEditor + Editor_Linux content: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Package Content - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Content path: | + Content/Documentation Content/models Content/scripts - - - #linux-steamdeck: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - - # - name: Install dependencies - # run: | - # sudo apt update - # sudo apt install libsdl2-dev - - # - name: Build - # run: | - # mkdir build - # echo "---Building Command Strings---" - # echo -e "#!/bin/bash \ - # \nmkdir -p $(dirname $PWD) \ - # \nln -s /build $PWD \ - # \ncd /build/build \ - # \ncmake .. -DCMAKE_BUILD_TYPE=Release \ - # \nmake \ - # \necho \"---Generating Shader Dump---\" \ - # \ncd WickedEngine \ - # \n./offlineshadercompiler spirv rebuild shaderdump\nmv wiShaderDump.h ../../WickedEngine/ \ - # \necho \"---Rebuilding with ShaderDump---\" \ - # \ncd .. \ - # \nmake -B" > build.sh - # chmod +x build.sh - # echo "---Executing Containerized Build---" - # podman run --name sniper -v $PWD:/build registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest /build/build.sh - # podman container rm sniper - - # - name: Move files - # run: | - # mv build/Editor/WickedEngineEditor ./ - # mv Editor/config.ini ./ - # mv Editor/startup.lua ./ - # mv Editor/terrain ./ - # mv Editor/languages ./ - # mv Editor/fonts ./ - # mv Content/Documentation ./ - - # - name: Package Editor - # uses: actions/upload-artifact@v2 - # with: - # name: Editor (Linux - Steam Deck) - # path: | - # Documentation/ - # terrain/ - # languages/ - # fonts/ - # config.ini - # startup.lua - # WickedEngineEditor + Content/terrain diff --git a/Content/Content.vcxitems b/Content/Content.vcxitems index 39010f95d..6b02f406d 100644 --- a/Content/Content.vcxitems +++ b/Content/Content.vcxitems @@ -502,6 +502,18 @@ true true + + true + true + + + true + true + + + true + true + @@ -613,6 +625,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -620,5 +662,6 @@ + \ No newline at end of file diff --git a/Content/Content.vcxitems.filters b/Content/Content.vcxitems.filters index 66e68abb1..d8893b992 100644 --- a/Content/Content.vcxitems.filters +++ b/Content/Content.vcxitems.filters @@ -37,6 +37,9 @@ {a8242a40-dd2a-46f8-95a9-1b7431c79043} + + {f61a70fd-1b03-4bb7-a044-2442d8557486} + @@ -252,6 +255,15 @@ scripts\character_controller\assets + + terrain + + + terrain + + + terrain + @@ -581,6 +593,96 @@ scripts\fighting_game + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + + + terrain + @@ -594,5 +696,8 @@ models\Sponza + + terrain + \ No newline at end of file diff --git a/Editor/terrain/base.jpg b/Content/terrain/base.jpg similarity index 100% rename from Editor/terrain/base.jpg rename to Content/terrain/base.jpg diff --git a/Editor/terrain/base_nor.jpg b/Content/terrain/base_nor.jpg similarity index 100% rename from Editor/terrain/base_nor.jpg rename to Content/terrain/base_nor.jpg diff --git a/Editor/terrain/bricks.jpg b/Content/terrain/bricks.jpg similarity index 100% rename from Editor/terrain/bricks.jpg rename to Content/terrain/bricks.jpg diff --git a/Editor/terrain/bricks_nor.jpg b/Content/terrain/bricks_nor.jpg similarity index 100% rename from Editor/terrain/bricks_nor.jpg rename to Content/terrain/bricks_nor.jpg diff --git a/Editor/terrain/darkrock.jpg b/Content/terrain/darkrock.jpg similarity index 100% rename from Editor/terrain/darkrock.jpg rename to Content/terrain/darkrock.jpg diff --git a/Editor/terrain/darkrock_nor.jpg b/Content/terrain/darkrock_nor.jpg similarity index 100% rename from Editor/terrain/darkrock_nor.jpg rename to Content/terrain/darkrock_nor.jpg diff --git a/Editor/terrain/foil.jpg b/Content/terrain/foil.jpg similarity index 100% rename from Editor/terrain/foil.jpg rename to Content/terrain/foil.jpg diff --git a/Editor/terrain/foil_nor.jpg b/Content/terrain/foil_nor.jpg similarity index 100% rename from Editor/terrain/foil_nor.jpg rename to Content/terrain/foil_nor.jpg diff --git a/Editor/terrain/grass.ini b/Content/terrain/grass.ini similarity index 100% rename from Editor/terrain/grass.ini rename to Content/terrain/grass.ini diff --git a/Editor/terrain/grassparticle.dds b/Content/terrain/grassparticle.dds similarity index 100% rename from Editor/terrain/grassparticle.dds rename to Content/terrain/grassparticle.dds diff --git a/Editor/terrain/ground.jpg b/Content/terrain/ground.jpg similarity index 100% rename from Editor/terrain/ground.jpg rename to Content/terrain/ground.jpg diff --git a/Editor/terrain/ground2.jpg b/Content/terrain/ground2.jpg similarity index 100% rename from Editor/terrain/ground2.jpg rename to Content/terrain/ground2.jpg diff --git a/Editor/terrain/ground2_nor.jpg b/Content/terrain/ground2_nor.jpg similarity index 100% rename from Editor/terrain/ground2_nor.jpg rename to Content/terrain/ground2_nor.jpg diff --git a/Editor/terrain/ground_nor.jpg b/Content/terrain/ground_nor.jpg similarity index 100% rename from Editor/terrain/ground_nor.jpg rename to Content/terrain/ground_nor.jpg diff --git a/Editor/terrain/high_altitude.jpg b/Content/terrain/high_altitude.jpg similarity index 100% rename from Editor/terrain/high_altitude.jpg rename to Content/terrain/high_altitude.jpg diff --git a/Editor/terrain/high_altitude_nor.jpg b/Content/terrain/high_altitude_nor.jpg similarity index 100% rename from Editor/terrain/high_altitude_nor.jpg rename to Content/terrain/high_altitude_nor.jpg diff --git a/Editor/terrain/lava.jpg b/Content/terrain/lava.jpg similarity index 100% rename from Editor/terrain/lava.jpg rename to Content/terrain/lava.jpg diff --git a/Editor/terrain/lava_emi.jpg b/Content/terrain/lava_emi.jpg similarity index 100% rename from Editor/terrain/lava_emi.jpg rename to Content/terrain/lava_emi.jpg diff --git a/Editor/terrain/lava_nor.jpg b/Content/terrain/lava_nor.jpg similarity index 100% rename from Editor/terrain/lava_nor.jpg rename to Content/terrain/lava_nor.jpg diff --git a/Editor/terrain/licenses.txt b/Content/terrain/licenses.txt similarity index 100% rename from Editor/terrain/licenses.txt rename to Content/terrain/licenses.txt diff --git a/Editor/terrain/low_altitude.jpg b/Content/terrain/low_altitude.jpg similarity index 100% rename from Editor/terrain/low_altitude.jpg rename to Content/terrain/low_altitude.jpg diff --git a/Editor/terrain/low_altitude_nor.jpg b/Content/terrain/low_altitude_nor.jpg similarity index 100% rename from Editor/terrain/low_altitude_nor.jpg rename to Content/terrain/low_altitude_nor.jpg diff --git a/Editor/terrain/metalplate.jpg b/Content/terrain/metalplate.jpg similarity index 100% rename from Editor/terrain/metalplate.jpg rename to Content/terrain/metalplate.jpg diff --git a/Editor/terrain/metalplate_nor.jpg b/Content/terrain/metalplate_nor.jpg similarity index 100% rename from Editor/terrain/metalplate_nor.jpg rename to Content/terrain/metalplate_nor.jpg diff --git a/Editor/terrain/pavingstone.jpg b/Content/terrain/pavingstone.jpg similarity index 100% rename from Editor/terrain/pavingstone.jpg rename to Content/terrain/pavingstone.jpg diff --git a/Editor/terrain/pavingstone_nor.jpg b/Content/terrain/pavingstone_nor.jpg similarity index 100% rename from Editor/terrain/pavingstone_nor.jpg rename to Content/terrain/pavingstone_nor.jpg diff --git a/Editor/terrain/props.ini b/Content/terrain/props.ini similarity index 100% rename from Editor/terrain/props.ini rename to Content/terrain/props.ini diff --git a/Editor/terrain/props.wiscene b/Content/terrain/props.wiscene similarity index 100% rename from Editor/terrain/props.wiscene rename to Content/terrain/props.wiscene diff --git a/Editor/terrain/rock.jpg b/Content/terrain/rock.jpg similarity index 100% rename from Editor/terrain/rock.jpg rename to Content/terrain/rock.jpg diff --git a/Editor/terrain/rock_nor.jpg b/Content/terrain/rock_nor.jpg similarity index 100% rename from Editor/terrain/rock_nor.jpg rename to Content/terrain/rock_nor.jpg diff --git a/Editor/terrain/slope.jpg b/Content/terrain/slope.jpg similarity index 100% rename from Editor/terrain/slope.jpg rename to Content/terrain/slope.jpg diff --git a/Editor/terrain/slope_nor.jpg b/Content/terrain/slope_nor.jpg similarity index 100% rename from Editor/terrain/slope_nor.jpg rename to Content/terrain/slope_nor.jpg diff --git a/Editor/terrain/tactilepaving.jpg b/Content/terrain/tactilepaving.jpg similarity index 100% rename from Editor/terrain/tactilepaving.jpg rename to Content/terrain/tactilepaving.jpg diff --git a/Editor/terrain/tactilepaving_nor.jpg b/Content/terrain/tactilepaving_nor.jpg similarity index 100% rename from Editor/terrain/tactilepaving_nor.jpg rename to Content/terrain/tactilepaving_nor.jpg diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index cec2d14bc..b637629f7 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -83,7 +83,6 @@ add_custom_command( TARGET WickedEngineEditor POST_BUILD # Copy shader compiler library in the source folder COMMAND ${CMAKE_COMMAND} -E copy_if_different ${WICKED_ROOT_DIR}/WickedEngine/${LIB_DXCOMPILER} ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/terrain ${CMAKE_CURRENT_BINARY_DIR}/terrain COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/languages ${CMAKE_CURRENT_BINARY_DIR}/languages COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/fonts ${CMAKE_CURRENT_BINARY_DIR}/fonts ) @@ -102,9 +101,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/wicked-engine.sh" install(TARGETS WickedEngineEditor RUNTIME DESTINATION ${EDITOR_INSTALL_FOLDER}) # install editor assets -# mandatory terrain folder install(DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}/terrain" "${CMAKE_CURRENT_SOURCE_DIR}/languages" "${CMAKE_CURRENT_SOURCE_DIR}/fonts" DESTINATION ${EDITOR_INSTALL_FOLDER}) diff --git a/Editor/Editor_SOURCE.vcxitems b/Editor/Editor_SOURCE.vcxitems index c7b9477fb..8fe65fda4 100644 --- a/Editor/Editor_SOURCE.vcxitems +++ b/Editor/Editor_SOURCE.vcxitems @@ -210,140 +210,6 @@ true true - - true - true - - - true - true - - - true - true - - - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - @@ -354,10 +220,6 @@ true true - - true - true - diff --git a/Editor/Editor_SOURCE.vcxitems.filters b/Editor/Editor_SOURCE.vcxitems.filters index 178ad34f4..9affc6c9d 100644 --- a/Editor/Editor_SOURCE.vcxitems.filters +++ b/Editor/Editor_SOURCE.vcxitems.filters @@ -154,23 +154,11 @@ - - terrain - - - terrain - - - terrain - {49c521c0-5dca-4fce-b8c5-a334d1746d98} - - {9a5b997d-f07e-45c5-849a-717f15cba0ab} - {beae58b9-9c06-4b1f-9e03-a27712d6a579} @@ -179,101 +167,6 @@ - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - terrain - - - - - terrain - languages diff --git a/Editor/TerrainWindow.cpp b/Editor/TerrainWindow.cpp index b17d27a74..b75a0299c 100644 --- a/Editor/TerrainWindow.cpp +++ b/Editor/TerrainWindow.cpp @@ -1455,14 +1455,27 @@ void TerrainWindow::SetupAssets() material_Slope->SetRoughness(0.1f); material_LowAltitude->SetRoughness(1); material_HighAltitude->SetRoughness(1); - material_Base->textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/base.jpg"; - material_Base->textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/base_nor.jpg"; - material_Slope->textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/slope.jpg"; - material_Slope->textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/slope_nor.jpg"; - material_LowAltitude->textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/low_altitude.jpg"; - material_LowAltitude->textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/low_altitude_nor.jpg"; - material_HighAltitude->textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/high_altitude.jpg"; - material_HighAltitude->textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/high_altitude_nor.jpg"; + + std::string asset_path = wi::helper::GetCurrentPath() + "/Content/terrain/"; + if (!wi::helper::DirectoryExists(asset_path)) + { + // Usually in source download, the assets are one level outside of Editor: + asset_path = wi::helper::GetCurrentPath() + "/../Content/terrain/"; + } + if (!wi::helper::DirectoryExists(asset_path)) + { + // In UWP or older Editor content, it's not in Content folder: + asset_path = wi::helper::GetCurrentPath() + "/terrain/"; + } + + material_Base->textures[MaterialComponent::BASECOLORMAP].name = asset_path + "base.jpg"; + material_Base->textures[MaterialComponent::NORMALMAP].name = asset_path + "base_nor.jpg"; + material_Slope->textures[MaterialComponent::BASECOLORMAP].name = asset_path + "slope.jpg"; + material_Slope->textures[MaterialComponent::NORMALMAP].name = asset_path + "slope_nor.jpg"; + material_LowAltitude->textures[MaterialComponent::BASECOLORMAP].name = asset_path + "low_altitude.jpg"; + material_LowAltitude->textures[MaterialComponent::NORMALMAP].name = asset_path + "low_altitude_nor.jpg"; + material_HighAltitude->textures[MaterialComponent::BASECOLORMAP].name = asset_path + "high_altitude.jpg"; + material_HighAltitude->textures[MaterialComponent::NORMALMAP].name = asset_path + "high_altitude_nor.jpg"; // Extra material: rock { @@ -1470,8 +1483,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Rock"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/rock.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/rock_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "rock.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "rock_nor.jpg"; mat.roughness = 0.9f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1481,8 +1494,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Ground"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/ground.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/ground_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "ground.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "ground_nor.jpg"; mat.roughness = 0.9f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1492,8 +1505,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Ground2"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/ground2.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/ground2_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "ground2.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "ground2_nor.jpg"; mat.roughness = 0.9f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1503,8 +1516,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Bricks"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/bricks.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/bricks_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "bricks.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "bricks_nor.jpg"; mat.roughness = 0.9f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1514,8 +1527,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Dark Rock"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/darkrock.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/darkrock_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "darkrock.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "darkrock_nor.jpg"; mat.roughness = 0.8f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1525,8 +1538,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Metal Plate"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/metalplate.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/metalplate_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "metalplate.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "metalplate_nor.jpg"; mat.metalness = 1; mat.roughness = 0.5f; terrain_preset.materialEntities.push_back(materialEntity); @@ -1537,8 +1550,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Foil"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/foil.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/foil_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "foil.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "foil_nor.jpg"; mat.metalness = 1; mat.roughness = 0.01f; terrain_preset.materialEntities.push_back(materialEntity); @@ -1549,8 +1562,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Paving Stone"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/pavingstone.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/pavingstone_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "pavingstone.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "pavingstone_nor.jpg"; terrain_preset.materialEntities.push_back(materialEntity); } // Extra material: tactilepaving @@ -1559,8 +1572,8 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Tactile Paving"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/tactilepaving.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/tactilepaving_nor.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "tactilepaving.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "tactilepaving_nor.jpg"; terrain_preset.materialEntities.push_back(materialEntity); } // Extra material: lava @@ -1569,9 +1582,9 @@ void TerrainWindow::SetupAssets() MaterialComponent& mat = currentScene.materials.Create(materialEntity); currentScene.names.Create(materialEntity) = "Lava"; currentScene.Component_Attach(materialEntity, entity); - mat.textures[MaterialComponent::BASECOLORMAP].name = wi::helper::GetCurrentPath() + "/terrain/lava.jpg"; - mat.textures[MaterialComponent::NORMALMAP].name = wi::helper::GetCurrentPath() + "/terrain/lava_nor.jpg"; - mat.textures[MaterialComponent::EMISSIVEMAP].name = wi::helper::GetCurrentPath() + "/terrain/lava_emi.jpg"; + mat.textures[MaterialComponent::BASECOLORMAP].name = asset_path + "lava.jpg"; + mat.textures[MaterialComponent::NORMALMAP].name = asset_path + "lava_nor.jpg"; + mat.textures[MaterialComponent::EMISSIVEMAP].name = asset_path + "lava_emi.jpg"; mat.roughness = 0.8f; terrain_preset.materialEntities.push_back(materialEntity); } @@ -1585,9 +1598,8 @@ void TerrainWindow::SetupAssets() material->CreateRenderData(); }); - std::string terrain_path = wi::helper::GetCurrentPath() + "/terrain/"; wi::config::File config; - config.Open(std::string(terrain_path + "props.ini").c_str()); + config.Open(std::string(asset_path + "props.ini").c_str()); std::unordered_map prop_scenes; for (const auto& it : config) @@ -1602,7 +1614,7 @@ void TerrainWindow::SetupAssets() std::string text = section.GetText("file"); if (prop_scenes.count(text) == 0) { - wi::scene::LoadModel(prop_scenes[text], terrain_path + text); + wi::scene::LoadModel(prop_scenes[text], asset_path + text); } if (prop_scenes.count(text) != 0) { @@ -1693,10 +1705,10 @@ void TerrainWindow::SetupAssets() MaterialComponent* material_Grass = currentScene.materials.GetComponent(terrain_preset.grassEntity); wi::HairParticleSystem* grass = currentScene.hairs.GetComponent(terrain_preset.grassEntity); wi::config::File grass_config; - grass_config.Open(std::string(terrain_path + "grass.ini").c_str()); + grass_config.Open(std::string(asset_path + "grass.ini").c_str()); if (grass_config.Has("texture")) { - material_Grass->textures[MaterialComponent::BASECOLORMAP].name = terrain_path + grass_config.GetText("texture"); + material_Grass->textures[MaterialComponent::BASECOLORMAP].name = asset_path + grass_config.GetText("texture"); material_Grass->CreateRenderData(); } if (grass_config.Has("alphaRef")) diff --git a/Editor/Translator.cpp b/Editor/Translator.cpp index 7eb5d7cd2..9195ea36a 100644 --- a/Editor/Translator.cpp +++ b/Editor/Translator.cpp @@ -110,6 +110,7 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo { transform.ClearTransform(); transform.UpdateTransform(); + state = TRANSLATOR_IDLE; return; } @@ -141,7 +142,10 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo { PreTranslate(); if (!has_selected_transform) + { + state = TRANSLATOR_IDLE; return; + } const Ray ray = wi::renderer::GetPickRay((long)currentMouse.x, (long)currentMouse.y, canvas, camera); const XMVECTOR rayOrigin = XMLoadFloat3(&ray.origin); @@ -385,7 +389,10 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo plane = XMPlaneFromPointNormal(pos, XMVector3Normalize(planeNormal)); if (XMVectorGetX(XMVectorAbs(XMVector3Dot(planeNormal, rayDir))) < 0.001f) + { + state = TRANSLATOR_IDLE; return; + } XMVECTOR intersection = XMPlaneIntersectLine(plane, rayOrigin, rayOrigin + rayDir * camera.zFarP); if (!dragging) @@ -488,6 +495,7 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo dragEnded = true; } dragging = false; + state = TRANSLATOR_IDLE; } } void Translator::Draw(const CameraComponent& camera, const XMFLOAT4& currentMouse, CommandList cmd) const diff --git a/WickedEngine/wiTerrain.cpp b/WickedEngine/wiTerrain.cpp index 55d421821..a76af5ad5 100644 --- a/WickedEngine/wiTerrain.cpp +++ b/WickedEngine/wiTerrain.cpp @@ -1669,6 +1669,8 @@ namespace wi::terrain for (const VirtualTexture* vt : virtual_textures_in_use) { + if (vt->update_requests.empty()) + continue; for (uint32_t map_type = 0; map_type < arraysize(atlas.maps); map_type++) { switch (map_type) @@ -1761,9 +1763,6 @@ namespace wi::terrain } } } - } - for (const VirtualTexture* vt : virtual_textures_in_use) - { vt->update_requests.clear(); } device->EventEnd(cmd);