Skip to content

Commit 988d557

Browse files
committed
mathlib: Dump exact color component whic his out of range
1 parent e70e372 commit 988d557

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mathlib/color_conversion.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,12 @@ void XM_CALLCONV VectorToColorRGBExp32( const Vector& vin, ColorRGBExp32 &c )
479479
const float b = vin.z * scalar;
480480

481481
// Above 255 would be right out.
482-
AssertMsg( r <= 255.0f && g <= 255.0f && b <= 255.0f,
483-
"(R = %.2f, G = %.2f, B = %.2f): component > 255.",
484-
r, g, b );
482+
AssertMsg( r <= 255.0f,
483+
"(R %.2f, G %.2f, B %.2f): R > 255.", r, g, b );
484+
AssertMsg( g <= 255.0f,
485+
"(R %.2f, G %.2f, B %.2f): G > 255.", r, g, b );
486+
AssertMsg( b <= 255.0f,
487+
"(R %.2f, G %.2f, B %.2f): B > 255.", r, g, b );
485488

486489
c.r = static_cast<byte>( static_cast<int>(r) );
487490
c.g = static_cast<byte>( static_cast<int>(g) );

0 commit comments

Comments
 (0)