fixed some "forgotten" options in Options

This commit is contained in:
zueuk 2006-09-17 07:58:34 +00:00
parent 554aeb8b67
commit 60ae65b2ba
6 changed files with 68 additions and 148 deletions

View File

@ -113,7 +113,7 @@ type
public public
Renderer: TRenderThread; Renderer: TRenderThread;
PhysicalMemory, ApproxMemory: int64; PhysicalMemory, ApproxMemory, TotalPhysicalMemory: int64;
ColorMap: TColorMap; ColorMap: TColorMap;
cp: TControlPoint; cp: TControlPoint;
Filename: string; Filename: string;
@ -173,6 +173,8 @@ begin
GlobalMemoryInfo.dwLength := SizeOf(GlobalMemoryInfo); GlobalMemoryInfo.dwLength := SizeOf(GlobalMemoryInfo);
GlobalMemoryStatus(GlobalMemoryInfo); GlobalMemoryStatus(GlobalMemoryInfo);
PhysicalMemory := GlobalMemoryInfo.dwAvailPhys div 1048576; PhysicalMemory := GlobalMemoryInfo.dwAvailPhys div 1048576;
TotalPhysicalMemory := GlobalMemoryInfo.dwTotalPhys div 1048576;
TotalPhysicalMemory := TotalPhysicalMemory * 9 div 10; // assume that OS will take 10% of RAM ;)
ApproxMemory := int64(ImageHeight) * int64(ImageWidth) * sqr(Oversample) * SizeOfBucket[BitsPerSample] div 1048576; ApproxMemory := int64(ImageHeight) * int64(ImageWidth) * sqr(Oversample) * SizeOfBucket[BitsPerSample] div 1048576;
lblPhysical.Caption := Format('%u', [PhysicalMemory]) + ' Mb'; lblPhysical.Caption := Format('%u', [PhysicalMemory]) + ' Mb';
@ -337,16 +339,22 @@ begin
ImageWidth := StrToInt(cbWidth.text); ImageWidth := StrToInt(cbWidth.text);
ImageHeight := StrToInt(cbHeight.text); ImageHeight := StrToInt(cbHeight.text);
if (not chkLimitMem.checked) and (ApproxMemory > PhysicalMemory) then if not chkLimitMem.checked then begin
if (ApproxMemory > TotalPhysicalMemory) then
begin begin
//Application.MessageBox('You do not have enough memory for this render. Please use memory limiting.', 'Apophysis', 48); Application.MessageBox('You do not have enough memory for this render. Please use memory limiting.', 'Apophysis', 48);
if Application.MessageBox('There is not enough memory for this render. ' + exit;
'You can use memory limiting, or if you are sure that your system has this much RAM, ' +
'you can try to allocate memory anyway. ' +
'Dou you want to try? (USE ON YOUR OWN RISK!!!)', 'Apophysis',
MB_YESNO) <> IDYES then exit;
end; end;
if chkLimitMem.checked and (PhysicalMemory < StrToInt(cbMaxMemory.text)) and (Approxmemory > PhysicalMemory) then begin if (ApproxMemory > PhysicalMemory) then
begin
if Application.MessageBox('There is not enough memory for this render. ' + #13 +
'You can use memory limiting, or - if you are sure that your system *should* ' + #13 +
'have the required amount of free RAM, you can try to allocate memory anyway. ' + #13#13 +
'Dou you want to try? (SLOW AND UNSTABLE - USE AT YOUR OWN RISK!!!)', 'Apophysis',
MB_ICONWARNING or MB_YESNO) <> IDYES then exit;
end;
end
else if (PhysicalMemory < StrToInt(cbMaxMemory.text)) and (Approxmemory > PhysicalMemory) then begin
Application.MessageBox('You do not have enough memory for this render. Please use a lower Maximum memory setting.', 'Apophysis', 48); Application.MessageBox('You do not have enough memory for this render. Please use a lower Maximum memory setting.', 'Apophysis', 48);
exit; exit;
end; end;

View File

