diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 5a9fb57755f4..e0801ff26919 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -6,7 +6,7 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: master - SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes + SCONSFLAGS: verbose=yes warnings=extra werror=yes strict_checks=yes DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt @@ -24,76 +24,20 @@ jobs: fail-fast: false matrix: include: - - name: Editor w/ Mono (target=editor) - cache-name: linux-editor-mono - target: editor - sconsflags: module_mono_enabled=yes - bin: ./bin/godot.linuxbsd.editor.x86_64.mono - build-mono: true - tests: false # Disabled due freeze caused by mix Mono build and CI - doc-test: true - proj-conv: true - api-compat: true + - name: Pixel Debug + cache-name: linux_pixel_engine_debug + target: pixel_debug + bin: ./bin/pixel.linuxbsd.pixel_debug.x86_64 artifact: true cache-limit: 1 - - name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold) - cache-name: linux-editor-double-sanitizers - target: editor - # Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners. - sconsflags: dev_build=yes scu_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold - bin: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san - build-mono: false - tests: true - proj-test: true - # Generate an API dump for godot-cpp tests. - api-dump: true - # Skip 2GiB artifact speeding up action. - artifact: false - cache-limit: 7 - - - name: Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld) - cache-name: linux-editor-llvm-sanitizers - target: editor - sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld - bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san - build-mono: false - tests: true - # Skip 2GiB artifact speeding up action. - artifact: false - # Test our oldest supported SCons/Python versions on one arbitrary editor build. - legacy-scons: true - cache-limit: 7 - - - name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld) - cache-name: linux-editor-thread-sanitizer - target: editor - tests: true - sconsflags: dev_build=yes use_tsan=yes use_llvm=yes linker=lld - bin: ./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san - build-mono: false - # Skip 2GiB artifact speeding up action. - artifact: false - cache-limit: 5 - - - name: Template w/ Mono (target=template_release, tests=yes) - cache-name: linux-template-mono - target: template_release - sconsflags: module_mono_enabled=yes - bin: ./bin/godot.linuxbsd.template_release.x86_64.mono - build-mono: false - tests: true + - name: Pixel Release + cache-name: linux_pixel_engine_release + target: pixel_debug + bin: ./bin/pixel.linuxbsd.pixel_release.x86_64 artifact: true cache-limit: 1 - - name: Minimal template (target=template_release, tests=yes, everything disabled) - cache-name: linux-template-minimal - target: template_release - sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no - bin: ./bin/godot.linuxbsd.template_release.x86_64 - tests: true - artifact: true - cache-limit: 1 steps: - name: Checkout @@ -142,10 +86,10 @@ jobs: - name: Compilation uses: ./.github/actions/godot-build with: - sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} + sconsflags: ${{ env.SCONSFLAGS }} platform: linuxbsd target: ${{ matrix.target }} - tests: ${{ matrix.tests }} + # tests: ${{ matrix.tests }} scons-cache-limit: ${{ matrix.cache-limit }} - name: Save Godot build cache @@ -154,21 +98,21 @@ jobs: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Generate C# glue - if: matrix.build-mono - run: | - ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue + # - name: Generate C# glue + # if: matrix.build-mono + # run: | + # ${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue - - name: Build .NET solutions - if: matrix.build-mono - run: | - ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd + # - name: Build .NET solutions + # if: matrix.build-mono + # run: | + # ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd - name: Prepare artifact if: matrix.artifact run: | - strip bin/godot.* - chmod +x bin/godot.* + strip bin/pixel.* + chmod +x bin/pixel.* - name: Upload artifact uses: ./.github/actions/upload-artifact @@ -176,49 +120,49 @@ jobs: with: name: ${{ matrix.cache-name }} - - name: Dump Godot API - uses: ./.github/actions/godot-api-dump - if: matrix.api-dump - with: - bin: ${{ matrix.bin }} - - - name: Unit tests - if: matrix.tests - run: | - ${{ matrix.bin }} --version - ${{ matrix.bin }} --help - ${{ matrix.bin }} --headless --test --force-colors - - - name: .NET source generators tests - if: matrix.build-mono - run: | - dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests - - # Check class reference - - name: Check for class reference updates - if: matrix.doc-test - run: | - echo "Running --doctool to see if this changes the public API without updating the documentation." - echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n" - ${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true - git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$' - - # Check API backwards compatibility - - name: Check for GDExtension compatibility - if: matrix.api-compat - run: | - ./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}" - - # Download and run the test project - - name: Test Godot project - uses: ./.github/actions/godot-project-test - if: matrix.proj-test - with: - bin: ${{ matrix.bin }} - - # Test the project converter - - name: Test project converter - uses: ./.github/actions/godot-converter-test - if: matrix.proj-conv - with: - bin: ${{ matrix.bin }} + # - name: Dump Godot API + # uses: ./.github/actions/godot-api-dump + # if: matrix.api-dump + # with: + # bin: ${{ matrix.bin }} + + # - name: Unit tests + # if: matrix.tests + # run: | + # ${{ matrix.bin }} --version + # ${{ matrix.bin }} --help + # ${{ matrix.bin }} --headless --test --force-colors + + # - name: .NET source generators tests + # if: matrix.build-mono + # run: | + # dotnet test modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests + + # # Check class reference + # - name: Check for class reference updates + # if: matrix.doc-test + # run: | + # echo "Running --doctool to see if this changes the public API without updating the documentation." + # echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n" + # ${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true + # git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$' + + # # Check API backwards compatibility + # - name: Check for GDExtension compatibility + # if: matrix.api-compat + # run: | + # ./misc/scripts/validate_extension_api.sh "${{ matrix.bin }}" + + # # Download and run the test project + # - name: Test Godot project + # uses: ./.github/actions/godot-project-test + # if: matrix.proj-test + # with: + # bin: ${{ matrix.bin }} + + # # Test the project converter + # - name: Test project converter + # uses: ./.github/actions/godot-converter-test + # if: matrix.proj-conv + # with: + # bin: ${{ matrix.bin }} diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 3fedc2a5c9a9..dda4b7e7a0d0 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -6,7 +6,7 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: master - SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes + SCONSFLAGS: verbose=yes warnings=extra werror=yes strict_checks=yes concurrency: group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-macos @@ -20,19 +20,17 @@ jobs: fail-fast: false matrix: include: - - name: Editor (target=editor, tests=yes) - cache-name: macos-editor - target: editor - tests: true - bin: ./bin/godot.macos.editor.universal + - name: Pixel Debug + cache-name: macos_pixel_engine_debug + target: pixel_debug + bin: ./bin/pixel.macos.pixel_debug.universal cache-limit: 1 - - name: Template (target=template_release, tests=yes) - cache-name: macos-template - target: template_release - tests: true + - name: Pixel Release + cache-name: macos_pixel_engine_release + target: pixel_release sconsflags: debug_symbols=no - bin: ./bin/godot.macos.template_release.universal + bin: ./bin/pixel.macos.pixel_release.universal cache-limit: 1 steps: @@ -60,8 +58,7 @@ jobs: sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64 platform: macos target: ${{ matrix.target }} - tests: ${{ matrix.tests }} - scons-cache-limit: 0 # Only cap on second run to avoid purging unnecessarily + # tests: ${{ matrix.tests }} - name: Compilation (arm64) uses: ./.github/actions/godot-build @@ -69,8 +66,7 @@ jobs: sconsflags: ${{ env.SCONSFLAGS }} arch=arm64 platform: macos target: ${{ matrix.target }} - tests: ${{ matrix.tests }} - scons-cache-limit: ${{ matrix.cache-limit }} + # tests: ${{ matrix.tests }} - name: Save Godot build cache uses: ./.github/actions/godot-cache-save @@ -80,19 +76,19 @@ jobs: - name: Prepare artifact run: | - lipo -create ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 -output ./bin/godot.macos.${{ matrix.target }}.universal - rm ./bin/godot.macos.${{ matrix.target }}.x86_64 ./bin/godot.macos.${{ matrix.target }}.arm64 - strip bin/godot.* - chmod +x bin/godot.* + lipo -create ./bin/pixel.macos.${{ matrix.target }}.x86_64 ./bin/pixel.macos.${{ matrix.target }}.arm64 -output ./bin/pixel.macos.${{ matrix.target }}.universal + rm ./bin/pixel.macos.${{ matrix.target }}.x86_64 ./bin/pixel.macos.${{ matrix.target }}.arm64 + strip bin/pixel.* + chmod +x bin/pixel.* - name: Upload artifact uses: ./.github/actions/upload-artifact with: name: ${{ matrix.cache-name }} - - name: Unit tests - if: matrix.tests - run: | - ${{ matrix.bin }} --version - ${{ matrix.bin }} --help - ${{ matrix.bin }} --test --force-colors + # - name: Unit tests + # if: matrix.tests + # run: | + # ${{ matrix.bin }} --version + # ${{ matrix.bin }} --help + # ${{ matrix.bin }} --test --force-colors diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index fd5e74b914ad..c6cbccad1c6b 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -15,15 +15,15 @@ jobs: # Second stage: Run all the builds and some of the tests. - android-build: - name: ๐Ÿค– Android - needs: static-checks - uses: ./.github/workflows/android_builds.yml + # android-build: + # name: ๐Ÿค– Android + # needs: static-checks + # uses: ./.github/workflows/android_builds.yml - ios-build: - name: ๐Ÿ iOS - needs: static-checks - uses: ./.github/workflows/ios_builds.yml + # ios-build: + # name: ๐Ÿ iOS + # needs: static-checks + # uses: ./.github/workflows/ios_builds.yml linux-build: name: ๐Ÿง Linux @@ -40,19 +40,19 @@ jobs: needs: static-checks uses: ./.github/workflows/windows_builds.yml - web-build: - name: ๐ŸŒ Web - needs: static-checks - uses: ./.github/workflows/web_builds.yml + # web-build: + # name: ๐ŸŒ Web + # needs: static-checks + # uses: ./.github/workflows/web_builds.yml # Third stage: Run auxiliary tests using build artifacts from previous jobs. # Can be turned off for PRs that intentionally break compat with godot-cpp, # until both the upstream PR and the matching godot-cpp changes are merged. - godot-cpp-test: - name: ๐Ÿชฒ Godot CPP - # This can be changed to depend on another platform, if we decide to use it for - # godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step - # appropriately. - needs: linux-build - uses: ./.github/workflows/godot_cpp_test.yml + # godot-cpp-test: + # name: ๐Ÿชฒ Godot CPP + # # This can be changed to depend on another platform, if we decide to use it for + # # godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step + # # appropriately. + # needs: linux-build + # uses: ./.github/workflows/godot_cpp_test.yml diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index c407ae12d099..6994f944f329 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -7,7 +7,7 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: master - SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes strict_checks=yes "angle_libs=${{ github.workspace }}/" + SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no strict_checks=yes d3d12=yes "angle_libs=${{ github.workspace }}/" SCONS_CACHE_MSVC_CONFIG: true concurrency: @@ -23,44 +23,20 @@ jobs: fail-fast: false matrix: include: - - name: Editor (target=editor, tests=yes) - cache-name: windows-editor - target: editor - tests: true - # Skip debug symbols, they're way too big with MSVC. - sconsflags: debug_symbols=no vsproj=yes vsproj_gen_only=no windows_subsystem=console - bin: ./bin/godot.windows.editor.x86_64.exe + - name: Pixel Debug + cache-name: windows_pixel_engine_debug + target: pixel_debug + bin: ./bin/pixel.windows.pixel_debug.x86_64.console.exe compiler: msvc cache-limit: 2 - - name: Editor w/ clang-cl (target=editor, tests=yes, use_llvm=yes) - cache-name: windows-editor-clang - target: editor - tests: true - sconsflags: debug_symbols=no windows_subsystem=console use_llvm=yes - bin: ./bin/godot.windows.editor.x86_64.llvm.exe - compiler: clang - cache-limit: 1 - - - name: Template (target=template_release, tests=yes) - cache-name: windows-template - target: template_release - tests: true - sconsflags: debug_symbols=no - bin: ./bin/godot.windows.template_release.x86_64.console.exe + - name: Pixel Release + cache-name: windows_pixel_engine_release + target: pixel_release + bin: ./bin/pixel.windows.pixel_release.x86_64.console.exe compiler: msvc cache-limit: 2 - - name: Template w/ GCC (target=template_release, tests=yes, use_mingw=yes) - cache-name: windows-template-gcc - # MinGW takes MUCH longer to compile; save time by only targeting Template. - target: template_release - tests: true - sconsflags: debug_symbols=no use_mingw=yes - bin: ./bin/godot.windows.template_release.x86_64.console.exe - compiler: gcc - cache-limit: 1 - steps: - name: Checkout uses: actions/checkout@v4 @@ -93,11 +69,10 @@ jobs: - name: Compilation uses: ./.github/actions/godot-build with: - sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} + sconsflags: ${{ env.SCONSFLAGS }} platform: windows target: ${{ matrix.target }} - tests: ${{ matrix.tests }} - scons-cache-limit: ${{ matrix.cache-limit }} + # tests: ${{ matrix.tests }} - name: Save Godot build cache uses: ./.github/actions/godot-cache-save @@ -116,9 +91,9 @@ jobs: with: name: ${{ matrix.cache-name }} - - name: Unit tests - if: matrix.tests - run: | - ${{ matrix.bin }} --version - ${{ matrix.bin }} --help - ${{ matrix.bin }} --test --force-colors + # - name: Unit tests + # if: matrix.tests + # run: | + # ${{ matrix.bin }} --version + # ${{ matrix.bin }} --help + # ${{ matrix.bin }} --test --force-colors diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77418d45b03c..c5a11c757225 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -162,7 +162,8 @@ repos: platform/android/java/lib/src/com/.*| platform/android/java/lib/src/org/godotengine/godot/gl/GLSurfaceView\.java$| platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper\.java$| - platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix\.java$ + platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix\.java$| + pixel/.* ) - id: header-guards diff --git a/AUTHORS.md b/AUTHORS.md index b21270b3f700..d03dcd74eb35 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -339,3 +339,7 @@ name is available. ๅฟ˜ๅฟงใฎ (Daylily-Zeleen) ่ฐขๅคฉ (jsjtxietian) ้ฃŽ้’ๅฑฑ (Rindbee) + +## Pixel Engine Contributers + + Mounir Tohami (WhalesState) diff --git a/SConstruct b/SConstruct index f49ef9596c6f..f1a13e4926b0 100644 --- a/SConstruct +++ b/SConstruct @@ -194,7 +194,7 @@ if env.scons_version >= (4, 3): else: opts.Add("platform", "Target platform (%s)" % "|".join(platform_list), "") opts.Add("p", "Alias for 'platform'", "") -opts.Add(EnumVariable("target", "Compilation target", "editor", ("editor", "template_release", "template_debug"))) +opts.Add(EnumVariable("target", "Compilation target", "pixel_debug", ("pixel_debug", "pixel_release"))) opts.Add(EnumVariable("arch", "CPU architecture", "auto", ["auto"] + architectures, architecture_aliases)) opts.Add(BoolVariable("dev_build", "Developer build with dev-only debugging code (DEV_ENABLED)", False)) opts.Add( @@ -213,7 +213,7 @@ opts.Add(BoolVariable("production", "Set defaults to build Godot for use in prod opts.Add(BoolVariable("threads", "Enable threading support", True)) # Components -opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True)) +opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", False)) opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double"))) opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True)) opts.Add(BoolVariable("brotli", "Enable Brotli for decompresson and WOFF2 fonts support", True)) @@ -254,7 +254,10 @@ opts.Add("object_prefix", "Custom prefix added to the base filename of all gener opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False)) opts.Add("vsproj_name", "Name of the Visual Studio solution", "godot") opts.Add("import_env_vars", "A comma-separated list of environment variables to copy from the outer environment.", "") -opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False)) +opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", True)) +opts.Add(BoolVariable("disable_navigation", "Disable 2D and 3D navigation for a smaller executable", True)) +opts.Add(BoolVariable("disable_physics", "Disable 2D and 3D physics for a smaller executable", True)) +opts.Add(BoolVariable("disable_visual_shader", "Disable visual shader for a smaller executable", True)) opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False)) opts.Add("build_profile", "Path to a file containing a feature build profile", "") opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True)) @@ -470,9 +473,10 @@ env.platform_apis = platform_apis # - Optimization level # - Debug symbols for crash traces / debuggers -env.editor_build = env["target"] == "editor" -env.dev_build = env["dev_build"] -env.debug_features = env["target"] in ["editor", "template_debug"] +env.pixel_engine = env["target"] in ["pixel_debug", "pixel_release"] +env.editor_build = not env.pixel_engine and env["target"] == "editor" +env.debug_features = env["target"] in ["editor", "template_debug", "pixel_debug"] +env.dev_build = env["target"] == "pixel_debug" or env["dev_build"] if env["optimize"] == "auto": if env.dev_build: @@ -487,13 +491,19 @@ env["debug_symbols"] = methods.get_cmdline_bool("debug_symbols", env.dev_build) if env.editor_build: env.Append(CPPDEFINES=["TOOLS_ENABLED"]) - -if env.debug_features: +elif env["target"] == "pixel_debug": + env.Append(CPPDEFINES=["PIXEL_ENGINE"]) + env.Append(CPPDEFINES=["PIXEL_DEBUG"]) +elif env["target"] == "pixel_release": + env.Append(CPPDEFINES=["PIXEL_ENGINE"]) + env.Append(CPPDEFINES=["PIXEL_RELEASE"]) + +if env.debug_features or env["target"] == "pixel_debug": # DEBUG_ENABLED enables debugging *features* and debug-only code, which is intended # to give *users* extra debugging information for their game development. env.Append(CPPDEFINES=["DEBUG_ENABLED"]) -if env.dev_build: +if env.dev_build or env["target"] == "pixel_debug": # DEV_ENABLED enables *engine developer* code which should only be compiled for those # working on the engine itself. env.Append(CPPDEFINES=["DEV_ENABLED"]) @@ -914,7 +924,7 @@ else: suffix = "." + env["platform"] suffix += "." + env["target"] -if env.dev_build: +if env.dev_build and not env.pixel_engine: suffix += ".dev" if env["precision"] == "double": @@ -1007,6 +1017,31 @@ if env["disable_3d"]: Exit(255) else: env.Append(CPPDEFINES=["_3D_DISABLED"]) + +if env["disable_physics"]: + if env.editor_build: + print_error("Build option `disable_physics=yes` cannot be used for editor builds, only for export template builds.") + Exit(255) + else: + env.Append(CPPDEFINES=["_PHYSICS_DISABLED"]) + +if env["disable_navigation"]: + if env.editor_build: + print_error("Build option `disable_navigation=yes` cannot be used for editor builds, only for export template builds.") + Exit(255) + else: + env.Append(CPPDEFINES=["_NAVIGATION_DISABLED"]) + +if env["disable_visual_shader"]: + if env.editor_build: + print_error( + "Build option `disable_visual_shader=yes` cannot be used for editor builds, " + "only for export template builds." + ) + Exit(255) + else: + env.Append(CPPDEFINES=["_VISUAL_SHADER_DISABLED"]) + if env["disable_advanced_gui"]: if env.editor_build: print_error( @@ -1016,6 +1051,7 @@ if env["disable_advanced_gui"]: Exit(255) else: env.Append(CPPDEFINES=["ADVANCED_GUI_DISABLED"]) + if env["minizip"]: env.Append(CPPDEFINES=["MINIZIP_ENABLED"]) if env["brotli"]: @@ -1069,6 +1105,8 @@ SConscript("servers/SCsub") SConscript("scene/SCsub") if env.editor_build: SConscript("editor/SCsub") +if env.pixel_engine: + SConscript("pixel/SCsub") SConscript("drivers/SCsub") SConscript("platform/SCsub") diff --git a/core/SCsub b/core/SCsub index 8bda230b870c..7ea3a3174e7d 100644 --- a/core/SCsub +++ b/core/SCsub @@ -185,6 +185,9 @@ def version_info_builder(target, source, env): #define VERSION_MAJOR {major} #define VERSION_MINOR {minor} #define VERSION_PATCH {patch} +#define PIXEL_MAJOR {pixel_major} +#define PIXEL_MINOR {pixel_minor} +#define PIXEL_PATCH {pixel_patch} #define VERSION_STATUS "{status}" #define VERSION_BUILD "{build}" #define VERSION_MODULE_CONFIG "{module_config}" diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 250f39b08a32..d8d13433dff6 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -128,6 +128,9 @@ Dictionary Engine::get_version_info() const { dict["major"] = VERSION_MAJOR; dict["minor"] = VERSION_MINOR; dict["patch"] = VERSION_PATCH; + dict["pixel_major"] = PIXEL_MAJOR; + dict["pixel_minor"] = PIXEL_MINOR; + dict["pixel_patch"] = PIXEL_PATCH; dict["hex"] = VERSION_HEX; dict["status"] = VERSION_STATUS; dict["build"] = VERSION_BUILD; diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 8e5525d0767b..3909a9b74e45 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -50,17 +50,19 @@ #include "core/io/marshalls.h" #include "core/io/resource_uid.h" #include "core/object/script_language.h" -#include "core/os/keyboard.h" #include "core/templates/rb_set.h" #include "core/variant/typed_array.h" #include "core/variant/variant_parser.h" #include "core/version.h" +#include "core/version_generated.gen.h" #ifdef TOOLS_ENABLED #include "modules/modules_enabled.gen.h" // For mono. #endif // TOOLS_ENABLED +#ifndef PIXEL_ENGINE const String ProjectSettings::PROJECT_DATA_DIR_NAME_SUFFIX = "godot"; +#endif // !PIXEL_ENGINE ProjectSettings *ProjectSettings::singleton = nullptr; @@ -73,7 +75,11 @@ String ProjectSettings::get_project_data_dir_name() const { } String ProjectSettings::get_project_data_path() const { +#ifndef PIXEL_ENGINE return "res://" + get_project_data_dir_name(); +#else + return "user://" + get_project_data_dir_name(); +#endif // !PIXEL_ENGINE } String ProjectSettings::get_resource_path() const { @@ -572,6 +578,7 @@ void ProjectSettings::_convert_to_last_version(int p_from_version) { * If nothing was found, error out. */ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) { +#ifndef PIXEL_ENGINE if (!OS::get_singleton()->get_resource_dir().is_empty()) { // OS will call ProjectSettings->get_resource_path which will be empty if not overridden! // If the OS would rather use a specific location, then it will not be empty. @@ -659,14 +666,17 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b } return err; } - // Nothing was found, try to find a project file in provided path (`p_path`) // or, if requested (`p_upwards`) in parent directories. +#endif // !PIXEL_ENGINE Ref d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); ERR_FAIL_COND_V_MSG(d.is_null(), ERR_CANT_CREATE, vformat("Cannot create DirAccess for path '%s'.", p_path)); d->change_dir(p_path); +#ifdef PIXEL_ENGINE + return _load_settings_text(d->get_current_dir().path_join("settings.pixel")); +#else String current_dir = d->get_current_dir(); bool found = false; Error err; @@ -704,10 +714,12 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b } return OK; +#endif // PIXEL_ENGINE } Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) { Error err = _setup(p_path, p_main_pack, p_upwards, p_ignore_override); +#ifndef PIXEL_ENGINE if (err == OK && !p_ignore_override) { String custom_settings = GLOBAL_GET("application/config/project_settings_override"); if (!custom_settings.is_empty()) { @@ -718,6 +730,9 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo // Updating the default value after the project settings have loaded. bool use_hidden_directory = GLOBAL_GET("application/config/use_hidden_project_data_directory"); project_data_dir_name = (use_hidden_directory ? "." : "") + PROJECT_DATA_DIR_NAME_SUFFIX; +#else + project_data_dir_name = "." + String(VERSION_SHORT_NAME); +#endif // !PIXEL_ENGINE // Using GLOBAL_GET on every block for compressing can be slow, so assigning here. Compression::zstd_long_distance_matching = GLOBAL_GET("compression/formats/zstd/long_distance_matching"); @@ -806,8 +821,12 @@ Error ProjectSettings::_load_settings_text(const String &p_path) { if (err == ERR_FILE_EOF) { // If we're loading a project.godot from source code, we can operate some // ProjectSettings conversions if need be. +#ifndef PIXEL_ENGINE _convert_to_last_version(config_version); last_save_time = FileAccess::get_modified_time(get_resource_path().path_join("project.godot")); +#else + last_save_time = FileAccess::get_modified_time(OS::get_singleton()->get_user_data_dir().path_join("settings.pixel")); +#endif // !PIXEL_ENGINE return OK; } ERR_FAIL_COND_V_MSG(err != OK, err, vformat("Error parsing '%s' at line %d: %s File might be corrupted.", p_path, lines, error_text)); @@ -886,9 +905,14 @@ void ProjectSettings::clear(const String &p_name) { } Error ProjectSettings::save() { - Error error = save_custom(get_resource_path().path_join("project.godot")); +#ifndef PIXEL_ENGINE + const String path = get_resource_path().path_join("project.godot"); +#else + const String path = OS::get_singleton()->get_user_data_dir().path_join("settings.pixel"); +#endif // !PIXEL_ENGINE + Error error = save_custom(path); if (error == OK) { - last_save_time = FileAccess::get_modified_time(get_resource_path().path_join("project.godot")); + last_save_time = FileAccess::get_modified_time(path); } return error; } @@ -966,7 +990,11 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const RBMap file = FileAccess::open(p_file, FileAccess::WRITE, &err); +#ifndef PIXEL_ENGINE ERR_FAIL_COND_V_MSG(err != OK, err, vformat("Couldn't save project.godot - %s.", p_file)); +#else + ERR_FAIL_COND_V_MSG(err != OK, err, vformat("Couldn't save settings.pixel - %s.", p_file)); +#endif // !PIXEL_ENGINE file->store_line("; Engine configuration file."); file->store_line("; It's best edited using the editor UI and not directly,"); @@ -1136,7 +1164,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust save_features += f; } - if (p_path.ends_with(".godot") || p_path.ends_with("override.cfg")) { + if (p_path.ends_with(".godot") || p_path.ends_with("override.cfg") || p_path.ends_with(".pixel")) { return _save_settings_text(p_path, save_props, p_custom, save_features); } else if (p_path.ends_with(".binary")) { return _save_settings_binary(p_path, save_props, p_custom, save_features); @@ -1253,10 +1281,10 @@ TypedArray ProjectSettings::get_global_class_list() { if (cf->load(get_global_class_list_path()) == OK) { global_class_list = cf->get_value("", "list", Array()); } else { -#ifndef TOOLS_ENABLED +#if !defined(TOOLS_ENABLED) && !defined(PIXEL_ENGINE) // Script classes can't be recreated in exported project, so print an error. ERR_PRINT("Could not load global script cache."); -#endif +#endif // !defined(TOOLS_ENABLED) && !defined(PIXEL_ENGINE) } // File read succeeded or failed. If it failed, assume everything is still okay. @@ -1459,25 +1487,25 @@ ProjectSettings::ProjectSettings() { } } #endif - +#ifndef PIXEL_ENGINE GLOBAL_DEF_BASIC("application/config/name", ""); GLOBAL_DEF_BASIC(PropertyInfo(Variant::DICTIONARY, "application/config/name_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary()); GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/description", PROPERTY_HINT_MULTILINE_TEXT), ""); GLOBAL_DEF_BASIC("application/config/version", ""); GLOBAL_DEF_INTERNAL(PropertyInfo(Variant::STRING, "application/config/tags"), PackedStringArray()); GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"), ""); - GLOBAL_DEF("application/run/disable_stdout", false); - GLOBAL_DEF("application/run/disable_stderr", false); - GLOBAL_DEF("application/run/print_header", true); - GLOBAL_DEF("application/run/enable_alt_space_menu", false); GLOBAL_DEF_RST("application/config/use_hidden_project_data_directory", true); GLOBAL_DEF("application/config/use_custom_user_dir", false); GLOBAL_DEF("application/config/custom_user_dir_name", ""); - GLOBAL_DEF("application/config/project_settings_override", ""); - GLOBAL_DEF("application/run/main_loop_type", "SceneTree"); GLOBAL_DEF("application/config/auto_accept_quit", true); GLOBAL_DEF("application/config/quit_on_go_back", true); + GLOBAL_DEF("application/config/project_settings_override", ""); +#endif // !PIXEL_ENGINE + GLOBAL_DEF("application/run/disable_stdout", false); + GLOBAL_DEF("application/run/disable_stderr", false); + GLOBAL_DEF("application/run/print_header", true); + GLOBAL_DEF("application/run/enable_alt_space_menu", false); // The default window size is tuned to: // - Have a 16:9 aspect ratio, @@ -1504,16 +1532,24 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF(PropertyInfo(Variant::INT, "display/window/size/window_width_override", PROPERTY_HINT_RANGE, "0,7680,1,or_greater"), 0); // 8K resolution GLOBAL_DEF(PropertyInfo(Variant::INT, "display/window/size/window_height_override", PROPERTY_HINT_RANGE, "0,4320,1,or_greater"), 0); // 8K resolution +#ifndef PIXEL_ENGINE GLOBAL_DEF("display/window/energy_saving/keep_screen_on", true); +#else + GLOBAL_DEF("display/window/energy_saving/keep_screen_on", false); +#endif // !PIXEL_ENGINE GLOBAL_DEF("animation/warnings/check_invalid_track_paths", true); GLOBAL_DEF("animation/warnings/check_angle_interpolation_type_conflicting", true); +#ifndef PIXEL_ENGINE GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "audio/buses/default_bus_layout", PROPERTY_HINT_FILE, "*.tres"), "res://default_bus_layout.tres"); +#endif // !PIXEL_ENGINE GLOBAL_DEF(PropertyInfo(Variant::INT, "audio/general/default_playback_type", PROPERTY_HINT_ENUM, "Stream,Sample"), 0); GLOBAL_DEF(PropertyInfo(Variant::INT, "audio/general/default_playback_type.web", PROPERTY_HINT_ENUM, "Stream,Sample"), 1); GLOBAL_DEF_RST("audio/general/text_to_speech", false); +#ifndef PIXEL_ENGINE GLOBAL_DEF_RST(PropertyInfo(Variant::FLOAT, "audio/general/2d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"), 0.5f); GLOBAL_DEF_RST(PropertyInfo(Variant::FLOAT, "audio/general/3d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"), 0.5f); +#endif // !PIXEL_ENGINE GLOBAL_DEF(PropertyInfo(Variant::INT, "audio/general/ios/session_category", PROPERTY_HINT_ENUM, "Ambient,Multi Route,Play and Record,Playback,Record,Solo Ambient"), 0); GLOBAL_DEF("audio/general/ios/mix_with_others", false); @@ -1522,7 +1558,9 @@ ProjectSettings::ProjectSettings() { // Keep the enum values in sync with the `DisplayServer::ScreenOrientation` enum. custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::INT, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor"); +#ifndef PIXEL_ENGINE GLOBAL_DEF("display/window/subwindows/embed_subwindows", true); +#endif // !PIXEL_ENGINE // Keep the enum values in sync with the `DisplayServer::VSyncMode` enum. custom_prop_info["display/window/vsync/vsync_mode"] = PropertyInfo(Variant::INT, "display/window/vsync/vsync_mode", PROPERTY_HINT_ENUM, "Disabled,Enabled,Adaptive,Mailbox"); @@ -1533,9 +1571,11 @@ ProjectSettings::ProjectSettings() { custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Safe:1,Separate"); #else custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Unsafe (deprecated),Safe,Separate"); -#endif +#endif // DISABLE_DEPRECATED +#ifndef PIXEL_ENGINE GLOBAL_DEF("physics/2d/run_on_separate_thread", false); GLOBAL_DEF("physics/3d/run_on_separate_thread", false); +#endif // !PIXEL_ENGINE GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,canvas_items,viewport"), "disabled"); GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"), "keep"); @@ -1558,9 +1598,11 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/occlusion_culling/bvh_build_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), 2); GLOBAL_DEF_RST("rendering/occlusion_culling/jitter_projection", true); +#ifndef PIXEL_ENGINE GLOBAL_DEF_RST("internationalization/rendering/force_right_to_left_layout_direction", false); GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "internationalization/rendering/root_node_layout_direction", PROPERTY_HINT_ENUM, "Based on Application Locale,Left-to-Right,Right-to-Left,Based on System Locale"), 0); GLOBAL_DEF_BASIC("internationalization/rendering/root_node_auto_translate", true); +#endif // !PIXEL_ENGINE GLOBAL_DEF(PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater"), 2000); GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"), 0.5); diff --git a/core/config/project_settings.h b/core/config/project_settings.h index 922c88c15132..7594ec1c574b 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -45,7 +45,9 @@ class ProjectSettings : public Object { public: typedef HashMap CustomMap; +#ifndef PIXEL_ENGINE static const String PROJECT_DATA_DIR_NAME_SUFFIX; +#endif // !PIXEL_ENGINE enum { // Properties that are not for built in values begin from this value, so builtin ones are displayed first. diff --git a/core/version.h b/core/version.h index 18a97cadf0de..00a77734f8c8 100644 --- a/core/version.h +++ b/core/version.h @@ -48,6 +48,7 @@ // Defines the main "branch" version. Patch versions in this branch should be // forward-compatible. // Example: "3.1" +#define PIXEL_VERSION _MKSTR(PIXEL_MAJOR) "." _MKSTR(PIXEL_MINOR) "." _MKSTR(PIXEL_PATCH) #define VERSION_BRANCH _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) #if VERSION_PATCH // Example: "3.1.4" diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 669e6c2aa951..27fa8de4eeee 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -314,7 +314,11 @@ Error AudioDriverPulseAudio::init() { if (Engine::get_singleton()->is_editor_hint()) { context_name = VERSION_NAME " Editor"; } else { +#ifndef PIXEL_ENGINE context_name = GLOBAL_GET("application/config/name"); +#else + context_name = "Pixel Engine"; +#endif // !PIXEL_ENGINE if (context_name.is_empty()) { context_name = VERSION_NAME " Project"; } diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 1fc7816774cd..8ec927d4ee56 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -960,6 +960,7 @@ void OS_Unix::unset_environment(const String &p_var) const { } String OS_Unix::get_user_data_dir() const { +#ifndef PIXEL_ENGINE String appname = get_safe_dir_name(GLOBAL_GET("application/config/name")); if (!appname.is_empty()) { bool use_custom_dir = GLOBAL_GET("application/config/use_custom_user_dir"); @@ -973,8 +974,10 @@ String OS_Unix::get_user_data_dir() const { return get_data_path().path_join(get_godot_dir_name()).path_join("app_userdata").path_join(appname); } } - return get_data_path().path_join(get_godot_dir_name()).path_join("app_userdata").path_join("[unnamed project]"); +#else + return get_data_path().path_join(get_godot_dir_name()); +#endif // !PIXEL_ENGINE } String OS_Unix::get_executable_path() const { diff --git a/drivers/vulkan/rendering_context_driver_vulkan.cpp b/drivers/vulkan/rendering_context_driver_vulkan.cpp index df9bd986240d..9b1324120eb8 100644 --- a/drivers/vulkan/rendering_context_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_context_driver_vulkan.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "core/string/ustring.h" #ifdef VULKAN_ENABLED #include "rendering_context_driver_vulkan.h" @@ -682,12 +683,16 @@ Error RenderingContextDriverVulkan::_initialize_instance() { // to anything but 1.0. Note that this value is only used by validation layers to warn us about version issues. uint32_t application_api_version = instance_api_version == VK_API_VERSION_1_0 ? VK_API_VERSION_1_0 : VK_API_VERSION_1_2; +#ifndef PIXEL_ENGINE CharString cs = GLOBAL_GET("application/config/name").operator String().utf8(); +#else + CharString cs = String("Pixel Engine").utf8(); +#endif // !PIXEL_ENGINE VkApplicationInfo app_info = {}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pApplicationName = cs.get_data(); app_info.pEngineName = VERSION_NAME; - app_info.engineVersion = VK_MAKE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); + app_info.engineVersion = VK_MAKE_VERSION(PIXEL_MAJOR, PIXEL_MINOR, PIXEL_PATCH); app_info.apiVersion = application_api_version; TightLocalVector enabled_layer_names; diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp index 9ab97abd56ca..cb48e6d21b7b 100644 --- a/editor/import/3d/resource_importer_scene.cpp +++ b/editor/import/3d/resource_importer_scene.cpp @@ -40,7 +40,7 @@ #include "editor/import/3d/scene_import_settings.h" #include "scene/3d/importer_mesh_instance_3d.h" #include "scene/3d/mesh_instance_3d.h" -#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/navigation/navigation_region_3d.h" #include "scene/3d/occluder_instance_3d.h" #include "scene/3d/physics/area_3d.h" #include "scene/3d/physics/collision_shape_3d.h" diff --git a/editor/import/3d/resource_importer_scene.h b/editor/import/3d/resource_importer_scene.h index 6868baf023ba..ea2de51bef0b 100644 --- a/editor/import/3d/resource_importer_scene.h +++ b/editor/import/3d/resource_importer_scene.h @@ -35,12 +35,12 @@ #include "core/io/resource_importer.h" #include "core/variant/dictionary.h" #include "scene/3d/importer_mesh_instance_3d.h" -#include "scene/resources/3d/box_shape_3d.h" -#include "scene/resources/3d/capsule_shape_3d.h" -#include "scene/resources/3d/cylinder_shape_3d.h" +#include "scene/resources/3d/physics/box_shape_3d.h" +#include "scene/resources/3d/physics/capsule_shape_3d.h" +#include "scene/resources/3d/physics/cylinder_shape_3d.h" +#include "scene/resources/3d/physics/sphere_shape_3d.h" #include "scene/resources/3d/importer_mesh.h" #include "scene/resources/3d/skin.h" -#include "scene/resources/3d/sphere_shape_3d.h" #include "scene/resources/animation.h" #include "scene/resources/mesh.h" diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 5ef205a967e3..f2d48de0f31d 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -62,7 +62,7 @@ #include "scene/2d/polygon_2d.h" #include "scene/2d/skeleton_2d.h" #include "scene/2d/sprite_2d.h" -#include "scene/2d/touch_screen_button.h" +#include "scene/2d/physics/touch_screen_button.h" #include "scene/gui/base_button.h" #include "scene/gui/flow_container.h" #include "scene/gui/grid_container.h" diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index d45223812fab..490918102f77 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -36,14 +36,14 @@ #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "scene/main/viewport.h" -#include "scene/resources/2d/capsule_shape_2d.h" -#include "scene/resources/2d/circle_shape_2d.h" -#include "scene/resources/2d/concave_polygon_shape_2d.h" -#include "scene/resources/2d/convex_polygon_shape_2d.h" -#include "scene/resources/2d/rectangle_shape_2d.h" -#include "scene/resources/2d/segment_shape_2d.h" -#include "scene/resources/2d/separation_ray_shape_2d.h" -#include "scene/resources/2d/world_boundary_shape_2d.h" +#include "scene/resources/2d/physics/capsule_shape_2d.h" +#include "scene/resources/2d/physics/circle_shape_2d.h" +#include "scene/resources/2d/physics/concave_polygon_shape_2d.h" +#include "scene/resources/2d/physics/convex_polygon_shape_2d.h" +#include "scene/resources/2d/physics/rectangle_shape_2d.h" +#include "scene/resources/2d/physics/segment_shape_2d.h" +#include "scene/resources/2d/physics/separation_ray_shape_2d.h" +#include "scene/resources/2d/physics/world_boundary_shape_2d.h" CollisionShape2DEditor::CollisionShape2DEditor() { grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius"); diff --git a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp index b92abbcf79c0..4de42b4351c7 100644 --- a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp @@ -37,14 +37,14 @@ #include "editor/plugins/gizmos/gizmo_3d_helper.h" #include "editor/plugins/node_3d_editor_plugin.h" #include "scene/3d/physics/collision_shape_3d.h" -#include "scene/resources/3d/box_shape_3d.h" -#include "scene/resources/3d/capsule_shape_3d.h" -#include "scene/resources/3d/concave_polygon_shape_3d.h" -#include "scene/resources/3d/convex_polygon_shape_3d.h" -#include "scene/resources/3d/cylinder_shape_3d.h" +#include "scene/resources/3d/physics/box_shape_3d.h" +#include "scene/resources/3d/physics/capsule_shape_3d.h" +#include "scene/resources/3d/physics/concave_polygon_shape_3d.h" +#include "scene/resources/3d/physics/convex_polygon_shape_3d.h" +#include "scene/resources/3d/physics/cylinder_shape_3d.h" #include "scene/resources/3d/height_map_shape_3d.h" #include "scene/resources/3d/separation_ray_shape_3d.h" -#include "scene/resources/3d/sphere_shape_3d.h" +#include "scene/resources/3d/physics/sphere_shape_3d.h" #include "scene/resources/3d/world_boundary_shape_3d.h" CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() { diff --git a/editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.cpp index 51d15a0a70f7..b0f6646dcfe2 100644 --- a/editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.cpp @@ -32,7 +32,7 @@ #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/node_3d_editor_plugin.h" -#include "scene/3d/navigation_link_3d.h" +#include "scene/3d/navigation/navigation_link_3d.h" #include "servers/navigation_server_3d.h" NavigationLink3DGizmoPlugin::NavigationLink3DGizmoPlugin() { diff --git a/editor/plugins/gizmos/navigation_region_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/navigation_region_3d_gizmo_plugin.cpp index 14105f0b3bf6..172b1f027b9f 100644 --- a/editor/plugins/gizmos/navigation_region_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/navigation_region_3d_gizmo_plugin.cpp @@ -31,7 +31,7 @@ #include "navigation_region_3d_gizmo_plugin.h" #include "editor/plugins/node_3d_editor_plugin.h" -#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/navigation/navigation_region_3d.h" #include "servers/navigation_server_3d.h" NavigationRegion3DGizmoPlugin::NavigationRegion3DGizmoPlugin() { diff --git a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp index 74c55bf3dddc..58f716b3fb3a 100644 --- a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp @@ -33,7 +33,7 @@ #include "editor/editor_settings.h" #include "editor/plugins/node_3d_editor_plugin.h" #include "scene/3d/physics/spring_arm_3d.h" -#include "scene/resources/3d/shape_3d.h" +#include "scene/resources/3d/physics/shape_3d.h" void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { SpringArm3D *spring_arm = Object::cast_to(p_gizmo->get_node_3d()); diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 515e6b44529f..00ca1497e077 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -36,7 +36,7 @@ #include "editor/multi_node_edit.h" #include "editor/plugins/node_3d_editor_plugin.h" #include "editor/themes/editor_scale.h" -#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/navigation/navigation_region_3d.h" #include "scene/3d/physics/collision_shape_3d.h" #include "scene/3d/physics/physics_body_3d.h" #include "scene/3d/physics/static_body_3d.h" @@ -45,8 +45,8 @@ #include "scene/gui/dialogs.h" #include "scene/gui/menu_button.h" #include "scene/gui/spin_box.h" -#include "scene/resources/3d/concave_polygon_shape_3d.h" -#include "scene/resources/3d/convex_polygon_shape_3d.h" +#include "scene/resources/3d/physics/concave_polygon_shape_3d.h" +#include "scene/resources/3d/physics/convex_polygon_shape_3d.h" #include "scene/resources/3d/primitive_meshes.h" void MeshInstance3DEditor::_node_removed(Node *p_node) { diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 39401e27388e..9a1bb0a42bcf 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -39,7 +39,7 @@ #include "editor/plugins/node_3d_editor_plugin.h" #include "main/main.h" #include "scene/3d/mesh_instance_3d.h" -#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/navigation/navigation_region_3d.h" #include "scene/3d/physics/physics_body_3d.h" #include "scene/3d/physics/static_body_3d.h" #include "scene/gui/menu_button.h" diff --git a/editor/plugins/navigation_link_2d_editor_plugin.h b/editor/plugins/navigation_link_2d_editor_plugin.h index 7a4be18c3167..3fb01c3078d5 100644 --- a/editor/plugins/navigation_link_2d_editor_plugin.h +++ b/editor/plugins/navigation_link_2d_editor_plugin.h @@ -32,7 +32,7 @@ #define NAVIGATION_LINK_2D_EDITOR_PLUGIN_H #include "editor/plugins/editor_plugin.h" -#include "scene/2d/navigation_link_2d.h" +#include "scene/2d/navigation/navigation_link_2d.h" class CanvasItemEditor; diff --git a/editor/plugins/navigation_obstacle_2d_editor_plugin.h b/editor/plugins/navigation_obstacle_2d_editor_plugin.h index ae5b3a056aee..a30278a3689d 100644 --- a/editor/plugins/navigation_obstacle_2d_editor_plugin.h +++ b/editor/plugins/navigation_obstacle_2d_editor_plugin.h @@ -32,7 +32,7 @@ #define NAVIGATION_OBSTACLE_2D_EDITOR_PLUGIN_H #include "editor/plugins/abstract_polygon_2d_editor.h" -#include "scene/2d/navigation_obstacle_2d.h" +#include "scene/2d/navigation/navigation_obstacle_2d.h" class NavigationObstacle2DEditor : public AbstractPolygon2DEditor { GDCLASS(NavigationObstacle2DEditor, AbstractPolygon2DEditor); diff --git a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp index ee385b6dceac..9aaec7fcfd37 100644 --- a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp +++ b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp @@ -37,7 +37,7 @@ #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/plugins/node_3d_editor_plugin.h" -#include "scene/3d/navigation_obstacle_3d.h" +#include "scene/3d/navigation/navigation_obstacle_3d.h" #include "scene/gui/button.h" #include "scene/gui/dialogs.h" #include "servers/navigation_server_3d.h" diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index c11a7cf20e2f..0ca7cf37f24f 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -33,7 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" -#include "scene/2d/navigation_region_2d.h" +#include "scene/2d/navigation/navigation_region_2d.h" #include "scene/gui/dialogs.h" Ref NavigationPolygonEditor::_ensure_navpoly() const { diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index c4abc5b20cf2..01404f91c7d6 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -48,7 +48,7 @@ #include "scene/gui/separator.h" #include "scene/gui/texture_rect.h" #include "scene/property_utils.h" -#include "scene/resources/3d/capsule_shape_3d.h" +#include "scene/resources/3d/physics/capsule_shape_3d.h" #include "scene/resources/skeleton_profile.h" #include "scene/resources/surface_tool.h" diff --git a/main/main.cpp b/main/main.cpp index b3b6d960e7a1..b717ef7a2505 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -28,6 +28,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +/**************************************************************************/ +/* PIXEL ENGINE */ +/* Copyright (c) 2024-present Pixel Engine contributors (see AUTHORS.md). */ +/**************************************************************************/ +/* NOTICE: */ +/* This file contains modifications and additions specific to the Pixel */ +/* Engine project. While these changes are licensed under the MIT license */ +/* for compatibility, we request proper attribution if reused in any */ +/* derivative works, including meta-forks. */ +/**************************************************************************/ + #include "main.h" #include "core/config/project_settings.h" @@ -58,6 +69,7 @@ #include "main/performance.h" #include "main/splash.gen.h" #include "modules/register_module_types.h" +#include "pixel/main_tree.h" #include "platform/register_platform_apis.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" @@ -70,16 +82,19 @@ #include "servers/display_server.h" #include "servers/movie_writer/movie_writer.h" #include "servers/movie_writer/movie_writer_mjpeg.h" +#ifndef _NAVIGATION_DISABLED +#include "servers/navigation_server_2d.h" +#include "servers/navigation_server_2d_dummy.h" #include "servers/navigation_server_3d.h" #include "servers/navigation_server_3d_dummy.h" +#endif // !_NAVIGATION_DISABLED #include "servers/register_server_types.h" #include "servers/rendering/rendering_server_default.h" #include "servers/text/text_server_dummy.h" #include "servers/text_server.h" // 2D -#include "servers/navigation_server_2d.h" -#include "servers/navigation_server_2d_dummy.h" +#ifndef _PHYSICS_DISABLED #include "servers/physics_server_2d.h" #include "servers/physics_server_2d_dummy.h" @@ -88,6 +103,7 @@ #include "servers/physics_server_3d_dummy.h" #include "servers/xr_server.h" #endif // _3D_DISABLED +#endif // !_PHYSICS_DISABLED #ifdef TESTS_ENABLED #include "tests/test_main.h" @@ -162,15 +178,19 @@ static DisplayServer *display_server = nullptr; static RenderingServer *rendering_server = nullptr; static TextServerManager *tsman = nullptr; static ThemeDB *theme_db = nullptr; +#ifndef _NAVIGATION_DISABLED static NavigationServer2D *navigation_server_2d = nullptr; +static NavigationServer3D *navigation_server_3d = nullptr; +#endif // !_NAVIGATION_DISABLED +#ifndef _PHYSICS_DISABLED static PhysicsServer2DManager *physics_server_2d_manager = nullptr; static PhysicsServer2D *physics_server_2d = nullptr; -static NavigationServer3D *navigation_server_3d = nullptr; #ifndef _3D_DISABLED static PhysicsServer3DManager *physics_server_3d_manager = nullptr; static PhysicsServer3D *physics_server_3d = nullptr; static XRServer *xr_server = nullptr; -#endif // _3D_DISABLED +#endif // !_3D_DISABLED +#endif // !_PHYSICS_DISABLED // We error out if setup2() doesn't turn this true static bool _start_success = false; @@ -189,6 +209,7 @@ static int audio_driver_idx = -1; static bool single_window = false; static bool editor = false; static bool project_manager = false; +static bool pixel_engine = false; static bool cmdline_tool = false; static String locale; static String log_file; @@ -314,6 +335,7 @@ static Vector get_files_with_extension(const String &p_root, const Strin } #endif +#ifndef _PHYSICS_DISABLED // FIXME: Could maybe be moved to have less code in main.cpp. void initialize_physics() { #ifndef _3D_DISABLED @@ -334,7 +356,7 @@ void initialize_physics() { // Should be impossible, but make sure it's not null. ERR_FAIL_NULL_MSG(physics_server_3d, "Failed to initialize PhysicsServer3D."); physics_server_3d->init(); -#endif // _3D_DISABLED +#endif // !_3D_DISABLED // 2D Physics server physics_server_2d = PhysicsServer2DManager::get_singleton()->new_server( @@ -359,11 +381,12 @@ void finalize_physics() { #ifndef _3D_DISABLED physics_server_3d->finish(); memdelete(physics_server_3d); -#endif // _3D_DISABLED +#endif // !_3D_DISABLED physics_server_2d->finish(); memdelete(physics_server_2d); } +#endif // !_PHYSICS_DISABLED void finalize_display() { rendering_server->finish(); @@ -372,6 +395,7 @@ void finalize_display() { memdelete(display_server); } +#ifndef _NAVIGATION_DISABLED void initialize_navigation_server() { ERR_FAIL_COND(navigation_server_3d != nullptr); ERR_FAIL_COND(navigation_server_2d != nullptr); @@ -409,6 +433,7 @@ void finalize_navigation_server() { memdelete(navigation_server_2d); navigation_server_2d = nullptr; } +#endif // !_NAVIGATION_DISABLED void initialize_theme_db() { theme_db = memnew(ThemeDB); @@ -731,11 +756,12 @@ Error Main::test_setup() { tsman->add_interface(ts); } +#ifndef _PHYSICS_DISABLED #ifndef _3D_DISABLED physics_server_3d_manager = memnew(PhysicsServer3DManager); -#endif // _3D_DISABLED +#endif // !_3D_DISABLED physics_server_2d_manager = memnew(PhysicsServer2DManager); - +#endif // !_PHYSICS_DISABLED // From `Main::setup2()`. register_early_core_singletons(); initialize_modules(MODULE_INITIALIZATION_LEVEL_CORE); @@ -786,7 +812,9 @@ Error Main::test_setup() { // Theme needs modules to be initialized so that sub-resources can be loaded. theme_db->initialize_theme_noproject(); +#ifndef _NAVIGATION_DISABLED initialize_navigation_server(); +#endif // !_NAVIGATION_DISABLED ERR_FAIL_COND_V(TextServerManager::get_singleton()->get_interface_count() == 0, ERR_CANT_CREATE); @@ -848,7 +876,9 @@ void Main::test_cleanup() { finalize_theme_db(); +#ifndef _NAVIGATION_DISABLED finalize_navigation_server(); +#endif // !_NAVIGATION_DISABLED GDExtensionManager::get_singleton()->deinitialize_extensions(GDExtension::INITIALIZATION_LEVEL_SERVERS); uninitialize_modules(MODULE_INITIALIZATION_LEVEL_SERVERS); @@ -866,14 +896,16 @@ void Main::test_cleanup() { if (tsman) { memdelete(tsman); } +#ifndef _PHYSICS_DISABLED #ifndef _3D_DISABLED if (physics_server_3d_manager) { memdelete(physics_server_3d_manager); } -#endif // _3D_DISABLED +#endif // !_3D_DISABLED if (physics_server_2d_manager) { memdelete(physics_server_2d_manager); } +#endif // !_PHYSICS_DISABLED if (globals) { memdelete(globals); } @@ -1002,7 +1034,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String audio_driver = ""; String project_path = "."; +#ifndef PIXEL_ENGINE bool upwards = false; +#endif // !PIXEL_ENGINE String debug_uri = ""; bool skip_breakpoints = false; String main_pack; @@ -1596,8 +1630,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing relative or absolute path, aborting.\n"); goto error; } +#ifndef PIXEL_ENGINE } else if (arg == "-u" || arg == "--upwards") { // scan folders upwards upwards = true; +#endif // !PIXEL_ENGINE } else if (arg == "--quit") { // Auto quit at the end of the first main loop iteration quit_after = 1; } else if (arg == "--quit-after") { // Quit after the given number of iterations @@ -1846,11 +1882,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } } +#ifndef PIXEL_ENGINE OS::get_singleton()->_in_editor = editor; if (globals->setup(project_path, main_pack, upwards, editor) == OK) { #ifdef TOOLS_ENABLED found_project = true; -#endif +#endif // TOOLS_ENABLED } else { #ifdef TOOLS_ENABLED editor = false; @@ -1860,13 +1897,19 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->alert(error_msg); goto error; -#endif +#endif // TOOLS_ENABLED + } +#else + if (FileAccess::exists(OS::get_singleton()->get_user_data_dir().path_join("settings.pixel"))) { + globals->setup(OS::get_singleton()->get_user_data_dir(), ""); } + pixel_engine = true; +#endif // Initialize WorkerThreadPool. { #ifdef THREADS_ENABLED - if (editor || project_manager) { + if (editor || project_manager || pixel_engine) { WorkerThreadPool::get_singleton()->init(-1, 0.75); } else { int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads"); @@ -1913,7 +1956,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Initialize user data dir. OS::get_singleton()->ensure_user_data_dir(); +#ifndef PIXEL_ENGINE OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false)); +#else + OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", true)); +#endif // !PIXEL_ENGINE OS::get_singleton()->set_low_processor_usage_mode_sleep_usec( GLOBAL_DEF(PropertyInfo(Variant::INT, "application/run/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "0,33200,1,or_greater"), 6900)); // Roughly 144 FPS @@ -1964,7 +2011,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // This also prevents logs from being created for the editor instance, as feature tags // are disabled while in the editor (even if they should logically apply). GLOBAL_DEF("debug/file_logging/enable_file_logging.pc", true); - GLOBAL_DEF("debug/file_logging/log_path", "user://logs/godot.log"); + GLOBAL_DEF("debug/file_logging/log_path", "user://logs/pixel.log"); GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/file_logging/max_log_files", PROPERTY_HINT_RANGE, "0,20,1,or_greater"), 5); // If `--log-file` is used to override the log path, allow creating logs for the project manager or editor @@ -1988,21 +2035,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->add_logger(memnew(RotatedFileLogger(base_path, max_files))); } - if (main_args.size() == 0 && String(GLOBAL_GET("application/run/main_scene")) == "") { +#ifndef PIXEL_ENGINE + if (!pixel_engine && main_args.size() == 0 && String(GLOBAL_GET("application/run/main_scene")) == "") { #ifdef TOOLS_ENABLED if (!editor && !project_manager) { -#endif +#endif // TOOLS_ENABLED const String error_msg = "Error: Can't run project: no main scene defined in the project.\n"; OS::get_singleton()->print("%s", error_msg.utf8().get_data()); OS::get_singleton()->alert(error_msg); goto error; #ifdef TOOLS_ENABLED } -#endif +#endif // TOOLS_ENABLED } +#endif // !PIXEL_ENGINE - if (editor || project_manager) { - Engine::get_singleton()->set_editor_hint(true); + if (editor || project_manager || pixel_engine) { + Engine::get_singleton()->set_editor_hint(!pixel_engine); use_custom_res = false; input_map->load_default(); //keys for editor } else { @@ -2896,11 +2945,12 @@ Error Main::setup2(bool p_show_boot_logo) { ts.instantiate(); tsman->add_interface(ts); } - +#ifndef _PHYSICS_DISABLED #ifndef _3D_DISABLED physics_server_3d_manager = memnew(PhysicsServer3DManager); -#endif // _3D_DISABLED +#endif // !_3D_DISABLED physics_server_2d_manager = memnew(PhysicsServer2DManager); +#endif // !_PHYSICS_DISABLED register_server_types(); { @@ -3014,15 +3064,16 @@ Error Main::setup2(bool p_show_boot_logo) { if (tsman) { memdelete(tsman); } +#ifndef _PHYSICS_DISABLED #ifndef _3D_DISABLED if (physics_server_3d_manager) { memdelete(physics_server_3d_manager); } -#endif // _3D_DISABLED +#endif // !_3D_DISABLED if (physics_server_2d_manager) { memdelete(physics_server_2d_manager); } - +#endif // !_PHYSICS_DISABLED return err; } @@ -3359,7 +3410,9 @@ Error Main::setup2(bool p_show_boot_logo) { extensions.push_back("cs"); } extensions.push_back("gdshader"); +#ifdef TOOLS_ENABLED GLOBAL_DEF_NOVAL(PropertyInfo(Variant::PACKED_STRING_ARRAY, "editor/script/search_in_file_extensions"), extensions); // Note: should be defined after Scene level modules init to see .NET. +#endif // TOOLS_ENABLED OS::get_singleton()->benchmark_end_measure("Startup", "Scene"); @@ -3407,11 +3460,15 @@ Error Main::setup2(bool p_show_boot_logo) { MAIN_PRINT("Main: Load Physics"); +#ifndef _PHYSICS_DISABLED initialize_physics(); +#endif // !_PHYSICS_DISABLED MAIN_PRINT("Main: Load Navigation"); +#ifndef _NAVIGATION_DISABLED initialize_navigation_server(); +#endif // !_NAVIGATION_DISABLED register_server_singletons(); @@ -3569,8 +3626,9 @@ int Main::start() { #endif // TOOLS_ENABLED main_timer_sync.init(OS::get_singleton()->get_ticks_usec()); - List args = OS::get_singleton()->get_cmdline_args(); +#ifndef PIXEL_ENGINE + List args = OS::get_singleton()->get_cmdline_args(); for (List::Element *E = args.front(); E; E = E->next()) { // First check parameters that do not have an argument to the right. @@ -3675,6 +3733,7 @@ int Main::start() { } #endif } +#endif // !PIXEL_ENGINE uint64_t minimum_time_msec = GLOBAL_DEF(PropertyInfo(Variant::INT, "application/boot_splash/minimum_display_time", PROPERTY_HINT_RANGE, "0,100,1,or_greater,suffix:ms"), 0); if (Engine::get_singleton()->is_editor_hint()) { @@ -3817,9 +3876,11 @@ int Main::start() { #endif // TOOLS_ENABLED +#ifndef PIXEL_ENGINE if (script.is_empty() && game_path.is_empty() && String(GLOBAL_GET("application/run/main_scene")) != "") { game_path = GLOBAL_GET("application/run/main_scene"); } +#endif // !PIXEL_ENGINE #ifdef TOOLS_ENABLED if (!editor && !project_manager && !cmdline_tool && script.is_empty() && game_path.is_empty()) { @@ -3832,13 +3893,21 @@ int Main::start() { } #endif +#ifdef PIXEL_ENGINE + pixel_engine = true; +#endif + MainLoop *main_loop = nullptr; if (editor) { main_loop = memnew(SceneTree); + } else if (pixel_engine) { + main_loop = memnew(MainTree); } +#ifndef PIXEL_ENGINE if (main_loop_type.is_empty()) { main_loop_type = GLOBAL_GET("application/run/main_loop_type"); } +#endif // !PIXEL_ENGINE if (!script.is_empty()) { Ref