summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65146e9)
raw | patch | inline | side by side (parent: 65146e9)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 10 Sep 2023 14:01:18 +0000 (17:01 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 10 Sep 2023 14:01:18 +0000 (17:01 +0300) |
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index bf92c229531d27eacc2a0bb83561c9ed3bcb9dd4..0c912cf20500d7b4250e7941ac44e1d46bfd32ff 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
procedure FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
+ LastDrawTime: UInt64;
procedure Draw();
procedure OnIdle(Sender: TObject; var Done: Boolean);
procedure RefillRecentMenu (menu: TMenuItem; start: Integer; fmt: AnsiString);
s: String;
begin
Randomize();
+ LastDrawTime := 0;
{$IFDEF DARWIN}
miApple.Enabled := True;
ObjCount: Word;
aX, aY, aX2, aY2, XX, ScaleSz: Integer;
begin
+ LastDrawTime := GetTickCount64();
ID := 0;
PID := 0;
Width := 0;
end;
procedure TMainForm.OnIdle(Sender: TObject; var Done: Boolean);
+ const MaxFPS = 60;
var f: AnsiString;
begin
+ // TODO: move refresh to user actions (ask to repaint only when something changed)
+ if GetTickCount64() - LastDrawTime >= 1000 div MaxFPS then
+ begin
+ PanelMap.Refresh;
+ end;
+
if StartMap <> '' then
begin
f := StartMap;