@ -139,11 +139,6 @@ begin
if TraceLevel > 0 then Renderer.Output := TraceForm.FullscreenTrace.Lines; if TraceLevel > 0 then Renderer.Output := TraceForm.FullscreenTrace.Lines;
Renderer.SetCP(cp); Renderer.SetCP(cp);
if FullscreenTimeLimit > 0 then begin
TimeLimiter.Interval := FullscreenTimeLimit;
TimeLimiter.Enabled := FALSE;//true;
end;
Renderer.WaitForMore := true; Renderer.WaitForMore := true;
RenderStop.Enabled := true; RenderStop.Enabled := true;
RenderMore.Enabled := false; RenderMore.Enabled := false;

View File

@ -62,7 +62,6 @@ const
var var
MainSeed: integer; MainSeed: integer;
MainTriangles: TTriangles; MainTriangles: TTriangles;
ConfirmDelete: boolean; // Flag confirmation of entry deletion
Transforms: integer; // Count of Tranforms Transforms: integer; // Count of Tranforms
EnableFinalXform: boolean; EnableFinalXform: boolean;
AppPath: string; // Path of applicatio file AppPath: string; // Path of applicatio file
@ -92,6 +91,7 @@ var
{ Editor } { Editor }
UseFlameBackground, UseTransformColors: boolean; UseFlameBackground, UseTransformColors: boolean;
HelpersEnabled: boolean;
EditorBkgColor, ReferenceTriangleColor: integer; EditorBkgColor, ReferenceTriangleColor: integer;
GridColor1, GridColor2, HelpersColor: integer; GridColor1, GridColor2, HelpersColor: integer;
ExtEditEnabled, TransformAxisLock: boolean; ExtEditEnabled, TransformAxisLock: boolean;
@ -124,6 +124,8 @@ var
{ Defaults } { Defaults }
ConfirmDelete: boolean; // Flag confirmation of entry deletion
OldPaletteFormat: boolean;
SavePath, SmoothPalettePath: string; SavePath, SmoothPalettePath: string;
RandomPrefix, RandomDate: string; RandomPrefix, RandomDate: string;
RandomIndex: integer; RandomIndex: integer;
@ -145,9 +147,6 @@ var
SaveIncompleteRenders: boolean; SaveIncompleteRenders: boolean;
ShowRenderStats: boolean; ShowRenderStats: boolean;
PreviewTimeLimit, FullscreenTimeLimit: integer;
PreviewMinDensity: double;
SymmetryType: integer; SymmetryType: integer;
SymmetryOrder: integer; SymmetryOrder: integer;
SymmetryNVars: integer; SymmetryNVars: integer;

View File

@ -241,79 +241,14 @@ object OptionsForm: TOptionsForm
'64-bit integer') '64-bit integer')
end end
end end
object GroupBox19: TGroupBox object chkOldPaletteFormat: TCheckBox
Left = 136 Left = 8
Top = 112 Top = 204
Width = 201 Width = 121
Height = 97 Height = 29
Caption = 'Time-limited previews' Caption = 'Save gradient in old file format'
TabOrder = 5 TabOrder = 5
Visible = False WordWrap = True
object Label45: TLabel
Left = 8
Top = 19
Width = 116
Height = 13
Caption = 'Fullscreen time limit (ms)'
end
object Label46: TLabel
Left = 8
Top = 43
Width = 106
Height = 13
Caption = 'Preview time limit (ms)'
end
object Label47: TLabel
Left = 8
Top = 67
Width = 116
Height = 13
Caption = 'Preview minimum quality'
end
object txtPreviewMinQ: TEdit
Left = 128
Top = 64
Width = 65
Height = 21
TabOrder = 0
Text = '0.2'
end
object cbPreviewTime: TComboBox
Left = 128
Top = 40
Width = 65
Height = 21
ItemHeight = 13
ItemIndex = 0
TabOrder = 1
Text = 'off'
Items.Strings = (
'off'
'25'
'50'
'100'
'200'
'500'
'1000')
end
object cbFullscrTime: TComboBox
Left = 128
Top = 16
Width = 65
Height = 21
ItemHeight = 13
TabOrder = 2
Text = 'off'
Items.Strings = (
'off'
'100'
'250'
'500'
'1000'
'2000'
'3000'
'5000')
end
end end
end end
object EditorPage: TTabSheet object EditorPage: TTabSheet

