Added deinitialization of new slider textures

This commit is contained in:
Andreas Neumann 2018-01-25 21:55:48 +01:00
parent 2329df1eca
commit ce8a8616ad

View File

@ -89,6 +89,8 @@ void Settings_Deinitialize(){
SDL_DestroyTexture(Bar_Texture); SDL_DestroyTexture(Bar_Texture);
SDL_DestroyTexture(Return_Button_Texture); SDL_DestroyTexture(Return_Button_Texture);
SDL_DestroyTexture(Settings_Skins_Texture); SDL_DestroyTexture(Settings_Skins_Texture);
SDL_DestroyTexture(Scalar_Button_Texture0);
SDL_DestroyTexture(Scalar_Button_Texture1);
Settings_IsInit = false; Settings_IsInit = false;
} }
} }
@ -106,8 +108,6 @@ void Draw_Slider(SDL_Renderer * renderer, Slider * beta){
IsLock=true; IsLock=true;
} }
if(beta->IsLock){ if(beta->IsLock){
// SDL_RenderFillRect(renderer, &beta->Scalar_rect);
// SDL_RenderDrawRect(renderer, &beta->Scalar_rect);
SDL_RenderCopy(renderer, Scalar_Button_Texture1, NULL, &beta->Scalar_rect); SDL_RenderCopy(renderer, Scalar_Button_Texture1, NULL, &beta->Scalar_rect);
if (x > (beta->Bar_rect.x + beta->Bar_rect.w - (beta->Scalar_rect.w) / 2)) { if (x > (beta->Bar_rect.x + beta->Bar_rect.w - (beta->Scalar_rect.w) / 2)) {
beta->Scalar_rect.x = (beta->Bar_rect.x + beta->Bar_rect.w - (beta->Scalar_rect.w)); beta->Scalar_rect.x = (beta->Bar_rect.x + beta->Bar_rect.w - (beta->Scalar_rect.w));
@ -120,12 +120,10 @@ void Draw_Slider(SDL_Renderer * renderer, Slider * beta){
beta->Slider_value = x; beta->Slider_value = x;
} }
} else { } else {
// SDL_RenderDrawRect(renderer, &beta->Scalar_rect); SDL_RenderCopy(renderer, Scalar_Button_Texture0, NULL, &beta->Scalar_rect);
SDL_RenderCopy(renderer, Scalar_Button_Texture0, NULL, &beta->Scalar_rect);
} }
} else { } else {
// SDL_RenderDrawRect(renderer, &beta->Scalar_rect); SDL_RenderCopy(renderer, Scalar_Button_Texture0, NULL, &beta->Scalar_rect);
SDL_RenderCopy(renderer, Scalar_Button_Texture0, NULL, &beta->Scalar_rect);
} }
} /* Draw_Slider */ } /* Draw_Slider */