From: DeaDDooMER Date: Mon, 29 May 2023 15:44:31 +0000 (+0300) Subject: gl: fix repaint on scrolling or dragging X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=caaa041f34124f7be0c8915e10f7849c4a030b1d;p=d2df-editor.git gl: fix repaint on scrolling or dragging --- diff --git a/src/editor/f_main.lfm b/src/editor/f_main.lfm index e9cad5e..07a325d 100644 --- a/src/editor/f_main.lfm +++ b/src/editor/f_main.lfm @@ -1,11 +1,11 @@ object MainForm: TMainForm - Left = 1406 + Left = 176 Height = 480 - Top = 831 + Top = 142 Width = 672 AllowDropFiles = True Caption = '2' - ClientHeight = 453 + ClientHeight = 480 ClientWidth = 672 Color = clBtnFace Constraints.MinHeight = 480 @@ -27,17 +27,17 @@ object MainForm: TMainForm LCLVersion = '2.2.4.0' object PanelMap: TPanel Left = 0 - Height = 284 + Height = 317 Top = 34 Width = 518 Align = alClient BevelOuter = bvNone - ClientHeight = 284 + ClientHeight = 317 ClientWidth = 518 TabOrder = 1 object RenderPanel: TOpenGLControl Left = 0 - Height = 268 + Height = 301 Top = 0 Width = 502 Align = alClient @@ -51,7 +51,7 @@ object MainForm: TMainForm object sbHorizontal: TScrollBar Left = 0 Height = 16 - Top = 268 + Top = 301 Width = 518 Align = alBottom LargeChange = 256 @@ -64,7 +64,7 @@ object MainForm: TMainForm end object sbVertical: TScrollBar Left = 502 - Height = 268 + Height = 301 Top = 0 Width = 16 Align = alRight @@ -106,7 +106,7 @@ object MainForm: TMainForm end object Splitter1: TSplitter Left = 518 - Height = 284 + Height = 317 Top = 34 Width = 5 Align = alRight @@ -120,7 +120,7 @@ object MainForm: TMainForm Cursor = crVSplit Left = 0 Height = 3 - Top = 318 + Top = 351 Width = 672 Align = alBottom MinSize = 64 @@ -130,18 +130,18 @@ object MainForm: TMainForm end object PanelProps: TPanel Left = 523 - Height = 284 + Height = 317 Top = 34 Width = 149 Align = alRight BevelInner = bvRaised BevelOuter = bvLowered - ClientHeight = 284 + ClientHeight = 317 ClientWidth = 149 TabOrder = 0 object vleObjectProperty: TValueListEditor Left = 2 - Height = 250 + Height = 283 Top = 2 Width = 145 Align = alClient @@ -182,7 +182,7 @@ object MainForm: TMainForm object PanelPropApply: TPanel Left = 2 Height = 30 - Top = 252 + Top = 285 Width = 145 Align = alBottom BevelOuter = bvNone @@ -202,8 +202,8 @@ object MainForm: TMainForm end object StatusBar: TStatusBar Left = 0 - Height = 21 - Top = 432 + Height = 15 + Top = 465 Width = 672 AutoHint = True Panels = < @@ -219,7 +219,7 @@ object MainForm: TMainForm object PanelObjs: TPanel Left = 0 Height = 111 - Top = 321 + Top = 354 Width = 672 Align = alBottom BevelInner = bvRaised @@ -240,48 +240,48 @@ object MainForm: TMainForm TabOrder = 0 object tsPanels: TTabSheet Caption = 'Панели' - ClientHeight = 77 - ClientWidth = 664 + ClientHeight = 68 + ClientWidth = 662 ImageIndex = 12 object lbTextureList: TListBox Left = 206 - Height = 77 + Height = 70 Hint = 'Список текстур' Top = 0 - Width = 246 + Width = 244 Align = alClient Constraints.MaxHeight = 600 Constraints.MinHeight = 70 ItemHeight = 13 OnClick = lbTextureListClick OnDrawItem = lbTextureListDrawItem + Options = [lboDrawFocusRect] Style = lbOwnerDrawFixed TabOrder = 0 - TopIndex = -1 end object PanelTextures: TPanel - Left = 452 - Height = 77 + Left = 450 + Height = 68 Top = 0 Width = 212 Align = alRight BevelOuter = bvNone - ClientHeight = 77 + ClientHeight = 68 ClientWidth = 212 TabOrder = 1 object LabelTxH: TLabel Left = 33 - Height = 14 + Height = 13 Top = 22 - Width = 105 + Width = 95 Caption = 'Высота текстуры:' ParentColor = False end object LabelTxW: TLabel Left = 33 - Height = 14 + Height = 13 Top = 0 - Width = 109 + Width = 101 Caption = 'Ширина текстуры:' ParentColor = False end @@ -303,9 +303,9 @@ object MainForm: TMainForm end object cbPreview: TCheckBox Left = 35 - Height = 21 + Height = 18 Top = 54 - Width = 187 + Width = 205 Caption = 'Предварительный просмотр' TabOrder = 0 end @@ -341,17 +341,17 @@ object MainForm: TMainForm end object PanelPanelType: TPanel Left = 0 - Height = 77 + Height = 68 Top = 0 Width = 206 Align = alLeft BevelOuter = bvNone - ClientHeight = 77 + ClientHeight = 68 ClientWidth = 206 TabOrder = 2 object lbPanelType: TListBox Left = 0 - Height = 77 + Height = 68 Hint = 'Тип панели' Top = 0 Width = 201 @@ -371,18 +371,19 @@ object MainForm: TMainForm 'Блокиратор монстров' ) ItemHeight = 20 + Options = [lboDrawFocusRect] TabOrder = 0 end end end object tsItems: TTabSheet Caption = 'Предметы' - ClientHeight = 77 - ClientWidth = 664 + ClientHeight = 68 + ClientWidth = 662 ImageIndex = 4 object lbItemList: TListBox Left = 0 - Height = 77 + Height = 68 Hint = 'Список предметов' Top = 0 Width = 201 @@ -421,35 +422,35 @@ object MainForm: TMainForm 'Бутылек здоровья' 'Часть брони' ) - ItemHeight = 0 + ItemHeight = 20 + Options = [lboDrawFocusRect] TabOrder = 0 - TopIndex = -1 end object cbOnlyDM: TCheckBox Left = 208 - Height = 21 + Height = 18 Top = 0 - Width = 110 + Width = 102 Caption = 'Только в DM' TabOrder = 1 end object cbFall: TCheckBox Left = 208 - Height = 21 + Height = 18 Top = 16 - Width = 74 + Width = 67 Caption = 'Падает' TabOrder = 2 end end object tsMonsters: TTabSheet Caption = 'Монстры' - ClientHeight = 77 - ClientWidth = 664 + ClientHeight = 68 + ClientWidth = 662 ImageIndex = 15 object lbMonsterList: TListBox Left = 0 - Height = 77 + Height = 68 Hint = 'Список монстров' Top = 0 Width = 201 @@ -476,15 +477,15 @@ object MainForm: TMainForm 'Робот' 'Приколист' ) - ItemHeight = 0 + ItemHeight = 20 + Options = [lboDrawFocusRect] TabOrder = 0 - TopIndex = -1 end object rbMonsterLeft: TRadioButton Left = 208 - Height = 21 + Height = 18 Top = 0 - Width = 65 + Width = 58 Caption = 'Влево' Checked = True TabOrder = 1 @@ -492,21 +493,21 @@ object MainForm: TMainForm end object rbMonsterRight: TRadioButton Left = 208 - Height = 21 + Height = 18 Top = 16 - Width = 73 + Width = 66 Caption = 'Вправо' TabOrder = 2 end end object tsAreas: TTabSheet Caption = 'Области' - ClientHeight = 77 - ClientWidth = 664 + ClientHeight = 68 + ClientWidth = 662 ImageIndex = 3 object lbAreasList: TListBox Left = 0 - Height = 77 + Height = 68 Hint = 'Список областей' Top = 0 Width = 201 @@ -521,15 +522,15 @@ object MainForm: TMainForm 'Красная команда' 'Синяя команда' ) - ItemHeight = 0 + ItemHeight = 20 + Options = [lboDrawFocusRect] TabOrder = 0 - TopIndex = -1 end object rbAreaLeft: TRadioButton Left = 208 - Height = 21 + Height = 18 Top = 0 - Width = 65 + Width = 58 Caption = 'Влево' Checked = True TabOrder = 1 @@ -537,21 +538,21 @@ object MainForm: TMainForm end object rbAreaRight: TRadioButton Left = 208 - Height = 21 + Height = 18 Top = 16 - Width = 73 + Width = 66 Caption = 'Вправо' TabOrder = 2 end end object tsTriggers: TTabSheet Caption = 'Триггеры' - ClientHeight = 77 - ClientWidth = 664 + ClientHeight = 68 + ClientWidth = 662 ImageIndex = 6 object lbTriggersList: TListBox Left = 0 - Height = 77 + Height = 68 Hint = 'Список триггеров' Top = 0 Width = 201 @@ -579,13 +580,13 @@ object MainForm: TMainForm 'Создать предмет' 'Музыка' ) - ItemHeight = 0 + ItemHeight = 20 + Options = [lboDrawFocusRect] TabOrder = 0 - TopIndex = -1 end object clbActivationType: TCheckListBox Left = 201 - Height = 77 + Height = 68 Hint = 'Тип активации триггера' Top = 0 Width = 128 @@ -598,16 +599,15 @@ object MainForm: TMainForm 'Выстрел' 'Монстров нет' ) - ItemHeight = 0 + ItemHeight = 20 TabOrder = 1 - TopIndex = -1 Data = { 06000000000000000000 } end object clbKeys: TCheckListBox Left = 329 - Height = 77 + Height = 68 Hint = 'Ключи для активации' Top = 0 Width = 128 @@ -619,9 +619,8 @@ object MainForm: TMainForm 'Красная команда' 'Синяя команда' ) - ItemHeight = 0 + ItemHeight = 20 TabOrder = 2 - TopIndex = -1 Data = { 050000000000000000 } @@ -750,12 +749,12 @@ object MainForm: TMainForm DefaultExt = '.dfz' Filter = 'Карты Doom 2D: Forever (*.dfz, *.dfzip, *.zip, *.wad)|*.dfz;*.dfzip;*.zip;*.wad|Старые карты Doom 2D: Forever 0.30 (*.ini)|*.ini|Все файлы (*.*)|*.*' Options = [ofHideReadOnly, ofNoChangeDir, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofDontAddToRecent] - left = 32 - top = 64 + Left = 32 + Top = 64 end object ImageList: TImageList - left = 32 - top = 101 + Left = 32 + Top = 101 Bitmap = { 4C7A1E00000010000000100000003A1000000000000078DAED5D4DAC234711F6 D1471FDFD512A018118209903884102C72F101212B512483E06090001F22300A @@ -894,13 +893,13 @@ object MainForm: TMainForm DefaultExt = '.dfz' Filter = 'Карты Doom 2D: Forever (*.dfz)|*.dfz|Карты Doom 2D: Forever (*.dfzip)|*.dfzip|Карты Doom 2D: Forever (*.zip)|*.zip|Карты Doom 2D: Forever (*.wad)|*.wad|Все файлы (*.*)|*.*' Options = [ofHideReadOnly, ofNoChangeDir, ofPathMustExist, ofNoReadOnlyReturn, ofEnableSizing, ofDontAddToRecent] - left = 64 - top = 64 + Left = 64 + Top = 64 end object MainMenu: TMainMenu Images = ImageList - left = 96 - top = 64 + Left = 96 + Top = 64 object miApple: TMenuItem Caption = '' Enabled = False @@ -1239,8 +1238,8 @@ object MainForm: TMainForm end object pmShow: TPopupMenu Images = ImageList - left = 128 - top = 64 + Left = 128 + Top = 64 object miLayerP1: TMenuItem Caption = 'Фон' Checked = True @@ -1290,8 +1289,8 @@ object MainForm: TMainForm object ilToolbar: TImageList Height = 24 Width = 24 - left = 64 - top = 101 + Left = 64 + Top = 101 Bitmap = { 4C7A090000001800000018000000810800000000000078DAED9C4D6C13471886 73E4C021C71C9020200E415C0C17A2860A0511513797BAD046A610D1084465A4 @@ -1388,12 +1387,12 @@ object MainForm: TMainForm 'ColorS=F0FBFF' 'ColorT=A4A0A0' ) - left = 64 - top = 146 + Left = 64 + Top = 146 end object MapTestTimer: TTimer OnTimer = MapTestCheck - left = 192 - top = 64 + Left = 192 + Top = 64 end end diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 3eb8946..591b7e0 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -4373,6 +4373,8 @@ begin // Строка состояния - координаты мыши: StatusBar.Panels[1].Text := Format('(%d:%d)', [MousePos.X-MapOffset.X, MousePos.Y-MapOffset.Y]); + + RenderPanel.Invalidate; end; procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); @@ -6993,12 +6995,14 @@ procedure TMainForm.sbVerticalScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); begin MapOffset.Y := -sbVertical.Position; + RenderPanel.Invalidate; end; procedure TMainForm.sbHorizontalScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer); begin MapOffset.X := -sbHorizontal.Position; + RenderPanel.Invalidate; end; procedure TMainForm.miOpenWadMapClick(Sender: TObject);