summaryrefslogtreecommitdiff
path: root/menuchoixpersos.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-10 21:33:00 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-10 21:37:01 +0100
commitc3e0eaf45432f62b423cee2170a09b5d1aac135b (patch)
tree71da9bdcb5b55a5fb71fab5aef524ab12c1330d4 /menuchoixpersos.c
parentd98cf9e97a61b175649fa9fe656cb8ec2874686c (diff)
allow to pass the resolution as arguments
example (for my netbook): $ ./a.out 1024 600 Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'menuchoixpersos.c')
-rw-r--r--menuchoixpersos.c6
1 files changed, 3 insertions, 3 deletions
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);