Added a parameter controlling showing on-screen rendering info and made float numbers locale-aware.
This commit is contained in:
parent
8ac679c678
commit
7f9f315de7
@ -1,6 +1,6 @@
|
||||
object frmConfig: TfrmConfig
|
||||
Left = 422
|
||||
Top = 262
|
||||
Left = 676
|
||||
Top = 276
|
||||
BorderStyle = bsToolWindow
|
||||
Caption = 'Configure'
|
||||
ClientHeight = 330
|
||||
@ -125,7 +125,7 @@ object frmConfig: TfrmConfig
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 201
|
||||
Height = 137
|
||||
Height = 153
|
||||
Align = alTop
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
@ -147,7 +147,7 @@ object frmConfig: TfrmConfig
|
||||
end
|
||||
object rgQuality: TRadioGroup
|
||||
Left = 8
|
||||
Top = 48
|
||||
Top = 64
|
||||
Width = 185
|
||||
Height = 81
|
||||
Caption = 'Quality'
|
||||
@ -159,5 +159,15 @@ object frmConfig: TfrmConfig
|
||||
TabOrder = 2
|
||||
OnClick = rgQualityClick
|
||||
end
|
||||
object chkShowRndInfo: TCheckBox
|
||||
Left = 8
|
||||
Top = 40
|
||||
Width = 169
|
||||
Height = 17
|
||||
Caption = 'Show on-screen rendering info'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -24,6 +24,7 @@ type
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
pnlFilterpixels: TPanel;
|
||||
chkShowRndInfo: TCheckBox;
|
||||
procedure btnCancelClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure btnOkClick(Sender: TObject);
|
||||
@ -51,6 +52,8 @@ uses
|
||||
procedure TfrmConfig.FormCreate(Sender: TObject);
|
||||
var
|
||||
Registry: TRegistry;
|
||||
locale: LCID;
|
||||
FloatFormatSettings: TFormatSettings;
|
||||
begin
|
||||
Registry := TRegistry.Create;
|
||||
try
|
||||
@ -66,6 +69,11 @@ begin
|
||||
end else begin
|
||||
chkShowOtherImages.Checked := False;
|
||||
end;
|
||||
if Registry.ValueExists('ShowRenderInfo') then begin
|
||||
chkShowRndInfo.Checked := Registry.ReadBool('ShowRenderInfo');
|
||||
end else begin
|
||||
chkShowRndInfo.Checked := True;
|
||||
end;
|
||||
if Registry.ValueExists('Quality') then begin
|
||||
rgQuality.itemindex := Registry.ReadInteger('Quality');
|
||||
end else begin
|
||||
@ -76,19 +84,30 @@ begin
|
||||
end else begin
|
||||
edtOversample.Text := '1';
|
||||
end;
|
||||
locale := GetSystemDefaultLCID;
|
||||
GetLocaleFormatSettings(locale, FloatFormatSettings);
|
||||
if Registry.ValueExists('Filter') then begin
|
||||
edtFiltersize.Text := FloatToStr(Registry.ReadFloat('Filter'));
|
||||
edtFiltersize.Text := FloatToStrF(Registry.ReadFloat('Filter'),
|
||||
ffFixed,
|
||||
6, 2,
|
||||
FloatFormatSettings
|
||||
);
|
||||
end else begin
|
||||
edtFiltersize.Text := '0.1';
|
||||
end;
|
||||
if Registry.ValueExists('Density') then begin
|
||||
edtDensity.Text := FloatToStr(Registry.ReadFloat('Density'));
|
||||
edtDensity.Text := FloatToStrF(Registry.ReadFloat('Density'),
|
||||
ffFixed,
|
||||
6, 2,
|
||||
FloatFormatSettings
|
||||
);
|
||||
end else begin
|
||||
edtDensity.Text := '100';
|
||||
end;
|
||||
end else begin
|
||||
chkSave.Checked := False;
|
||||
chkShowOtherImages.Checked := False;
|
||||
chkShowRndInfo.Checked := True;
|
||||
rgQuality.itemindex := 1;
|
||||
edtOversample.Text := '1';
|
||||
edtFiltersize.Text := '0.1';
|
||||
@ -110,17 +129,22 @@ end;
|
||||
procedure TfrmConfig.btnOkClick(Sender: TObject);
|
||||
var
|
||||
Registry: TRegistry;
|
||||
locale: LCID;
|
||||
FloatFormatSettings: TFormatSettings;
|
||||
begin
|
||||
Registry := TRegistry.Create;
|
||||
try
|
||||
locale := GetSystemDefaultLCID;
|
||||
GetLocaleFormatSettings(locale, FloatFormatSettings);
|
||||
Registry.RootKey := HKEY_CURRENT_USER;
|
||||
if Registry.OpenKey('\Software\BobsFreubels\FlameSS', True) then begin
|
||||
Registry.WriteBool('SaveImage', chkSave.Checked);
|
||||
Registry.WriteBool('ShowOtherImages', chkShowOtherImages.Checked);
|
||||
Registry.WriteBool('ShowRenderInfo', chkShowRndInfo.Checked);
|
||||
Registry.WriteInteger('Quality', rgQuality.itemindex);
|
||||
Registry.WriteInteger('Oversample', StrToInt(edtOversample.Text));
|
||||
Registry.WriteFloat('Filter', StrToFloat(edtFiltersize.Text));
|
||||
Registry.WriteFloat('Density', StrToFloat(edtDensity.Text));
|
||||
Registry.WriteFloat('Filter', StrToFloat(edtFiltersize.Text, FloatFormatSettings));
|
||||
Registry.WriteFloat('Density', StrToFloat(edtDensity.Text, FloatFormatSettings));
|
||||
end;
|
||||
finally
|
||||
Registry.Free;
|
||||
|
@ -26,6 +26,7 @@ type
|
||||
Quality: integer;
|
||||
bSave: boolean;
|
||||
bShowOtherImages: boolean;
|
||||
bShowRenderInfo: boolean;
|
||||
Oversample: Integer;
|
||||
FilterSize: double;
|
||||
Density: double;
|
||||
@ -277,32 +278,34 @@ begin
|
||||
// Canvas.Fillrect(Rect(5, ClientHeight - 15, ClientWidth - 5, ClientHeight - 5));
|
||||
|
||||
|
||||
Canvas.Brush.Color := clYellow;
|
||||
Canvas.Brush.Color := clGray;
|
||||
Canvas.FrameRect(Rect(5, ClientHeight - 15, ClientWidth - 5, ClientHeight - 5));
|
||||
Canvas.Brush.Color := clYellow;
|
||||
Canvas.Brush.Color := clGray;
|
||||
Canvas.Fillrect(Rect(7, ClientHeight - 13, 7 + Round(prog * (ClientWidth - 14)), ClientHeight - 7));
|
||||
Canvas.Brush.Color := clBlack;
|
||||
Canvas.Fillrect(Rect(7 + Round(prog * (ClientWidth - 14)), ClientHeight - 13, ClientWidth - 7, ClientHeight - 7));
|
||||
|
||||
Elapsed := Now - StartTime;
|
||||
Canvas.Brush.Color := clBlack;
|
||||
Canvas.TextOut(5, ClientHeight - 25 - 2 * Canvas.TextHeight('X'), Format('Elapsed %2.2d:%2.2d:%2.2d.%2.2d',
|
||||
[Trunc(Elapsed * 24),
|
||||
Trunc((Elapsed * 24 - Trunc(Elapsed * 24)) * 60),
|
||||
Trunc((Elapsed * 24 * 60 - Trunc(Elapsed * 24 * 60)) * 60),
|
||||
Trunc((Elapsed * 24 * 60 * 60 - Trunc(Elapsed * 24 * 60 * 60)) * 100)]));
|
||||
if bShowRenderInfo then
|
||||
begin
|
||||
Elapsed := Now - StartTime;
|
||||
Canvas.Brush.Color := clBlack;
|
||||
Canvas.TextOut(5, ClientHeight - 25 - 2 * Canvas.TextHeight('X'), Format('Elapsed %2.2d:%2.2d:%2.2d.%2.2d',
|
||||
[Trunc(Elapsed * 24),
|
||||
Trunc((Elapsed * 24 - Trunc(Elapsed * 24)) * 60),
|
||||
Trunc((Elapsed * 24 * 60 - Trunc(Elapsed * 24 * 60)) * 60),
|
||||
Trunc((Elapsed * 24 * 60 * 60 - Trunc(Elapsed * 24 * 60 * 60)) * 100)]));
|
||||
|
||||
if prog > 0 then
|
||||
if prog > 0 then
|
||||
Remainder := Min(Remainder, Elapsed * (power(1/prog, 1.2) - 1));
|
||||
|
||||
Canvas.TextOut(5, ClientHeight - 20 - Canvas.TextHeight('X'), Format('Remainder %2.2d:%2.2d:%2.2d.%2.2d',
|
||||
[Trunc(Remainder * 24),
|
||||
Trunc((Remainder * 24 - Trunc(Remainder * 24)) * 60),
|
||||
Trunc((Remainder * 24 * 60 - Trunc(Remainder * 24 * 60)) * 60),
|
||||
Trunc((Remainder * 24 * 60 * 60 - Trunc(Remainder * 24 * 60 * 60)) * 100)]));
|
||||
|
||||
Canvas.TextOut(5, ClientHeight - 50 - Canvas.TextHeight('X'), IncludeTrailingPathDelimiter(ExtractFileDir(paramstr(0))) + 'images');
|
||||
Canvas.TextOut(5, ClientHeight - 20 - Canvas.TextHeight('X'), Format('Remainder %2.2d:%2.2d:%2.2d.%2.2d',
|
||||
[Trunc(Remainder * 24),
|
||||
Trunc((Remainder * 24 - Trunc(Remainder * 24)) * 60),
|
||||
Trunc((Remainder * 24 * 60 - Trunc(Remainder * 24 * 60)) * 60),
|
||||
Trunc((Remainder * 24 * 60 * 60 - Trunc(Remainder * 24 * 60 * 60)) * 100)]));
|
||||
|
||||
Canvas.TextOut(5, ClientHeight - 50 - Canvas.TextHeight('X'), IncludeTrailingPathDelimiter(ExtractFileDir(paramstr(0))) + 'images');
|
||||
end;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
@ -355,6 +358,11 @@ begin
|
||||
end else begin
|
||||
bShowOtherImages := False;
|
||||
end;
|
||||
if Registry.ValueExists('ShowRenderInfo') then begin
|
||||
bShowRenderInfo := Registry.ReadBool('ShowRenderInfo');
|
||||
end else begin
|
||||
bShowRenderInfo := False;
|
||||
end;
|
||||
if Registry.ValueExists('Quality') then begin
|
||||
Quality := Registry.ReadInteger('Quality');
|
||||
end else begin
|
||||
|
Loading…
Reference in New Issue
Block a user