diff options
Diffstat (limited to 'blits.c')
-rw-r--r-- | blits.c | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -88,16 +88,13 @@ void Fblitterpvcible (SURFACES *surfaces,POSITIONS *positions, const struct char { SDL_Color couleur = {132,215,107,0}; char chaine[50]; - - if (surfaces->Ppvcible != NULL) - { - SDL_FreeSurface (surfaces->Ppvcible); - surfaces->Ppvcible=NULL; - } + SDL_Surface *surf; sprintf (chaine,"%d/%d", chr->hp, chr->max_hp); - surfaces->Ppvcible=TTF_RenderText_Blended(rpg_g.font, chaine, couleur); - SDL_BlitSurface (surfaces->Ppvcible,NULL,surfaces->Pecran,&positions->Vpositionpvcible); + surf = TTF_RenderText_Blended(rpg_g.font, chaine, couleur); + SDL_BlitSurface(surf, NULL, surfaces->screen, &positions->Vpositionpvcible); + + SDL_FreeSurface(surf); } static @@ -105,15 +102,13 @@ void Fblitterpmcible (SURFACES *surfaces,POSITIONS *positions, const struct char { SDL_Color couleur = {132,215,107,0}; char chaine[50]; + SDL_Surface *surf; - if (surfaces->Ppmcible != NULL) - { - SDL_FreeSurface (surfaces->Ppmcible); - surfaces->Ppmcible=NULL; - } sprintf (chaine,"%d/%d", chr->mp, chr->max_mp); - surfaces->Ppmcible=TTF_RenderText_Blended(rpg_g.font, chaine, couleur); - SDL_BlitSurface (surfaces->Ppmcible,NULL,surfaces->Pecran,&positions->Vpositionpmcible); + surf = TTF_RenderText_Blended(rpg_g.font, chaine, couleur); + SDL_BlitSurface(surf, NULL, surfaces->screen, &positions->Vpositionpmcible); + + SDL_FreeSurface(surf); } static void display_target_infos(SURFACES *surfaces, POSITIONS *positions, struct target_t *target) |