File tree Expand file tree Collapse file tree
Core/Libraries/Source/WWVegas/WW3D2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ void TextureLoader::Validate_Texture_Size
373373 }
374374
375375 unsigned poweroftwodepth = 1 ;
376- while (poweroftwodepth< depth)
376+ while (poweroftwodepth < depth)
377377 {
378378 poweroftwodepth <<= 1 ;
379379 }
@@ -391,18 +391,22 @@ void TextureLoader::Validate_Texture_Size
391391 poweroftwodepth=dx8caps.MaxVolumeExtent ;
392392 }
393393
394- if (poweroftwowidth>poweroftwoheight)
394+ const unsigned maxTextureAspectRatio = dx8caps.MaxTextureAspectRatio ;
395+ if (maxTextureAspectRatio != 0 )
395396 {
396- while (poweroftwowidth/poweroftwoheight> 8 )
397+ if (poweroftwowidth>poweroftwoheight )
397398 {
398- poweroftwoheight*=2 ;
399+ while (poweroftwowidth/poweroftwoheight > maxTextureAspectRatio)
400+ {
401+ poweroftwoheight*=2 ;
402+ }
399403 }
400- }
401- else
402- {
403- while (poweroftwoheight/poweroftwowidth>8 )
404+ else
404405 {
405- poweroftwowidth*=2 ;
406+ while (poweroftwoheight/poweroftwowidth > maxTextureAspectRatio)
407+ {
408+ poweroftwowidth*=2 ;
409+ }
406410 }
407411 }
408412
You can’t perform that action at this time.
0 commit comments