Fix bug #7872: Centering [image]s in story screens

Inroduce the new WML key centered=yes for this

"no" is the current default, to avoid breaking UMC and mainline stuff
but later we can proabably use "yes".

Also killed the obsolete (not in wiki) key "flip". Use imagepath
function ~FL(horiz/vert) instead, cleaner and more powerfull.
This commit is contained in:
Ali El Gariani 2007-09-26 16:30:13 +00:00
parent 50e2f09c89
commit d1a6bb8495

View file

@ -206,8 +206,6 @@ bool show_intro_part(display &disp, const config& part,
surface img(image::get_image(image_name));
if(img.null()) continue;
if ((**i)["flip"] == "yes")
img.assign(image::reverse_image(img));
SDL_Rect image_rect;
image_rect.x = x + dstrect.x;
@ -215,6 +213,11 @@ bool show_intro_part(display &disp, const config& part,
image_rect.w = img->w;
image_rect.h = img->h;
if ((**i)["centered"] == "yes"){
image_rect.x -= image_rect.w/2;
image_rect.y -= image_rect.h/2;
}
SDL_BlitSurface(img,NULL,video.getSurface(),&image_rect);
update_rect(image_rect);