From c3e0eaf45432f62b423cee2170a09b5d1aac135b Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 10 Jan 2015 21:33:00 +0100 Subject: allow to pass the resolution as arguments example (for my netbook): $ ./a.out 1024 600 Signed-off-by: Olivier Gayot --- menuchoixpersos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'menuchoixpersos.c') diff --git a/menuchoixpersos.c b/menuchoixpersos.c index 66ae603..90c36a4 100644 --- a/menuchoixpersos.c +++ b/menuchoixpersos.c @@ -62,7 +62,7 @@ static void init_team_players(struct team_t *team, bool left, chr->affinities[j] = rand() % AFFINITY_COUNT; } - chr->pos.y = (YWIN / ((team->chr_cnt + 1) * 2)) * (2 * (i + 1)) - chr->surf->h / 2; + chr->pos.y = (rpg_g.screen->h / ((team->chr_cnt + 1) * 2)) * (2 * (i + 1)) - chr->surf->h / 2; if (left) { chr->curs = surfaces->Pcurseurallies; @@ -70,7 +70,7 @@ static void init_team_players(struct team_t *team, bool left, chr->pos_curs.x = chr->pos.x + chr->surf->w + 20; } else { chr->curs = surfaces->Pcurseurennemis; - chr->pos.x = XWIN - chr->surf->w - 20; + chr->pos.x = surfaces->screen->w - chr->surf->w - 20; chr->pos_curs.x = chr->pos.x - chr->curs->w - 20; } @@ -194,7 +194,7 @@ void Fmenuchoixpersos (SURFACES *surfaces, POSITIONS *positions) /* display the string associated with the current character number (aka Please choose ...) */ surfaces->Ptextechoixmenu = TTF_RenderText_Blended(rpg_g.font, strings[Vnbperso], vert); - positions->Vpositiontextemenu.x=XWIN/2-surfaces->Ptextechoixmenu->w/2; + positions->Vpositiontextemenu.x = surfaces->screen->w / 2 - surfaces->Ptextechoixmenu->w / 2; SDL_BlitSurface (surfaces->Ptextechoixmenu,NULL,surfaces->Pecran,&positions->Vpositiontextemenu); SDL_BlitSurface (surfaces->Ppretre,NULL,surfaces->Pecran,&positions->Vpositionmenupretre); -- cgit v1.2.3