From 3daa537791576f8ce8817aea5ef3f79ef2e77a8d Mon Sep 17 00:00:00 2001 From: nillerusr Date: Sat, 17 Sep 2022 16:42:45 +0300 Subject: [PATCH] game(client): fix touch drawing again bruh --- game/client/touch.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/game/client/touch.cpp b/game/client/touch.cpp index 8bb40bca..ddb38ed2 100644 --- a/game/client/touch.cpp +++ b/game/client/touch.cpp @@ -529,8 +529,8 @@ void CTouchControls::CreateAtlasTexture() void CTouchControls::Shutdown( ) { - btns.PurgeAndDeleteElements(); textureList.PurgeAndDeleteElements(); + btns.PurgeAndDeleteElements(); } void CTouchControls::RemoveButtons() @@ -642,7 +642,7 @@ void CTouchControls::Paint( ) { CTouchButton *btn = *it; - if( btn->type != touch_move && btn->type != touch_look && !(btn->flags & TOUCH_FL_HIDE) ) + if( btn->texture != NULL && !(btn->flags & TOUCH_FL_HIDE) ) meshCount++; } @@ -652,7 +652,7 @@ void CTouchControls::Paint( ) { CTouchButton *btn = *it; - if( btn->type != touch_move && btn->type != touch_look && !(btn->flags & TOUCH_FL_HIDE) ) + if( btn->texture != NULL && !(btn->flags & TOUCH_FL_HIDE) ) { CTouchTexture *t = btn->texture; @@ -717,6 +717,7 @@ void CTouchControls::AddButton( const char *name, const char *texturefile, const if( btn->texturefile[0] == 0 ) { + btn->texture = NULL; btns.AddToTail(btn); return; } @@ -732,6 +733,7 @@ void CTouchControls::AddButton( const char *name, const char *texturefile, const } CTouchTexture *texture = new CTouchTexture; + btn->texture = texture; Q_strncpy( texture->szName, btn->texturefile, sizeof(btn->texturefile) ); textureList.AddToTail(texture);