ref_soft: Fix transparency in API

This commit is contained in:
mittorn 2019-04-03 22:21:08 +07:00
parent 77f8da275a
commit d03d29f6f5
3 changed files with 16 additions and 1 deletions

View File

@ -592,7 +592,7 @@ ref_interface_t gReffuncs =
TriBegin,
TriEnd,
_TriColor4f,
TriColor4ub,
_TriColor4ub,
TriTexCoord2f,
TriVertex3fv,
TriVertex3f,

View File

@ -678,6 +678,7 @@ void TriVertex3fv( const float *v );
void TriVertex3f( float x, float y, float z );
void _TriColor4f( float r, float g, float b, float a );
void TriColor4ub( byte r, byte g, byte b, byte a );
void _TriColor4ub( byte r, byte g, byte b, byte a );
int TriWorldToScreen( const float *world, float *screen );
int TriSpriteTexture( model_t *pSpriteModel, int frame );
void TriFog( float flFogColor[3], float flStart, float flEnd, int bOn );

View File

@ -200,6 +200,20 @@ void TriColor4ub( byte r, byte g, byte b, byte a )
_TriColor4f( ds.triRGBA[0], ds.triRGBA[1], ds.triRGBA[2], 1.0f );
}
/*
=============
TriColor4ub
=============
*/
void _TriColor4ub( byte r, byte g, byte b, byte a )
{
_TriColor4f( r * (1.0f / 255.0f),
g * (1.0f / 255.0f),
b * (1.0f / 255.0f),
a * (1.0f / 255.0f));
}
/*
=================
TriColor4f