From e392b99c60568aca2301cff43f7ad0f6ee758aad Mon Sep 17 00:00:00 2001 From: ryan-de-boer Date: Sat, 9 Aug 2025 13:06:19 +0800 Subject: [PATCH 1/3] Fix generals hang in infinite loop --- .../Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index 1aa58516a53..a0a739e19aa 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -1046,7 +1046,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() DDSFileClass dds_file(Texture->Get_Full_Path(),Get_Reduction()); if (dds_file.Is_Available()) { // Destination size will be the next power of two square from the larger width and height... - unsigned width, height, depth; + unsigned width=0, height=0, depth=0; // Depth is not used. width=dds_file.Get_Width(0); height=dds_file.Get_Height(0); TextureLoader::Validate_Texture_Size(width,height,depth); @@ -1120,7 +1120,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() } // Destination size will be the next power of two square from the larger width and height... - unsigned width=targa.Header.Width, height=targa.Header.Height, depth; + unsigned width=targa.Header.Width, height=targa.Header.Height, depth=0; // Depth is not used. int ReductionFactor=Get_Reduction(); int MipLevels=0; From bbc720cb1fe2fee8306fa5b8e20bc81450086e38 Mon Sep 17 00:00:00 2001 From: ryan-de-boer Date: Sun, 10 Aug 2025 12:16:21 +0800 Subject: [PATCH 2/3] Set depth to 1 --- .../Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp index a0a739e19aa..8af486294af 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp @@ -1046,7 +1046,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() DDSFileClass dds_file(Texture->Get_Full_Path(),Get_Reduction()); if (dds_file.Is_Available()) { // Destination size will be the next power of two square from the larger width and height... - unsigned width=0, height=0, depth=0; // Depth is not used. + unsigned width=0, height=0, depth=1; width=dds_file.Get_Width(0); height=dds_file.Get_Height(0); TextureLoader::Validate_Texture_Size(width,height,depth); @@ -1120,7 +1120,7 @@ void TextureLoadTaskClass::Begin_Texture_Load() } // Destination size will be the next power of two square from the larger width and height... - unsigned width=targa.Header.Width, height=targa.Header.Height, depth=0; // Depth is not used. + unsigned width=targa.Header.Width, height=targa.Header.Height, depth=1; int ReductionFactor=Get_Reduction(); int MipLevels=0; From efc148f2db3fa365277f2d98e3ee191eda1b24c8 Mon Sep 17 00:00:00 2001 From: ryan-de-boer Date: Sun, 10 Aug 2025 12:32:31 +0800 Subject: [PATCH 3/3] Set depth for ThumbnailClass --- .../Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp index ea536ff4435..6102a3777f2 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp @@ -92,7 +92,7 @@ ThumbnailClass::ThumbnailClass(const StringClass& filename) // Destination size will be the next power of two square from the larger width and height... Width=targa.Header.Width>>reduction_factor; Height=targa.Header.Height>>reduction_factor; - unsigned depth; + unsigned depth=1; TextureLoader::Validate_Texture_Size(Width,Height,depth); unsigned src_width=targa.Header.Width; unsigned src_height=targa.Header.Height;