summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f271e7b)
raw | patch | inline | side by side (parent: f271e7b)
author | binarymaster <x86corez@gmail.com> | |
Fri, 29 Sep 2017 18:54:51 +0000 (21:54 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Fri, 29 Sep 2017 18:54:51 +0000 (21:54 +0300) |
http://doom2d.org/forum/viewtopic.php?f=12&t=1540
src/editor/f_main.pas | patch | blob | history | |
src/editor/g_map.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 8e186cee06aa4e4f8d85c5adc6b3c56b7c1b13c2..8158c03344f380660a7de069841ce8357aedb984 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
LayerEnabled: Array [LAYER_BACK..LAYER_TRIGGERS] of Boolean =
(True, True, True, True, True, True, True, True, True);
- PreviewMode: Boolean = False;
+ PreviewMode: Byte = 0;
gLanguage: String;
FormCaption: String;
end;
// Рисуем сетку:
- if DotEnable and (not PreviewMode) then
+ if DotEnable and (PreviewMode = 0) then
begin
if DotSize = 2 then
a := -1
// Превью текстуры:
if (lbTextureList.ItemIndex <> -1) and (cbPreview.Checked) and
- (not IsSpecialTextureSel()) and (not PreviewMode) then
+ (not IsSpecialTextureSel()) and (PreviewMode = 0) then
begin
if not g_GetTexture(SelectedTexture(), ID) then
g_GetTexture('NOTEXTURE', ID);
if not (ssCtrl in Shift) then
begin
+ // Быстрое превью карты:
+ if Key = Ord('E') then
+ begin
+ if PreviewMode = 0 then
+ PreviewMode := 2;
+ end;
+
// Вертикальный скролл карты:
with sbVertical do
begin
procedure TMainForm.miMapPreviewClick(Sender: TObject);
begin
- if not PreviewMode then
+ if PreviewMode = 2 then
+ Exit;
+
+ if PreviewMode = 0 then
begin
Splitter2.Visible := False;
Splitter1.Visible := False;
sbVertical.Visible := True;
end;
- PreviewMode := not PreviewMode;
- (Sender as TMenuItem).Checked := PreviewMode;
+ PreviewMode := PreviewMode xor 1;
+ (Sender as TMenuItem).Checked := PreviewMode > 0;
FormResize(Self);
end;
(Key = Ord('V')) then
FillProperty();
end;
+// Быстрое превью карты:
+ if Key = Ord('E') then
+ begin
+ if PreviewMode = 2 then
+ PreviewMode := 0;
+ end;
end;
end.
diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas
index caa6b57d1a53a099ef97d4da799342b4d88ac9f1..5a17e97276fc8f681fdcd8d57b7f2cf0e0632f6b 100644 (file)
--- a/src/editor/g_map.pas
+++ b/src/editor/g_map.pas
begin
case TextureID of
TEXTURE_SPECIAL_NONE:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
64, 64, 64, 127);
end;
TEXTURE_SPECIAL_WATER:
- if PreviewMode then
+ if PreviewMode > 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
0, 0, 255, 0, B_FILTER)
0, 0, 255, 127);
TEXTURE_SPECIAL_ACID1:
- if PreviewMode then
+ if PreviewMode > 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
0, 127, 0, 0, B_FILTER)
0, 255, 0, 127);
TEXTURE_SPECIAL_ACID2:
- if PreviewMode then
+ if PreviewMode > 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
127, 0, 0, 0, B_FILTER)
DrawTexture(a);
PANEL_LIFTUP:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
128, 64, 0, 0);
PANEL_LIFTDOWN:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
90, 154, 138, 0);
PANEL_LIFTLEFT:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
200, 80, 4, 0);
PANEL_LIFTRIGHT:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
252, 140, 56, 0);
PANEL_BLOCKMON:
- if not PreviewMode then
+ if PreviewMode = 0 then
e_DrawFillQuad(X+MapOffset.X, Y+MapOffset.Y,
X+MapOffset.X+Width-1, Y+MapOffset.Y+Height-1,
192, 0, 192, 0);
begin
ID := 0;
// В режиме Превью рисуем небо:
- if PreviewMode then
+ if PreviewMode > 0 then
begin
w := Max(MainForm.RenderPanel.Width, MainForm.RenderPanel.Height);
if MainForm.RenderPanel.Height > MainForm.RenderPanel.Width*3/4 then
end;
// Рисуем панели (если Превью или если включен слой):
- if LayerEnabled[LAYER_BACK] or PreviewMode then
+ if LayerEnabled[LAYER_BACK] or (PreviewMode = 1) then
DrawPanels(PANEL_BACK);
- if PreviewMode then
+ if PreviewMode > 0 then
DrawPanels(PANEL_LIFTUP or PANEL_LIFTDOWN or PANEL_LIFTLEFT or PANEL_LIFTRIGHT)
else
if LayerEnabled[LAYER_WATER] then
DrawPanels(PANEL_LIFTUP or PANEL_LIFTDOWN or PANEL_LIFTLEFT or PANEL_LIFTRIGHT or
PANEL_OPENDOOR or PANEL_CLOSEDOOR or PANEL_BLOCKMON);
- if LayerEnabled[LAYER_WALLS] or PreviewMode then
+ if LayerEnabled[LAYER_WALLS] or (PreviewMode = 1) then
DrawPanels(PANEL_WALL);
- if LayerEnabled[LAYER_STEPS] or PreviewMode then
+ if LayerEnabled[LAYER_STEPS] or (PreviewMode = 1) then
DrawPanels(PANEL_STEP);
// Рисуем предметы:
- if (LayerEnabled[LAYER_ITEMS] or PreviewMode) and
+ if (LayerEnabled[LAYER_ITEMS] or (PreviewMode = 1)) and
(gItems <> nil) then
for a := 0 to High(gItems) do
if gItems[a].ItemType <> ITEM_NONE then
end;
// Рисуем монстров:
- if (LayerEnabled[LAYER_MONSTERS] or PreviewMode) and
+ if (LayerEnabled[LAYER_MONSTERS] or (PreviewMode = 1)) and
(gMonsters <> nil) then
for a := 0 to High(gMonsters) do
if gMonsters[a].MonsterType <> MONSTER_NONE then
end;
// Рамка:
- if not PreviewMode then
+ if PreviewMode = 0 then
begin
e_DrawQuad(MapOffset.X+gMonsters[a].X, MapOffset.Y+gMonsters[a].Y,
MapOffset.X+gMonsters[a].X+Width-1, MapOffset.Y+gMonsters[a].Y+Height-1,
end;
// Рисуем закрытые двери после монстров:
- if PreviewMode then
+ if ((PreviewMode = 2) and LayerEnabled[LAYER_WATER])
+ or (PreviewMode = 1) then
DrawPanels(PANEL_CLOSEDOOR);
// Рисуем области:
- if (LayerEnabled[LAYER_AREAS] or PreviewMode) and
+ if (LayerEnabled[LAYER_AREAS] or (PreviewMode = 1)) and
(gAreas <> nil) then
for a := 0 to High(gAreas) do
if gAreas[a].AreaType <> AREA_NONE then
AREA_BLUETEAMPOINT: g_GetTexture('AREA_BLUEPOINT', ID);
end;
- if (not PreviewMode) or
+ if (PreviewMode = 0) or
(gAreas[a].AreaType = AREA_REDFLAG) or
(gAreas[a].AreaType = AREA_BLUEFLAG) or
(gAreas[a].AreaType = AREA_DOMFLAG) then
0, True, False);
// Рамка:
- if not PreviewMode then
+ if PreviewMode = 0 then
begin
e_DrawQuad(MapOffset.X+gAreas[a].X, MapOffset.Y+gAreas[a].Y,
MapOffset.X+gAreas[a].X+Width-1, MapOffset.Y+gAreas[a].Y+Height-1,
end;
// Рисуем жидкости и передний план после областей:
- if LayerEnabled[LAYER_WATER] or PreviewMode then
+ if LayerEnabled[LAYER_WATER] or (PreviewMode = 1) then
DrawPanels(PANEL_WATER or PANEL_ACID1 or PANEL_ACID2);
- if LayerEnabled[LAYER_FOREGROUND] or PreviewMode then
+ if LayerEnabled[LAYER_FOREGROUND] or (PreviewMode = 1) then
DrawPanels(PANEL_FORE);
// Рисуем триггеры:
if LayerEnabled[LAYER_TRIGGERS] and
- (not PreviewMode) and (gTriggers <> nil) then
+ (PreviewMode = 0) and (gTriggers <> nil) then
for a := 0 to High(gTriggers) do
with gTriggers[a] do
if TriggerType <> TRIGGER_NONE then
end;
// Границы карты:
- if not PreviewMode then
+ if PreviewMode = 0 then
begin
e_DrawFillQuad(-32+MapOffset.X,
-32+MapOffset.Y,