Removed old fixed function code from GFX.

This commit is contained in:
rextimmy 2021-01-05 12:57:17 +10:00
parent 58d2e30af7
commit 5a933c00d3
53 changed files with 98 additions and 1646 deletions

View file

@ -882,20 +882,8 @@ U8 GBitmap::getChanelValueAt(U32 x, U32 y, U32 chan)
//-----------------------------------------------------------------------------
bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFXTextureOp combineOp )
bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const TextureOp combineOp )
{
// Check valid texture ops
switch( combineOp )
{
case GFXTOPAdd:
case GFXTOPSubtract:
break;
default:
Con::errorf( "GBitmap::combine - Invalid op type" );
return false;
}
// Check bitmapA format
switch( bitmapA->getFormat() )
{
@ -970,11 +958,11 @@ bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFX
// Combine them (clamp values 0-U8_MAX)
switch( combineOp )
{
case GFXTOPAdd:
case Add:
*destBits++ = getMin( U8( pxA + pxB ), U8_MAX );
break;
case GFXTOPSubtract:
case Subtract:
*destBits++ = getMax( U8( pxA - pxB ), U8( 0 ) );
break;
default:

View file

@ -62,6 +62,12 @@ public:
c_maxMipLevels = 13
};
enum TextureOp
{
Add,
Subtract
};
struct Registration
{
/// The read function prototype.
@ -218,7 +224,7 @@ public:
///
/// @note There are some restrictions on ops and formats that will probably change
/// based on how we use this function.
bool combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFXTextureOp combineOp );
bool combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const TextureOp combineOp );
/// Fills the first mip level of the bitmap with the specified color.
void fill( const ColorI &rColor );