From aa4bdf073215350958d332c805f71d5d82eaee29 Mon Sep 17 00:00:00 2001 From: lewa_j Date: Sat, 17 Jan 2026 19:46:02 +0300 Subject: [PATCH] ref: dx2: implement FillRGBA through d3d --- ref/dx2/r_draw.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ref/dx2/r_draw.c b/ref/dx2/r_draw.c index 5135be5f..3eb32b26 100644 --- a/ref/dx2/r_draw.c +++ b/ref/dx2/r_draw.c @@ -14,7 +14,7 @@ GNU General Public License for more details. */ #include "r_local.h" - +#include "xash3d_mathlib.h" void R_Set2DMode( qboolean enable ) { @@ -148,11 +148,18 @@ void R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, f void FillRGBA( int rendermode, float x, float y, float w, float h, byte r, byte g, byte b, byte a ) { +#if 0 RECT dstRect = { x, y, x + w, y + h }; DDBLTFX bltFx = { 0 }; bltFx.dwSize = sizeof(bltFx); bltFx.dwFillColor = RGBA_MAKE(r, g, b, a); DXCheck(IDirectDrawSurface_Blt(dxc.pddsBack, &dstRect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltFx)); +#else + // TODO Restore after? + GL_SetRenderMode( (rendermode == kRenderTransAdd) ? rendermode : kRenderTransColor); + Vector4Set( dxc.currentColor, r / 255.f, g / 255.f, b / 255.f, a / 255.f ); + R_DrawStretchPic( x, y, w, h, 0, 0, 0, 0, tr.whiteTexture ); +#endif }