From c1bc1ee23b3675a4d3cbd3c290e317ada6e5df60 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 13 Jun 2026 12:22:11 +0200 Subject: [PATCH 1/2] bugfix(textureloader): Lift hardcoded texture aspect ratio limit of 1:8 to allow all textures with modern gpu --- .../Source/WWVegas/WW3D2/textureloader.cpp | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index f46cffff6ee..ad7494b55e4 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -373,7 +373,7 @@ void TextureLoader::Validate_Texture_Size } unsigned poweroftwodepth = 1; - while (poweroftwodepth< depth) + while (poweroftwodepth < depth) { poweroftwodepth <<= 1; } @@ -391,18 +391,22 @@ void TextureLoader::Validate_Texture_Size poweroftwodepth=dx8caps.MaxVolumeExtent; } - if (poweroftwowidth>poweroftwoheight) + const int maxTextureAspectRatio = dx8caps.MaxTextureAspectRatio; + if (maxTextureAspectRatio != 0) { - while (poweroftwowidth/poweroftwoheight>8) + if (poweroftwowidth>poweroftwoheight) { - poweroftwoheight*=2; + while (poweroftwowidth/poweroftwoheight > maxTextureAspectRatio) + { + poweroftwoheight*=2; + } } - } - else - { - while (poweroftwoheight/poweroftwowidth>8) + else { - poweroftwowidth*=2; + while (poweroftwoheight/poweroftwowidth > maxTextureAspectRatio) + { + poweroftwowidth*=2; + } } } From abf55ca1c26b939c1ee653f9f031f56209b5098b Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 13 Jun 2026 13:18:46 +0200 Subject: [PATCH 2/2] Fix type --- Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index ad7494b55e4..b42bb58b12e 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -391,7 +391,7 @@ void TextureLoader::Validate_Texture_Size poweroftwodepth=dx8caps.MaxVolumeExtent; } - const int maxTextureAspectRatio = dx8caps.MaxTextureAspectRatio; + const unsigned maxTextureAspectRatio = dx8caps.MaxTextureAspectRatio; if (maxTextureAspectRatio != 0) { if (poweroftwowidth>poweroftwoheight)