From ca93c5b666eb77b88bc642ae7063e5bc66e3c98b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 5 Nov 2024 22:56:54 +0300 Subject: [PATCH] engine: client: touch: use FillRGBA to draw edit grid --- engine/client/in_touch.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index c00a3052..54028fe4 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -1440,29 +1440,26 @@ void Touch_Draw( void ) Touch_InitConfig(); - ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture ); if( touch.state >= state_edit && touch_grid_enable.value ) { float x; + if( touch_in_menu.value ) Touch_DrawTexture( 0, 0, 1, 1, touch.whitetexture, 32, 32, 32, 255 ); else Touch_DrawTexture( 0, 0, 1, 1, touch.whitetexture, 0, 0, 0, 112 ); - ref.dllFuncs.Color4ub( 0, 224, 224, 112 ); - for( x = 0; x < 1 ; x += GRID_X ) - ref.dllFuncs.R_DrawStretchPic( TO_SCRN_X(x), - 0, - 1, - TO_SCRN_Y(1), - 0, 0, 1, 1, touch.whitetexture ); - for( x = 0; x < 1 ; x += GRID_Y ) - ref.dllFuncs.R_DrawStretchPic( 0, - TO_SCRN_Y(x), - TO_SCRN_X(1), - 1, - 0, 0, 1, 1, touch.whitetexture ); + + for( x = 0.0f; x < 1.0f; x += GRID_X ) + { + ref.dllFuncs.FillRGBA( kRenderTransTexture, TO_SCRN_X( x ), 0, 1, TO_SCRN_Y( 1 ), 0, 224, 224, 112 ); + } + + for( x = 0.0f; x < 1.0f; x += GRID_Y ) + { + ref.dllFuncs.FillRGBA( kRenderTransTexture, 0, TO_SCRN_Y( x ), TO_SCRN_X( 1 ), 1, 0, 224, 224, 112 ); + } } Touch_DrawButtons( &touch.list_user );