DEADSOFTWARE

added preview background
authorFGSFDSFGS <derp.primus@gmail.com>
Wed, 21 Dec 2016 02:12:38 +0000 (05:12 +0300)
committerFGSFDSFGS <derp.primus@gmail.com>
Wed, 21 Dec 2016 02:12:38 +0000 (05:12 +0300)
src/editor/f_main.pas
src/editor/g_map.pas

index 9167af7bd3a34d88085e7006fc671d0d9ac12ec7..a63b81e0b75abf83576ca7c4b60416b2253ef72b 100644 (file)
@@ -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;
 
 // Подсказка при выборе точки Телепорта:
index a49b6f9edb7872fcd0d577db2ffad2f1bed88324..1be82b6cb7d05cc3ffdc4c9e2373ae81c4dc937d 100644 (file)
@@ -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);