Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@
//Figure out correct reduction
int reqReduction=WW3D::Get_Texture_Reduction(); //requested reduction

if (reqReduction >= mip_count)

Check warning on line 1331 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+e

'>=': signed/unsigned mismatch

Check warning on line 1331 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+e

'>=': signed/unsigned mismatch

Check warning on line 1331 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+e

'>=': signed/unsigned mismatch
reqReduction=mip_count-1; //leave only the lowest level

//Clamp reduction
Expand Down Expand Up @@ -1365,7 +1365,7 @@
//Figure out correct reduction
int reqReduction=WW3D::Get_Texture_Reduction(); //requested reduction

if (reqReduction >= mip_count)

Check warning on line 1368 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+e

'>=': signed/unsigned mismatch

Check warning on line 1368 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+e

'>=': signed/unsigned mismatch

Check warning on line 1368 in GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+e

'>=': signed/unsigned mismatch
reqReduction=mip_count-1; //leave only the lowest level

//Clamp reduction
Expand Down Expand Up @@ -1532,6 +1532,11 @@
#endif
);

// Verify texture creation succeeded
if (!D3DTexture) {
return false;
}

MipLevelCount = mip_level_count;

return true;
Expand Down Expand Up @@ -1627,6 +1632,11 @@
#endif
);

// Verify texture creation succeeded
if (!D3DTexture) {
return false;
}

return true;
}

Expand Down Expand Up @@ -1777,6 +1787,12 @@

void TextureLoadTaskClass::Lock_Surfaces(void)
{
// Defensive check: verify D3DTexture is valid before dereferencing
if (!D3DTexture) {
WWASSERT(D3DTexture);
return;
}

MipLevelCount = D3DTexture->GetLevelCount();

for (unsigned int i = 0; i < MipLevelCount; ++i)
Expand Down
Loading