View File

@ -202,13 +202,6 @@ type
Label44: TLabel; Label44: TLabel;
GroupBox18: TGroupBox; GroupBox18: TGroupBox;
cbInternalBitsPerSample: TComboBox; cbInternalBitsPerSample: TComboBox;
GroupBox19: TGroupBox;
Label45: TLabel;
Label46: TLabel;
txtPreviewMinQ: TEdit;
Label47: TLabel;
cbPreviewTime: TComboBox;
cbFullscrTime: TComboBox;
GroupBox20: TGroupBox; GroupBox20: TGroupBox;
chkShowTransparency: TCheckBox; chkShowTransparency: TCheckBox;
chkExtendMainPreview: TCheckBox; chkExtendMainPreview: TCheckBox;
@ -221,6 +214,7 @@ type
chkAxisLock: TCheckBox; chkAxisLock: TCheckBox;
chkExtendedEdit: TCheckBox; chkExtendedEdit: TCheckBox;
rgDoubleClickVars: TRadioGroup; rgDoubleClickVars: TRadioGroup;
chkOldPaletteFormat: TCheckBox;
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject); procedure btnOKClick(Sender: TObject);
@ -300,20 +294,18 @@ begin
txtDefSmoothFile.Text := defSmoothPaletteFile; txtDefSmoothFile.Text := defSmoothPaletteFile;
txtNumtries.text := IntToStr(Numtries); txtNumtries.text := IntToStr(Numtries);
txtTryLength.text := IntToStr(Trylength); txtTryLength.text := IntToStr(Trylength);
chkConfirmDel.Checked := ConfirmDelete;
txtJPEGQuality.text := IntToStr(JPEGQuality);
rgReferenceMode.ItemIndex := ReferenceMode;
rgRotationMode.ItemIndex := MainForm_RotationMode;
udBatchSize.Position := BatchSize; udBatchSize.Position := BatchSize;
// chkResize.checked := ResizeOnLoad; // chkResize.checked := ResizeOnLoad;
if NrTreads <= 1 then if NrTreads <= 1 then
cbNrTheads.ItemIndex := 0 cbNrTheads.ItemIndex := 0
else else
cbNrTheads.text := intTostr(NrTreads); cbNrTheads.text := intTostr(NrTreads);
chkExtendedEdit.Checked := ExtEditEnabled;
chkAxisLock.Checked := TransformAxisLock; chkConfirmDel.Checked := ConfirmDelete;
if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1 chkOldPaletteFormat.Checked := OldPaletteFormat;
else rgDoubleClickVars.ItemIndex := 0;
rgRotationMode.ItemIndex := MainForm_RotationMode;
txtJPEGQuality.text := IntToStr(JPEGQuality);
chkPlaySound.Checked := PlaySoundOnRenderComplete; chkPlaySound.Checked := PlaySoundOnRenderComplete;
txtSoundFile.Text := RenderCompleteSoundFile; txtSoundFile.Text := RenderCompleteSoundFile;
@ -321,11 +313,14 @@ begin
cbInternalBitsPerSample.ItemIndex := InternalBitsPerSample; cbInternalBitsPerSample.ItemIndex := InternalBitsPerSample;
if PreviewTimeLimit = 0 then cbPreviewTime.ItemIndex := 0 { Editor }
else cbPreviewTime.Text := IntToStr(PreviewTimeLimit); rgReferenceMode.ItemIndex := ReferenceMode;
if FullscreenTimeLimit = 0 then cbFullscrTime.ItemIndex := 0 chkUseXFormColor.checked := UseTransformColors;
else cbFullscrTime.Text := IntToStr(FullscreenTimeLimit); chkHelpers.Checked := HelpersEnabled;
txtPreviewMinQ.Text := FloatToStr(PreviewMinDensity); chkExtendedEdit.Checked := ExtEditEnabled;
chkAxisLock.Checked := TransformAxisLock;
if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1
else rgDoubleClickVars.ItemIndex := 0;
{ Display tab } { Display tab }
txtSampleDensity.Text := FloatToStr(defSampleDensity); txtSampleDensity.Text := FloatToStr(defSampleDensity);
@ -441,18 +436,19 @@ begin
NrTreads := StrToIntDef(cbNrTheads.text, 0); NrTreads := StrToIntDef(cbNrTheads.text, 0);
ConfirmDelete := chkConfirmDel.Checked; ConfirmDelete := chkConfirmDel.Checked;
OldPaletteFormat := chkOldPaletteFormat.Checked;
MainForm_RotationMode := rgRotationMode.ItemIndex; MainForm_RotationMode := rgRotationMode.ItemIndex;
// ResizeOnLoad := chkResize.checked; // ResizeOnLoad := chkResize.checked;
InternalBitsPerSample := cbInternalBitsPerSample.ItemIndex; InternalBitsPerSample := cbInternalBitsPerSample.ItemIndex;
PreviewTimeLimit := StrToIntDef(cbPreviewTime.Text, 0);
FullscreenTimeLimit := StrToIntDef(cbFullscrTime.Text, 0);
PreviewMinDensity := StrToFloatDef(txtPreviewMinQ.Text, 0.2);
// Editor // Editor
ReferenceMode := rgReferenceMode.ItemIndex; ReferenceMode := rgReferenceMode.ItemIndex;
UseTransformColors := chkUseXFormColor.checked;
HelpersEnabled := chkHelpers.Checked;
ExtEditEnabled := chkExtendedEdit.Checked; ExtEditEnabled := chkExtendedEdit.Checked;
TransformAxisLock := chkAxisLock.Checked; TransformAxisLock := chkAxisLock.Checked;
DoubleClickSetVars := rgDoubleClickVars.ItemIndex <> 0; DoubleClickSetVars := rgDoubleClickVars.ItemIndex <> 0;

