Browse Source

game(client): fix touch drawing again bruh

pull/122/merge
nillerusr 2 years ago
parent
commit
3daa537791
  1. 8
      game/client/touch.cpp

8
game/client/touch.cpp

@ -529,8 +529,8 @@ void CTouchControls::CreateAtlasTexture()
void CTouchControls::Shutdown( ) void CTouchControls::Shutdown( )
{ {
btns.PurgeAndDeleteElements();
textureList.PurgeAndDeleteElements(); textureList.PurgeAndDeleteElements();
btns.PurgeAndDeleteElements();
} }
void CTouchControls::RemoveButtons() void CTouchControls::RemoveButtons()
@ -642,7 +642,7 @@ void CTouchControls::Paint( )
{ {
CTouchButton *btn = *it; 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++; meshCount++;
} }
@ -652,7 +652,7 @@ void CTouchControls::Paint( )
{ {
CTouchButton *btn = *it; 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; CTouchTexture *t = btn->texture;
@ -717,6 +717,7 @@ void CTouchControls::AddButton( const char *name, const char *texturefile, const
if( btn->texturefile[0] == 0 ) if( btn->texturefile[0] == 0 )
{ {
btn->texture = NULL;
btns.AddToTail(btn); btns.AddToTail(btn);
return; return;
} }
@ -732,6 +733,7 @@ void CTouchControls::AddButton( const char *name, const char *texturefile, const
} }
CTouchTexture *texture = new CTouchTexture; CTouchTexture *texture = new CTouchTexture;
btn->texture = texture;
Q_strncpy( texture->szName, btn->texturefile, sizeof(btn->texturefile) ); Q_strncpy( texture->szName, btn->texturefile, sizeof(btn->texturefile) );
textureList.AddToTail(texture); textureList.AddToTail(texture);

Loading…
Cancel
Save