summaryrefslogtreecommitdiff
path: root/blits.c
diff options
context:
space:
mode:
authorOlivier Gayot <og@satcom1.com>2016-09-04 17:36:59 +0200
committerOlivier Gayot <og@satcom1.com>2016-09-04 17:36:59 +0200
commit0a58c87f21ec0717e17318528a7c252c9d0997e7 (patch)
tree25d1523eba6f0bcb4f6f34f4df2e51aadd6d587e /blits.c
parentc6a8032e93deddb70e268b2ef6521410cbb8afac (diff)
started removing SURFACES and POSITIONS
Signed-off-by: Olivier Gayot <og@satcom1.com>
Diffstat (limited to 'blits.c')
-rw-r--r--blits.c24
1 files changed, 12 insertions, 12 deletions
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;