Commit 352e1955 authored by hybrid's avatar hybrid

Move local helper functions to where they are actually needed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2396 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1a924aa1
...@@ -173,6 +173,24 @@ inline void GetClip(AbsRectangle &clipping, video::IImage * t) ...@@ -173,6 +173,24 @@ inline void GetClip(AbsRectangle &clipping, video::IImage * t)
clipping.y1 = t->getDimension().Height - 1; clipping.y1 = t->getDimension().Height - 1;
} }
/*
return alpha in [0;256] Granularity from 32-Bit ARGB
add highbit alpha ( alpha > 127 ? + 1 )
*/
static inline u32 extractAlpha ( const u32 c )
{
return ( c >> 24 ) + ( c >> 31 );
}
/*
return alpha in [0;255] Granularity and 32-Bit ARGB
add highbit alpha ( alpha > 127 ? + 1 )
*/
static inline u32 packAlpha ( const u32 c )
{
return (c > 127 ? c - 1 : c) << 24;
}
/* /*
*/ */
static void RenderLine32_Decal(video::IImage *t, static void RenderLine32_Decal(video::IImage *t,
......
...@@ -229,24 +229,6 @@ inline u32 PixelLerp32 ( const u32 source, const u32 value ) ...@@ -229,24 +229,6 @@ inline u32 PixelLerp32 ( const u32 source, const u32 value )
return srcRB | srcXG; return srcRB | srcXG;
} }
/*
return alpha in [0;256] Granularity rom 32-Bit ARGB
add highbit alpha ( alpha > 127 ? + 1 )
*/
inline u32 extractAlpha ( const u32 c )
{
return ( c >> 24 ) + ( c >> 31 );
}
/*
return alpha in [0;255] Granularity and 32-Bit ARGB
add highbit alpha ( alpha > 127 ? + 1 )
*/
inline u32 packAlpha ( const u32 c )
{
return (c > 127 ? c - 1 : c) << 24;
}
/* /*
Pixel = c0 * (c1/31). c0 Alpha retain Pixel = c0 * (c1/31). c0 Alpha retain
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment