X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_gui.pas;h=ef5645962bdc2e0bcdedd2f992979fd0c816f360;hp=07a03c19081dcbf21589dd8569ec03946c26b5c2;hb=0d43461fbabe69392b0a841eac53710e4e6ca3ea;hpb=4c6bb5a1347f606d9f87b66e0e020a89a10648cb diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 07a03c1..ef56459 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -685,14 +685,14 @@ begin if len = 0 then Exit; -// Îêíî ñ ãëàâíûì ìåíþ: +// ���� � ������� ����: g_GUI_ShowWindow(Saved_Windows[len-1]); -// Íå ïåðåêëþ÷èëîñü (èëè íåêóäà äàëüøå): +// �� ������������� (��� ������ ������): if (len = 1) or (g_ActiveWindow = nil) then Exit; -// Èùåì êíîïêè â îñòàëüíûõ îêíàõ: +// ���� ������ � ��������� �����: for k := len-1 downto 1 do begin ok := False; @@ -726,7 +726,7 @@ begin Break; end; - // Íå ïåðåêëþ÷èëîñü: + // �� �������������: if (not ok) or (g_ActiveWindow.Name = Saved_Windows[k]) then Break; @@ -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); @@ -3232,7 +3241,7 @@ begin SetActive(Self) else begin - if FItems[FIndex][1] = #29 then // Ïàïêà + if FItems[FIndex][1] = #29 then // ����� begin OpenDir(FPath+Copy(FItems[FIndex], 2, 255)); FIndex := 0; @@ -3254,7 +3263,7 @@ begin if ( (Length(FItems[a]) > 0) and (LowerCase(FItems[a][1]) = LowerCase(Chr(wParam))) ) or ( (Length(FItems[a]) > 1) and - (FItems[a][1] = #29) and // Ïàïêà + (FItems[a][1] = #29) and // ����� (LowerCase(FItems[a][2]) = LowerCase(Chr(wParam))) ) then begin FIndex := a; @@ -3278,7 +3287,7 @@ begin path := IncludeTrailingPathDelimiter(path); path := ExpandFileName(path); - // Êàòàëîãè: + // ��������: if FDirs then begin if FindFirst(path+'*', faDirectory, SR) = 0 then @@ -3295,7 +3304,7 @@ begin FindClose(SR); end; - // Ôàéëû: + // �����: sm := FFileMask; while sm <> '' do begin