engine: remove FillRGBABlend from RefAPI. FillRGBA now accepts rendermode parameter

This commit is contained in:
Alibek Omarov
2024-11-03 02:24:36 +03:00
parent 6cd2dbf178
commit addd50467e
8 changed files with 22 additions and 101 deletions
+6 -44
View File
@@ -1604,35 +1604,16 @@ CL_FillRGBA
*/
static void GAME_EXPORT CL_FillRGBA( int x, int y, int w, int h, int r, int g, int b, int a )
{
float _x = x, _y = y, _w = w, _h = h;
float x_ = x, y_ = y, w_ = w, h_ = h;
r = bound( 0, r, 255 );
g = bound( 0, g, 255 );
b = bound( 0, b, 255 );
a = bound( 0, a, 255 );
SPR_AdjustSize( &_x, &_y, &_w, &_h );
SPR_AdjustSize( &x_, &y_, &w_, &h_ );
#if 1
ref.dllFuncs.FillRGBA( _x, _y, _w, _h, r, g, b, a );
#else
pglDisable( GL_TEXTURE_2D );
pglEnable( GL_BLEND );
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
pglColor4f( r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f );
pglBegin( GL_QUADS );
pglVertex2f( _x, _y );
pglVertex2f( _x + _w, _y );
pglVertex2f( _x + _w, _y + _h );
pglVertex2f( _x, _y + _h );
pglEnd ();
pglColor3f( 1.0f, 1.0f, 1.0f );
pglEnable( GL_TEXTURE_2D );
pglDisable( GL_BLEND );
#endif
ref.dllFuncs.FillRGBA( kRenderTransAdd, x_, y_, w_, h_, r, g, b, a );
}
/*
@@ -3111,35 +3092,16 @@ pfnFillRGBABlend
*/
static void GAME_EXPORT CL_FillRGBABlend( int x, int y, int w, int h, int r, int g, int b, int a )
{
float _x = x, _y = y, _w = w, _h = h;
float x_ = x, y_ = y, w_ = w, h_ = h;
r = bound( 0, r, 255 );
g = bound( 0, g, 255 );
b = bound( 0, b, 255 );
a = bound( 0, a, 255 );
SPR_AdjustSize( &_x, &_y, &_w, &_h );
SPR_AdjustSize( &x_, &y_, &w_, &h_ );
#if 1 // REFTODO:
ref.dllFuncs.FillRGBABlend( _x, _y, _w, _h, r, g, b, a );
#else
pglDisable( GL_TEXTURE_2D );
pglEnable( GL_BLEND );
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
pglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
pglColor4f( r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f );
pglBegin( GL_QUADS );
pglVertex2f( _x, _y );
pglVertex2f( _x + _w, _y );
pglVertex2f( _x + _w, _y + _h );
pglVertex2f( _x, _y + _h );
pglEnd ();
pglColor3f( 1.0f, 1.0f, 1.0f );
pglEnable( GL_TEXTURE_2D );
pglDisable( GL_BLEND );
#endif
ref.dllFuncs.FillRGBA( kRenderTransTexture, x_, y_, w_, h_, r, g, b, a );
}
/*
+2 -4
View File
@@ -679,10 +679,8 @@ static void GAME_EXPORT pfnFillRGBA( int x, int y, int width, int height, int r,
g = bound( 0, g, 255 );
b = bound( 0, b, 255 );
a = bound( 0, a, 255 );
ref.dllFuncs.Color4ub( r, g, b, a );
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, R_GetBuiltinTexture( REF_WHITE_TEXTURE ) );
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
ref.dllFuncs.FillRGBA( kRenderTransTexture, x, y, width, height, r, g, b, a );
}
/*
+2 -2
View File
@@ -1144,7 +1144,7 @@ static void OSK_DrawSymbolButton( int symb, float x, float y, float width, float
h = height * refState.height;
if( symb == osk.curbutton.val )
ref.dllFuncs.FillRGBABlend( x1, y1, w, h, 255, 160, 0, 100 );
ref.dllFuncs.FillRGBA( kRenderTransTexture, x1, y1, w, h, 255, 160, 0, 100 );
if( !symb || symb == ' ' || (symb >= OSK_TAB && symb < OSK_SPECKEY_LAST ) )
return;
@@ -1191,7 +1191,7 @@ void OSK_Draw( void )
return;
// draw keyboard
ref.dllFuncs.FillRGBABlend( X_START * refState.width, Y_START * refState.height,
ref.dllFuncs.FillRGBA( kRenderTransTexture, X_START * refState.width, Y_START * refState.height,
X_STEP * MAX_OSK_ROWS * refState.width,
Y_STEP * MAX_OSK_LINES * refState.height, 100, 100, 100, 100 );
+1 -1
View File
@@ -191,7 +191,7 @@ static void GAME_EXPORT VGUI_DrawQuad( const vpoint_t *ul, const vpoint_t *lr )
}
else
{
ref.dllFuncs.FillRGBABlend( x, y, w, h, vgui.color[0], vgui.color[1], vgui.color[2], vgui.color[3] );
ref.dllFuncs.FillRGBA( kRenderTransTexture, x, y, w, h, vgui.color[0], vgui.color[1], vgui.color[2], vgui.color[3] );
}
}