From d03d29f6f5ef48c80c247640cdc05b3797da6271 Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 3 Apr 2019 22:21:08 +0700 Subject: [PATCH] ref_soft: Fix transparency in API --- r_context.c | 2 +- r_local.h | 1 + r_triapi.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/r_context.c b/r_context.c index ceeede80..5b279706 100644 --- a/r_context.c +++ b/r_context.c @@ -592,7 +592,7 @@ ref_interface_t gReffuncs = TriBegin, TriEnd, _TriColor4f, - TriColor4ub, + _TriColor4ub, TriTexCoord2f, TriVertex3fv, TriVertex3f, diff --git a/r_local.h b/r_local.h index 9a500ae1..bef3d6d6 100644 --- a/r_local.h +++ b/r_local.h @@ -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 ); diff --git a/r_triapi.c b/r_triapi.c index 8b61b38b..8402bca7 100644 --- a/r_triapi.c +++ b/r_triapi.c @@ -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