From acf2c849dd4543b7faee5024b0200fbcad5cad69 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 24 Jun 2015 17:54:02 +1000 Subject: [PATCH] Do not recreate block info texture when selected index hasn't changed. --- 2D/Screens/BlockSelectScreen.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/2D/Screens/BlockSelectScreen.cs b/2D/Screens/BlockSelectScreen.cs index 933602385..4147f442f 100644 --- a/2D/Screens/BlockSelectScreen.cs +++ b/2D/Screens/BlockSelectScreen.cs @@ -120,7 +120,11 @@ namespace ClassicalSharp { } } + int lastCreatedIndex = -1000; void RecreateBlockInfoTexture() { + if( selectedIndex == lastCreatedIndex ) return; + lastCreatedIndex = selectedIndex; + GraphicsApi.DeleteTexture( ref blockInfoTexture ); if( selectedIndex == -1 ) return;