diff --git a/2.10/Source/FormRender.pas b/2.10/Source/FormRender.pas index f69e5aa..f3da2b2 100644 --- a/2.10/Source/FormRender.pas +++ b/2.10/Source/FormRender.pas @@ -113,7 +113,7 @@ type public Renderer: TRenderThread; - PhysicalMemory, ApproxMemory: int64; + PhysicalMemory, ApproxMemory, TotalPhysicalMemory: int64; ColorMap: TColorMap; cp: TControlPoint; Filename: string; @@ -173,6 +173,8 @@ begin GlobalMemoryInfo.dwLength := SizeOf(GlobalMemoryInfo); GlobalMemoryStatus(GlobalMemoryInfo); 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; lblPhysical.Caption := Format('%u', [PhysicalMemory]) + ' Mb'; @@ -337,16 +339,22 @@ begin ImageWidth := StrToInt(cbWidth.text); ImageHeight := StrToInt(cbHeight.text); - if (not chkLimitMem.checked) and (ApproxMemory > PhysicalMemory) then - begin - //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. ' + - '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; - if chkLimitMem.checked and (PhysicalMemory < StrToInt(cbMaxMemory.text)) and (Approxmemory > PhysicalMemory) then begin + if not chkLimitMem.checked then begin + if (ApproxMemory > TotalPhysicalMemory) then + begin + Application.MessageBox('You do not have enough memory for this render. Please use memory limiting.', 'Apophysis', 48); + exit; + end; + 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); exit; end; diff --git a/2.10/Source/Fullscreen.pas b/2.10/Source/Fullscreen.pas index 5300317..8e47559 100644 --- a/2.10/Source/Fullscreen.pas +++ b/2.10/Source/Fullscreen.pas @@ -139,11 +139,6 @@ begin if TraceLevel > 0 then Renderer.Output := TraceForm.FullscreenTrace.Lines; Renderer.SetCP(cp); - if FullscreenTimeLimit > 0 then begin - TimeLimiter.Interval := FullscreenTimeLimit; - TimeLimiter.Enabled := FALSE;//true; - end; - Renderer.WaitForMore := true; RenderStop.Enabled := true; RenderMore.Enabled := false; diff --git a/2.10/Source/Global.pas b/2.10/Source/Global.pas index 5e7f226..989db69 100644 --- a/2.10/Source/Global.pas +++ b/2.10/Source/Global.pas @@ -62,7 +62,6 @@ const var MainSeed: integer; MainTriangles: TTriangles; - ConfirmDelete: boolean; // Flag confirmation of entry deletion Transforms: integer; // Count of Tranforms EnableFinalXform: boolean; AppPath: string; // Path of applicatio file @@ -92,6 +91,7 @@ var { Editor } UseFlameBackground, UseTransformColors: boolean; + HelpersEnabled: boolean; EditorBkgColor, ReferenceTriangleColor: integer; GridColor1, GridColor2, HelpersColor: integer; ExtEditEnabled, TransformAxisLock: boolean; @@ -124,6 +124,8 @@ var { Defaults } + ConfirmDelete: boolean; // Flag confirmation of entry deletion + OldPaletteFormat: boolean; SavePath, SmoothPalettePath: string; RandomPrefix, RandomDate: string; RandomIndex: integer; @@ -145,9 +147,6 @@ var SaveIncompleteRenders: boolean; ShowRenderStats: boolean; - PreviewTimeLimit, FullscreenTimeLimit: integer; - PreviewMinDensity: double; - SymmetryType: integer; SymmetryOrder: integer; SymmetryNVars: integer; diff --git a/2.10/Source/Options.dfm b/2.10/Source/Options.dfm index 805346d..e397b6e 100644 --- a/2.10/Source/Options.dfm +++ b/2.10/Source/Options.dfm @@ -241,79 +241,14 @@ object OptionsForm: TOptionsForm '64-bit integer') end end - object GroupBox19: TGroupBox - Left = 136 - Top = 112 - Width = 201 - Height = 97 - Caption = 'Time-limited previews' + object chkOldPaletteFormat: TCheckBox + Left = 8 + Top = 204 + Width = 121 + Height = 29 + Caption = 'Save gradient in old file format' TabOrder = 5 - Visible = False - 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 + WordWrap = True end end object EditorPage: TTabSheet diff --git a/2.10/Source/Options.pas b/2.10/Source/Options.pas index 697e03f..d224fa7 100644 --- a/2.10/Source/Options.pas +++ b/2.10/Source/Options.pas @@ -202,13 +202,6 @@ type Label44: TLabel; GroupBox18: TGroupBox; cbInternalBitsPerSample: TComboBox; - GroupBox19: TGroupBox; - Label45: TLabel; - Label46: TLabel; - txtPreviewMinQ: TEdit; - Label47: TLabel; - cbPreviewTime: TComboBox; - cbFullscrTime: TComboBox; GroupBox20: TGroupBox; chkShowTransparency: TCheckBox; chkExtendMainPreview: TCheckBox; @@ -221,6 +214,7 @@ type chkAxisLock: TCheckBox; chkExtendedEdit: TCheckBox; rgDoubleClickVars: TRadioGroup; + chkOldPaletteFormat: TCheckBox; procedure btnCancelClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure btnOKClick(Sender: TObject); @@ -300,20 +294,18 @@ begin txtDefSmoothFile.Text := defSmoothPaletteFile; txtNumtries.text := IntToStr(Numtries); txtTryLength.text := IntToStr(Trylength); - chkConfirmDel.Checked := ConfirmDelete; - txtJPEGQuality.text := IntToStr(JPEGQuality); - rgReferenceMode.ItemIndex := ReferenceMode; - rgRotationMode.ItemIndex := MainForm_RotationMode; udBatchSize.Position := BatchSize; // chkResize.checked := ResizeOnLoad; if NrTreads <= 1 then cbNrTheads.ItemIndex := 0 else cbNrTheads.text := intTostr(NrTreads); - chkExtendedEdit.Checked := ExtEditEnabled; - chkAxisLock.Checked := TransformAxisLock; - if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1 - else rgDoubleClickVars.ItemIndex := 0; + + chkConfirmDel.Checked := ConfirmDelete; + chkOldPaletteFormat.Checked := OldPaletteFormat; + + rgRotationMode.ItemIndex := MainForm_RotationMode; + txtJPEGQuality.text := IntToStr(JPEGQuality); chkPlaySound.Checked := PlaySoundOnRenderComplete; txtSoundFile.Text := RenderCompleteSoundFile; @@ -321,11 +313,14 @@ begin cbInternalBitsPerSample.ItemIndex := InternalBitsPerSample; - if PreviewTimeLimit = 0 then cbPreviewTime.ItemIndex := 0 - else cbPreviewTime.Text := IntToStr(PreviewTimeLimit); - if FullscreenTimeLimit = 0 then cbFullscrTime.ItemIndex := 0 - else cbFullscrTime.Text := IntToStr(FullscreenTimeLimit); - txtPreviewMinQ.Text := FloatToStr(PreviewMinDensity); + { Editor } + rgReferenceMode.ItemIndex := ReferenceMode; + chkUseXFormColor.checked := UseTransformColors; + chkHelpers.Checked := HelpersEnabled; + chkExtendedEdit.Checked := ExtEditEnabled; + chkAxisLock.Checked := TransformAxisLock; + if DoubleClickSetVars then rgDoubleClickVars.ItemIndex := 1 + else rgDoubleClickVars.ItemIndex := 0; { Display tab } txtSampleDensity.Text := FloatToStr(defSampleDensity); @@ -441,18 +436,19 @@ begin NrTreads := StrToIntDef(cbNrTheads.text, 0); ConfirmDelete := chkConfirmDel.Checked; + OldPaletteFormat := chkOldPaletteFormat.Checked; MainForm_RotationMode := rgRotationMode.ItemIndex; // ResizeOnLoad := chkResize.checked; InternalBitsPerSample := cbInternalBitsPerSample.ItemIndex; - PreviewTimeLimit := StrToIntDef(cbPreviewTime.Text, 0); - FullscreenTimeLimit := StrToIntDef(cbFullscrTime.Text, 0); - PreviewMinDensity := StrToFloatDef(txtPreviewMinQ.Text, 0.2); // Editor ReferenceMode := rgReferenceMode.ItemIndex; + UseTransformColors := chkUseXFormColor.checked; + HelpersEnabled := chkHelpers.Checked; + ExtEditEnabled := chkExtendedEdit.Checked; TransformAxisLock := chkAxisLock.Checked; DoubleClickSetVars := rgDoubleClickVars.ItemIndex <> 0; diff --git a/2.10/Source/Regstry.pas b/2.10/Source/Regstry.pas index be270e7..43ebdde 100644 --- a/2.10/Source/Regstry.pas +++ b/2.10/Source/Regstry.pas @@ -100,6 +100,15 @@ begin begin ConfirmDelete := True; end; + if Registry.ValueExists('OldPaletteFormat') then + begin + OldPaletteFormat := Registry.ReadBool('OldPaletteFormat'); + end + else + begin + OldPaletteFormat := false; + end; + if Registry.ValueExists('KeepBackground') then begin KeepBackground := Registry.ReadBool('KeepBackground'); @@ -559,18 +568,6 @@ begin 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 else begin @@ -584,6 +581,7 @@ begin SavePath := DefaultPath + 'Parameters\My Flames.flame'; defSmoothPaletteFile := DefaultPath + 'smooth.ugr'; ConfirmDelete := True; + OldPaletteFormat := false; NumTries := 10; TryLength := 100000; randMinTransforms := 2; @@ -639,32 +637,21 @@ begin NrTreads := 1; UseNrThreads := 1; InternalBitsPerSample := 0; - PreviewTimeLimit := 0; - FullscreenTimeLimit := 0; - PreviewMinDensity := 0.2; end; Registry.CloseKey; { Editor } // --Z-- moved from EditForm if Registry.OpenKey('Software\' + APP_NAME + '\Forms\Editor', False) then begin -{ if Registry.ValueExists('UseTransformColors') then - begin - UseTransformColors := Registry.ReadBool('UseTransformColors'); - end + if Registry.ValueExists('UseTransformColors') then + UseTransformColors := Registry.ReadBool('UseTransformColors') else - begin UseTransformColors := False; - end; - if Registry.ValueExists('UseFlameBackground') then - begin - UseFlameBackground := Registry.ReadBool('UseFlameBackground'); - end + if Registry.ValueExists('HelpersEnabled') then + HelpersEnabled := Registry.ReadBool('HelpersEnabled') else - begin - UseFlameBackground := False; - end; -} + HelpersEnabled := true; + if Registry.ValueExists('BackgroundColor') then EditorBkgColor := Registry.ReadInteger('BackgroundColor') else @@ -696,6 +683,8 @@ begin else DoubleClickSetVars := true; end else begin + UseTransformColors := false; + HelpersEnabled := true; EditorBkgColor := $000000; GridColor1 := $444444; GridColor2 := $333333; @@ -997,6 +986,7 @@ begin Registry.WriteString('RenderCompleteSoundFile', RenderCompleteSoundFile); Registry.WriteBool('ConfirmDelete', ConfirmDelete); + Registry.WriteBool('OldPaletteFormat', OldPaletteFormat); Registry.WriteInteger('NumTries', NumTries); Registry.WriteInteger('TryLength', TryLength); Registry.WriteInteger('MinTransforms', randMinTransforms); @@ -1068,15 +1058,12 @@ begin Registry.WriteInteger('NrTreads', NrTreads); Registry.WriteInteger('UseNrThreads', UseNrThreads); Registry.WriteInteger('InternalBitsPerSample', InternalBitsPerSample); - - Registry.WriteInteger('PreviewTimeLimit', PreviewTimeLimit); - Registry.WriteInteger('FullscreenTimeLimit', FullscreenTimeLimit); - Registry.WriteFloat('PreviewMinDensity', PreviewMinDensity); end; { Editor } if Registry.OpenKey('\Software\' + APP_NAME + '\Forms\Editor', True) then begin Registry.WriteBool('UseTransformColors', UseTransformColors); + Registry.WriteBool('HelpersEnabled', HelpersEnabled); Registry.WriteInteger('BackgroundColor', EditorBkgColor); Registry.WriteInteger('GridColor1', GridColor1); Registry.WriteInteger('GridColor2', GridColor2);