X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gui.pas;h=a76a1801f560969bd0ab491f9dca790cc7565c3f;hb=76f1664be8570d847e2d848d79b119dec561ce61;hp=494839e01324c73d6281594ff0db2a9c60d54d49;hpb=d92a9e2807dda8a533def35afa801ed975920885;p=d2df-sdl.git diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 494839e..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); @@ -2336,7 +2345,7 @@ begin end; end; - g_GUIGrabInput := FWindow.FActiveControl = Self; + g_GUIGrabInput := (@FOnEnterEvent = nil) and (FWindow.FActiveControl = Self); g_Touch_ShowKeyboard(g_GUIGrabInput) end;