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