From d745186e0625cb7c56b2d1c00407224d729b1a91 Mon Sep 17 00:00:00 2001 From: Death Killer <884052+deathkiller@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:30:20 +0100 Subject: [PATCH] Fixed build --- Sources/Shared/IO/BoundedFileStream.cpp | 4 ++-- Sources/Shared/IO/FileStream.cpp | 2 +- Sources/nCine/Backends/SdlGfxDevice.cpp | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Shared/IO/BoundedFileStream.cpp b/Sources/Shared/IO/BoundedFileStream.cpp index 8850502e..4947c49a 100644 --- a/Sources/Shared/IO/BoundedFileStream.cpp +++ b/Sources/Shared/IO/BoundedFileStream.cpp @@ -54,8 +54,8 @@ namespace Death { namespace IO { DEATH_ASSERT(destination != nullptr, "destination is null", 0); std::int64_t pos = _underlyingStream.GetPosition() - _offset; - if (bytesToRead > _size - pos) { - bytesToRead = _size - pos; + if (bytesToRead > static_cast(_size) - pos) { + bytesToRead = static_cast(_size) - pos; } return _underlyingStream.Read(destination, bytesToRead); diff --git a/Sources/Shared/IO/FileStream.cpp b/Sources/Shared/IO/FileStream.cpp index 6bda2ad2..6f8b2ad3 100644 --- a/Sources/Shared/IO/FileStream.cpp +++ b/Sources/Shared/IO/FileStream.cpp @@ -109,7 +109,7 @@ namespace Death { namespace IO { } } else if (oldPos - _readPos <= pos && pos < oldPos + _readLength - _readPos) { // Some part of the buffer is still valid - std::int64_t diff = (pos - oldPos); + std::int32_t diff = static_cast(pos - oldPos); _readPos += diff; // Seek after the buffered part, so the position is still correct if (SeekInternal(_readLength - _readPos, SeekOrigin::Current) < 0) { diff --git a/Sources/nCine/Backends/SdlGfxDevice.cpp b/Sources/nCine/Backends/SdlGfxDevice.cpp index d37cdf9f..adf71f66 100644 --- a/Sources/nCine/Backends/SdlGfxDevice.cpp +++ b/Sources/nCine/Backends/SdlGfxDevice.cpp @@ -161,7 +161,9 @@ namespace nCine void SdlGfxDevice::initGraphics(bool enableWindowScaling) { +#if defined(SDL_HINT_APP_NAME) SDL_SetHint(SDL_HINT_APP_NAME, NCINE_APP_NAME); +#endif #if SDL_VERSION_ATLEAST(2, 24, 0) && defined(SDL_HINT_WINDOWS_DPI_SCALING) // Scaling is handled automatically by SDL (since v2.24.0)