X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gui.pas;h=a76a1801f560969bd0ab491f9dca790cc7565c3f;hb=c1ffcbff92f1cda66945281f6f946acce3b6e4c7;hp=07a03c19081dcbf21589dd8569ec03946c26b5c2;hpb=e4aa606d7d71d9836908fab23aae7e99728b11ee;p=d2df-sdl.git diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 07a03c1..a76a180 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -814,10 +814,19 @@ procedure TGUIWindow.Draw; var i: Integer; ID: DWORD; + tw, th: Word; begin - if FBackTexture <> '' then + if FBackTexture <> '' then // Here goes code duplication from g_game.pas:DrawMenuBackground() if g_Texture_Get(FBackTexture, ID) then - e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight) + begin + e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0); + e_GetTextureSize(ID, @tw, @th); + if tw = th then + tw := round(tw * 1.333 * (gScreenHeight / th)) + else + tw := trunc(tw * (gScreenHeight / th)); + e_DrawSize(ID, (gScreenWidth - tw) div 2, 0, 0, False, False, tw, gScreenHeight); + end else e_Clear(GL_COLOR_BUFFER_BIT, 0.5, 0.5, 0.5);