From 0a58c87f21ec0717e17318528a7c252c9d0997e7 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 4 Sep 2016 17:36:59 +0200 Subject: started removing SURFACES and POSITIONS Signed-off-by: Olivier Gayot --- blits.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'blits.c') diff --git a/blits.c b/blits.c index 51ce1e7..4cff601 100644 --- a/blits.c +++ b/blits.c @@ -11,7 +11,7 @@ #include "rpg.h" -static void blit_chr_infos(SURFACES *surfaces, struct chr_t *chr) +static void blit_chr_infos(struct chr_t *chr) { SDL_Color fg={132,215,107,0},bg={100,0,0,0}; char string[256]; @@ -29,8 +29,8 @@ static void blit_chr_infos(SURFACES *surfaces, struct chr_t *chr) chr->pos_hp.y = chr->pos.y + chr->def_surf->h - surf_hp->h - surf_mp->h; chr->pos_mp.y = chr->pos_hp.y + surf_mp->h; - SDL_BlitSurface(surf_hp, NULL, surfaces->Pecran, &chr->pos_hp); - SDL_BlitSurface(surf_mp, NULL, surfaces->Pecran, &chr->pos_mp); + SDL_BlitSurface(surf_hp, NULL, rpg_g.screen, &chr->pos_hp); + SDL_BlitSurface(surf_mp, NULL, rpg_g.screen, &chr->pos_mp); chr->pos_hp.w = surf_hp->w; chr->pos_hp.h = surf_hp->h; @@ -41,25 +41,25 @@ static void blit_chr_infos(SURFACES *surfaces, struct chr_t *chr) SDL_FreeSurface(surf_mp); } -void blit_character(SURFACES *surfaces, struct chr_t *chr) +void blit_character(struct chr_t *chr) { - SDL_BlitSurface(chr->surf, NULL, surfaces->Pecran, &chr->pos); + SDL_BlitSurface(chr->surf, NULL, rpg_g.screen, &chr->pos); if (!chr->alive) { SDL_Rect pos_dead; - pos_dead.x = chr->pos.x + chr->surf->w / 2 - surfaces->Pmort->w / 2; - pos_dead.y = chr->pos.y + chr->surf->h / 2 - surfaces->Pmort->h / 2; + pos_dead.x = chr->pos.x + chr->surf->w / 2 - rpg_g.surfaces.Pmort->w / 2; + pos_dead.y = chr->pos.y + chr->surf->h / 2 - rpg_g.surfaces.Pmort->h / 2; - SDL_BlitSurface(surfaces->Pmort, NULL, surfaces->Pecran, &pos_dead); + SDL_BlitSurface(rpg_g.surfaces.Pmort, NULL, rpg_g.screen, &pos_dead); } - blit_chr_infos(surfaces, chr); + blit_chr_infos(chr); } -void blit_team(SURFACES *surfaces, struct team_t *team) +void blit_team(struct team_t *team) { for (int i = 0; i < team->chr_cnt; i++) { - blit_character(surfaces, &team->chrs[i]); + blit_character(&team->chrs[i]); } } @@ -262,7 +262,7 @@ void display_incr(SURFACES *surfaces, POSITIONS *positions, surf = TTF_RenderText_Blended(rpg_g.font, string, color); - blit_character(surfaces, target); + blit_character(target); SDL_BlitSurface(surf, NULL, surfaces->Pecran, &target->pos_curs); positions->degats.x = target->pos_curs.x; -- cgit v1.2.3