From: FGSFDSFGS Date: Wed, 21 Dec 2016 02:12:38 +0000 (+0300) Subject: added preview background X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=b24d6e7807afbf85950814111ce21aab73a7ce02;p=d2df-editor.git added preview background --- diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 9167af7..a63b81e 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -2674,7 +2674,7 @@ procedure TMainForm.Draw(); var x, y: Integer; a, b: Integer; - ID: DWORD; + ID, PID: DWORD; Width, Height: Word; Rect: TRectWH; ObjCount: Word; @@ -2746,10 +2746,9 @@ begin if not g_GetTexture(SelectedTexture(), ID) then g_GetTexture('NOTEXTURE', ID); g_GetTextureSizeByID(ID, Width, Height); - e_DrawFillQuad(RenderPanel.Width-Width-2, RenderPanel.Height-Height-2, - RenderPanel.Width-1, RenderPanel.Height-1, - GetRValue(PreviewColor), GetGValue(PreviewColor), GetBValue(PreviewColor), 0); - e_Draw(ID, RenderPanel.Width-Width-1, RenderPanel.Height-Height-1, 0, True, False); + if g_GetTexture('PREVIEW', PID) then + e_DrawFill(PID, RenderPanel.Width-Width, RenderPanel.Height-Height, Width div 16 + 1, Height div 16 + 1, 0, True, False); + e_Draw(ID, RenderPanel.Width-Width, RenderPanel.Height-Height, 0, True, False); end; // Подсказка при выборе точки Телепорта: diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas index a49b6f9..1be82b6 100644 --- a/src/editor/g_map.pas +++ b/src/editor/g_map.pas @@ -2716,6 +2716,7 @@ end; procedure LoadData(); begin + g_CreateTextureWAD('PREVIEW', EditorDir+'\data\Editor.wad:TEXTURES\CHECKERS'); g_CreateTextureWAD('NOTEXTURE', EditorDir+'\data\Game.wad:TEXTURES\NOTEXTURE'); g_CreateTextureWADSize('AREA_REDFLAG', EditorDir+'\data\Game.wad:TEXTURES\FLAGRED', 0, 0, 64, 64);