Fix wrong colors on big endian platforms with burnings renders. Thx @kas1e for reporting and @curaga for the patch (#318).

Note: this patch just removes some old #ifdef __BIG_ENDIAN__ code, so it's slightly suspicious. But it does fix the
wrong color problems on big-endian platforms. 
See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52177 for the discusssion.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5602 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2018-02-18 16:03:52 +00:00
parent 30c123214e
commit f02f226712
2 changed files with 1 additions and 15 deletions

View File

@ -1,5 +1,6 @@
--------------------------
Changes in 1.9 (not yet released)
- Fix wrong colors on big endian platforms with burnings renders. Thx @kas1e for reporting and @curaga for the patch (#318). Forum bug discussion at http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52177.
- Fix bug #440 where OpenGL driver enabled second texture for single-texture materials when setMaterial was called twice. Thx@ "number Zero" for bugreport and test-case.
- Irrlicht icon now loaded with LR_DEFAULTSIZE to better support larger icon requests. Thx@ luthyr for report and bugfix.
- Cursor on X11 behaves now like on Win32 and doesn't try to clip positions to the window

View File

@ -646,17 +646,10 @@ inline s32 f32_to_23Bits(const f32 x)
*/
REALINLINE tVideoSample fix_to_color ( const tFixPoint r, const tFixPoint g, const tFixPoint b )
{
#ifdef __BIG_ENDIAN__
return FIXPOINT_COLOR_MAX |
( r & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - 8) |
( g & FIXPOINT_COLOR_MAX) << ( 16 - FIX_POINT_PRE ) |
( b & FIXPOINT_COLOR_MAX) << ( 24 - FIX_POINT_PRE );
#else
return ( FIXPOINT_COLOR_MAX & FIXPOINT_COLOR_MAX) << ( SHIFT_A - FIX_POINT_PRE ) |
( r & FIXPOINT_COLOR_MAX) << ( SHIFT_R - FIX_POINT_PRE ) |
( g & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - SHIFT_G ) |
( b & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - SHIFT_B );
#endif
}
@ -665,18 +658,10 @@ REALINLINE tVideoSample fix_to_color ( const tFixPoint r, const tFixPoint g, con
*/
REALINLINE tVideoSample fix4_to_color ( const tFixPoint a, const tFixPoint r, const tFixPoint g, const tFixPoint b )
{
#ifdef __BIG_ENDIAN__
return ( a & (FIX_POINT_FRACT_MASK - 1 )) >> ( FIX_POINT_PRE ) |
( r & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - 8) |
( g & FIXPOINT_COLOR_MAX) << ( 16 - FIX_POINT_PRE ) |
( b & FIXPOINT_COLOR_MAX) << ( 24 - FIX_POINT_PRE );
#else
return ( a & (FIX_POINT_FRACT_MASK - 1 )) << ( SHIFT_A - 1 ) |
( r & FIXPOINT_COLOR_MAX) << ( SHIFT_R - FIX_POINT_PRE ) |
( g & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - SHIFT_G ) |
( b & FIXPOINT_COLOR_MAX) >> ( FIX_POINT_PRE - SHIFT_B );
#endif
}
/*!