Logo coordinates on title screen are now relative to center of the logo.

This way localized logos of different widths can be accomodated.
This commit is contained in:
Chusslove Illich 2009-11-22 20:50:57 +00:00
parent 4df33e3799
commit fdd9184259
2 changed files with 12 additions and 9 deletions

View file

@ -37,8 +37,8 @@
buttons_x=760
buttons_y=330
buttons_padding=4
logo_x=160
logo_y=40
logo_x=270
logo_y=90
tip_x=100
tip_width=495
tip_padding=4
@ -47,8 +47,8 @@
buttons_x=760
buttons_y=210
buttons_padding=20
logo_x=85
logo_y=20
logo_x=205
logo_y=120
tip_x=30
tip_width=620
tip_padding=20
@ -56,8 +56,8 @@
buttons_x=760
buttons_y=330
buttons_padding=20
logo_x=292
logo_y=120
logo_x=512
logo_y=220
tip_x=100
tip_width=495
tip_padding=20

View file

@ -67,14 +67,14 @@ static lg::log_domain log_config("config");
* Used only once, after the game is started.
*
* @param screen surface to operate on
* @param xpos x-position of logo
* @param ypos y-position of logo
* @param xcpos x-position of center of the logo
* @param ycpos y-position of center of the logo
*
* @return Result of running the routine
* @retval true operation finished (successful or not)
* @retval false operation failed (because modeChanged), need to retry
*/
static bool fade_logo(game_display& screen, int xpos, int ypos)
static bool fade_logo(game_display& screen, int xcpos, int ycpos)
{
const surface logo(image::get_image(game_config::game_logo));
if(logo == NULL) {
@ -82,6 +82,9 @@ static bool fade_logo(game_display& screen, int xpos, int ypos)
return true;
}
int xpos = xcpos - logo->w / 2;
int ypos = ycpos - logo->h / 2;
surface const fb = screen.video().getSurface();
if(fb == NULL || xpos < 0 || ypos < 0 || xpos + logo->w > fb->w || ypos + logo->h > fb->h) {