From 6cd2dbf1785fe8c1d8a0ebea554d6915bef30356 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 3 Nov 2024 02:21:38 +0300 Subject: [PATCH] engine: remove R_DrawTileClear from RefAPI --- engine/ref_api.h | 2 +- ref/gl/gl_context.c | 1 - ref/gl/gl_draw.c | 33 ----------------------------- ref/gl/gl_local.h | 1 - ref/null/r_context.c | 6 ------ ref/soft/r_context.c | 1 - ref/soft/r_draw.c | 49 -------------------------------------------- ref/soft/r_local.h | 1 - 8 files changed, 1 insertion(+), 93 deletions(-) diff --git a/engine/ref_api.h b/engine/ref_api.h index 870b1ab8..8e5ec888 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -55,6 +55,7 @@ GNU General Public License for more details. // Move hulls rendering back to engine // Removed lightstyle, dynamic and entity light functions. Renderer is supposed to get them through PARM_GET_*_PTR. // CL_RunLightStyles now accepts lightstyles array. +// Removed R_DrawTileClear. #define REF_API_VERSION 9 #define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP|TF_ALLOW_NEAREST) @@ -515,7 +516,6 @@ typedef struct ref_interface_s void (*R_Set2DMode)( qboolean enable ); void (*R_DrawStretchRaw)( float x, float y, float w, float h, int cols, int rows, const byte *data, qboolean dirty ); void (*R_DrawStretchPic)( float x, float y, float w, float h, float s1, float t1, float s2, float t2, int texnum ); - void (*R_DrawTileClear)( int texnum, int x, int y, int w, int h ); void (*FillRGBA)( float x, float y, float w, float h, int r, int g, int b, int a ); // in screen space void (*FillRGBABlend)( float x, float y, float w, float h, int r, int g, int b, int a ); // in screen space int (*WorldToScreen)( const vec3_t world, vec3_t screen ); // Returns 1 if it's z clipped diff --git a/ref/gl/gl_context.c b/ref/gl/gl_context.c index 3efdc1aa..cb72ac93 100644 --- a/ref/gl/gl_context.c +++ b/ref/gl/gl_context.c @@ -471,7 +471,6 @@ static const ref_interface_t gReffuncs = R_Set2DMode, R_DrawStretchRaw, R_DrawStretchPic, - R_DrawTileClear, CL_FillRGBA, CL_FillRGBABlend, R_WorldToScreen, diff --git a/ref/gl/gl_draw.c b/ref/gl/gl_draw.c index 08f5e3bf..d4a85dbe 100644 --- a/ref/gl/gl_draw.c +++ b/ref/gl/gl_draw.c @@ -81,39 +81,6 @@ void R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, f pglEnd(); } -/* -============= -Draw_TileClear - -This repeats a 64*64 tile graphic to fill the screen around a sized down -refresh window. -============= -*/ -void R_DrawTileClear( int texnum, int x, int y, int w, int h ) -{ - float tw, th; - gl_texture_t *glt; - - GL_SetRenderMode( kRenderNormal ); - pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - GL_Bind( XASH_TEXTURE0, texnum ); - - glt = R_GetTexture( texnum ); - tw = glt->srcWidth; - th = glt->srcHeight; - - pglBegin( GL_QUADS ); - pglTexCoord2f( x / tw, y / th ); - pglVertex2f( x, y ); - pglTexCoord2f((x + w) / tw, y / th ); - pglVertex2f( x + w, y ); - pglTexCoord2f((x + w) / tw, (y + h) / th ); - pglVertex2f( x + w, y + h ); - pglTexCoord2f( x / tw, (y + h) / th ); - pglVertex2f( x, y + h ); - pglEnd (); -} - /* ============= R_DrawStretchRaw diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index c8d1694a..c4289a39 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -346,7 +346,6 @@ void R_ClearDecals( void ); // gl_draw.c // void R_Set2DMode( qboolean enable ); -void R_DrawTileClear( int texnum, int x, int y, int w, int h ); void R_UploadStretchRaw( int texture, int cols, int rows, int width, int height, const byte *data ); // diff --git a/ref/null/r_context.c b/ref/null/r_context.c index 4fb193df..47bf1ac2 100644 --- a/ref/null/r_context.c +++ b/ref/null/r_context.c @@ -115,11 +115,6 @@ static void R_DrawStretchPic( float x, float y, float w, float h, float s1, floa ; } -static void R_DrawTileClear( int texnum, int x, int y, int w, int h ) -{ - ; -} - static void FillRGBA( float x, float y, float w, float h, int r, int g, int b, int a ) { ; @@ -485,7 +480,6 @@ static const ref_interface_t gReffuncs = .R_Set2DMode = R_SimpleStubBool, .R_DrawStretchRaw = R_DrawStretchRaw, .R_DrawStretchPic = R_DrawStretchPic, - .R_DrawTileClear = R_DrawTileClear, .FillRGBA = FillRGBA, .FillRGBABlend = FillRGBA, .WorldToScreen = WorldToScreen, diff --git a/ref/soft/r_context.c b/ref/soft/r_context.c index 0dcea564..a28dc692 100644 --- a/ref/soft/r_context.c +++ b/ref/soft/r_context.c @@ -466,7 +466,6 @@ static const ref_interface_t gReffuncs = R_Set2DMode, R_DrawStretchRaw, R_DrawStretchPic, - R_DrawTileClear, CL_FillRGBA, CL_FillRGBABlend, R_WorldToScreen, diff --git a/ref/soft/r_draw.c b/ref/soft/r_draw.c index 60500bbc..8311e8f3 100644 --- a/ref/soft/r_draw.c +++ b/ref/soft/r_draw.c @@ -244,55 +244,6 @@ void Draw_Fill (int x, int y, int w, int h) } } -/* -============= -Draw_TileClear - -This repeats a 64*64 tile graphic to fill the screen around a sized down -refresh window. -============= -*/ -void GAME_EXPORT R_DrawTileClear( int texnum, int x, int y, int w, int h ) -{ - int tw, th, x2, i, j; - image_t *pic; - pixel_t *psrc, *pdest; - - GL_SetRenderMode( kRenderNormal ); - _TriColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - GL_Bind( XASH_TEXTURE0, texnum ); - - pic = R_GetTexture( texnum ); - - tw = pic->width; - th = pic->height; - if (x < 0) - { - w += x; - x = 0; - } - if (y < 0) - { - h += y; - y = 0; - } - if (x + w > vid.width) - w = vid.width - x; - if (y + h > vid.height) - h = vid.height - y; - if (w <= 0 || h <= 0) - return; - - x2 = x + w; - pdest = vid.buffer + y*vid.rowbytes; - for (i=0 ; ipixels[0] + tw * ((i+y)&63); - for (j=x ; j