diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed91db7d..e4545f31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,6 +253,11 @@ jobs: ref: ${{ github.base_ref }} path: SleakCraft + - name: Point the game at this engine revision + run: | + rm -rf SleakCraft/Engine + ln -s ../SleakEngine SleakCraft/Engine + - name: Install dependencies run: | sudo apt-get update diff --git a/include/public/Math/Vector.hpp b/include/public/Math/Vector.hpp index ad3ae8a8..bf256e56 100644 --- a/include/public/Math/Vector.hpp +++ b/include/public/Math/Vector.hpp @@ -43,17 +43,17 @@ namespace Sleak } // Access elements (read/write) - [[nodiscard]] T& operator[](size_t index) { + [[nodiscard]] constexpr T& operator[](size_t index) { assert(index < N && "Vector index out of range"); return data[index]; } // Read-only access - [[nodiscard]] const T& operator[](size_t index) const { + [[nodiscard]] constexpr const T& operator[](size_t index) const { assert(index < N && "Vector index out of range"); return data[index]; } - + // Basic operations Vector operator+(const Vector& other) const { Vector result; diff --git a/src/Graphics/DirectX11/DirectX11Renderer.cpp b/src/Graphics/DirectX11/DirectX11Renderer.cpp index e9b1a4bc..3d96421b 100644 --- a/src/Graphics/DirectX11/DirectX11Renderer.cpp +++ b/src/Graphics/DirectX11/DirectX11Renderer.cpp @@ -115,7 +115,21 @@ bool DirectX11Renderer::Initialize() { &deviceContext // Device context ); +#ifdef _DEBUG + if (hr == DXGI_ERROR_SDK_COMPONENT_MISSING) { + SLEAK_WARN( + "D3D11 debug layer is not installed, creating device without it"); + createDeviceFlags &= ~D3D11_CREATE_DEVICE_DEBUG; + hr = D3D11CreateDeviceAndSwapChain( + nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, createDeviceFlags, + featureLevels, 1, D3D11_SDK_VERSION, &swapChainDesc, &swapChain, + &device, nullptr, &deviceContext); + } +#endif + if (FAILED(hr)) { + SLEAK_ERROR("Failed to create device and swap chain! HRESULT: 0x{:X}", + (unsigned)hr); return false; }