View File

@ -100,6 +100,15 @@ begin
begin begin
ConfirmDelete := True; ConfirmDelete := True;
end; end;
if Registry.ValueExists('OldPaletteFormat') then
begin
OldPaletteFormat := Registry.ReadBool('OldPaletteFormat');
end
else
begin
OldPaletteFormat := false;
end;
if Registry.ValueExists('KeepBackground') then if Registry.ValueExists('KeepBackground') then
begin begin
KeepBackground := Registry.ReadBool('KeepBackground'); KeepBackground := Registry.ReadBool('KeepBackground');
@ -559,18 +568,6 @@ begin
end; end;
// if Registry.ValueExists('PreviewTimeLimit') then
// PreviewTimeLimit := Registry.ReadInteger('PreviewTimeLimit')
// else
PreviewTimeLimit := 0;
// if Registry.ValueExists('FullscreenTimeLimit') then
// FullscreenTimeLimit := Registry.ReadInteger('FullscreenTimeLimit')
// else
FullscreenTimeLimit := 0;
// if Registry.ValueExists('PreviewMinDensity') then
// PreviewMinDensity := Registry.ReadFloat('PreviewMinDensity')
// else
PreviewMinDensity := 0.0;
end end
else else
begin begin
@ -584,6 +581,7 @@ begin
SavePath := DefaultPath + 'Parameters\My Flames.flame'; SavePath := DefaultPath + 'Parameters\My Flames.flame';
defSmoothPaletteFile := DefaultPath + 'smooth.ugr'; defSmoothPaletteFile := DefaultPath + 'smooth.ugr';
ConfirmDelete := True; ConfirmDelete := True;
OldPaletteFormat := false;
NumTries := 10; NumTries := 10;
TryLength := 100000; TryLength := 100000;
randMinTransforms := 2; randMinTransforms := 2;
@ -639,32 +637,21 @@ begin
NrTreads := 1; NrTreads := 1;
UseNrThreads := 1; UseNrThreads := 1;
InternalBitsPerSample := 0; InternalBitsPerSample := 0;
PreviewTimeLimit := 0;
FullscreenTimeLimit := 0;
PreviewMinDensity := 0.2;
end; end;
Registry.CloseKey; Registry.CloseKey;
{ Editor } // --Z-- moved from EditForm { Editor } // --Z-- moved from EditForm
if Registry.OpenKey('Software\' + APP_NAME + '\Forms\Editor', False) then if Registry.OpenKey('Software\' + APP_NAME + '\Forms\Editor', False) then
begin begin
{ if Registry.ValueExists('UseTransformColors') then if Registry.ValueExists('UseTransformColors') then
begin UseTransformColors := Registry.ReadBool('UseTransformColors')
UseTransformColors := Registry.ReadBool('UseTransformColors');
end
else else
begin
UseTransformColors := False; UseTransformColors := False;
end; if Registry.ValueExists('HelpersEnabled') then
if Registry.ValueExists('UseFlameBackground') then HelpersEnabled := Registry.ReadBool('HelpersEnabled')
begin
UseFlameBackground := Registry.ReadBool('UseFlameBackground');
end
else else
begin HelpersEnabled := true;
UseFlameBackground := False;
end;
}
if Registry.ValueExists('BackgroundColor') then if Registry.ValueExists('BackgroundColor') then
EditorBkgColor := Registry.ReadInteger('BackgroundColor') EditorBkgColor := Registry.ReadInteger('BackgroundColor')
else else
@ -696,6 +683,8 @@ begin
else DoubleClickSetVars := true; else DoubleClickSetVars := true;
end end
else begin else begin
UseTransformColors := false;
HelpersEnabled := true;
EditorBkgColor := $000000; EditorBkgColor := $000000;
GridColor1 := $444444; GridColor1 := $444444;
GridColor2 := $333333; GridColor2 := $333333;
@ -997,6 +986,7 @@ begin
Registry.WriteString('RenderCompleteSoundFile', RenderCompleteSoundFile); Registry.WriteString('RenderCompleteSoundFile', RenderCompleteSoundFile);
Registry.WriteBool('ConfirmDelete', ConfirmDelete); Registry.WriteBool('ConfirmDelete', ConfirmDelete);
Registry.WriteBool('OldPaletteFormat', OldPaletteFormat);
Registry.WriteInteger('NumTries', NumTries); Registry.WriteInteger('NumTries', NumTries);
Registry.WriteInteger('TryLength', TryLength); Registry.WriteInteger('TryLength', TryLength);
Registry.WriteInteger('MinTransforms', randMinTransforms); Registry.WriteInteger('MinTransforms', randMinTransforms);
@ -1068,15 +1058,12 @@ begin
Registry.WriteInteger('NrTreads', NrTreads); Registry.WriteInteger('NrTreads', NrTreads);
Registry.WriteInteger('UseNrThreads', UseNrThreads); Registry.WriteInteger('UseNrThreads', UseNrThreads);
Registry.WriteInteger('InternalBitsPerSample', InternalBitsPerSample); Registry.WriteInteger('InternalBitsPerSample', InternalBitsPerSample);
Registry.WriteInteger('PreviewTimeLimit', PreviewTimeLimit);
Registry.WriteInteger('FullscreenTimeLimit', FullscreenTimeLimit);
Registry.WriteFloat('PreviewMinDensity', PreviewMinDensity);
end; end;
{ Editor } { Editor }
if Registry.OpenKey('\Software\' + APP_NAME + '\Forms\Editor', True) then if Registry.OpenKey('\Software\' + APP_NAME + '\Forms\Editor', True) then
begin begin
Registry.WriteBool('UseTransformColors', UseTransformColors); Registry.WriteBool('UseTransformColors', UseTransformColors);
Registry.WriteBool('HelpersEnabled', HelpersEnabled);
Registry.WriteInteger('BackgroundColor', EditorBkgColor); Registry.WriteInteger('BackgroundColor', EditorBkgColor);
Registry.WriteInteger('GridColor1', GridColor1); Registry.WriteInteger('GridColor1', GridColor1);
Registry.WriteInteger('GridColor2', GridColor2); Registry.WriteInteger('GridColor2', GridColor2);