1
0

Add floor32, ceil32, round32 compatibility functions for burnings renderer.

To avoid changing burnings now those functions have no IRRLICHT_FAST_MATH anymore, 
there's a new header irrMathFastCompat.h which has ..._fast functions doing the old behavior.
With the troubles they have documented.
I changed burnings to use those functions throughout.
Or as much as possible... Burnings probably also uses classes like SColor which also have functions 
using those, but I don't plan  to adapt them.
Maybe IRRLICHT_FAST_MATH should be a flag exlusive to burnings in the future, I don't think it makes 
much sense otherwise anymore (it often expects 32-bit asm).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6012 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2019-12-16 16:15:04 +00:00
parent 3acf725ae3
commit 3280b3319e
25 changed files with 289 additions and 161 deletions

View File

@@ -115,9 +115,9 @@ CTRTextureGouraudAlphaNoZ::CTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver
void CTRTextureGouraudAlphaNoZ::setParam ( u32 index, f32 value)
{
#ifdef BURNINGVIDEO_RENDERER_FAST
AlphaRef = core::floor32 ( value * 256.f );
AlphaRef = core::floor32_fast( value * 256.f );
#else
AlphaRef = u32_to_fixPoint ( core::floor32 ( value * 256.f ) );
AlphaRef = u32_to_fixPoint ( core::floor32_fast( value * 256.f ) );
#endif
}
@@ -154,8 +154,8 @@ void CTRTextureGouraudAlphaNoZ::scanline_bilinear ()
#endif
// apply top-left fill-convention, left
xStart = core::ceil32( line.x[0] );
xEnd = core::ceil32( line.x[1] ) - 1;
xStart = core::ceil32_fast( line.x[0] );
xEnd = core::ceil32_fast( line.x[1] ) - 1;
dx = xEnd - xStart;
@@ -440,8 +440,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle ( const s4DVertex *a,const s4DVerte
#endif
// apply top-left fill convention, top part
yStart = core::ceil32( a->Pos.y );
yEnd = core::ceil32( b->Pos.y ) - 1;
yStart = core::ceil32_fast( a->Pos.y );
yEnd = core::ceil32_fast( b->Pos.y ) - 1;
#ifdef SUBTEXEL
subPixel = ( (f32) yStart ) - a->Pos.y;
@@ -599,8 +599,8 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle ( const s4DVertex *a,const s4DVerte
#endif
// apply top-left fill convention, top part
yStart = core::ceil32( b->Pos.y );
yEnd = core::ceil32( c->Pos.y ) - 1;
yStart = core::ceil32_fast( b->Pos.y );
yEnd = core::ceil32_fast( c->Pos.y ) - 1;
#ifdef SUBTEXEL