2005-03-25 03:35:39 -05:00
|
|
|
{
|
|
|
|
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
2006-04-05 07:10:39 -04:00
|
|
|
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
2005-03-25 03:35:39 -05:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
}
|
2005-04-02 05:53:22 -05:00
|
|
|
//{$D-,L-,O+,Q-,R-,Y-,S-}
|
2005-03-25 03:35:39 -05:00
|
|
|
unit Options;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
2006-04-05 07:10:39 -04:00
|
|
|
StdCtrls, ComCtrls, ExtCtrls, Buttons, Registry, Mask, CheckLst,
|
|
|
|
MMSystem;
|
2005-03-25 03:35:39 -05:00
|
|
|
|
|
|
|
type
|
|
|
|
TOptionsForm = class(TForm)
|
|
|
|
btnOK: TButton;
|
|
|
|
btnCancel: TButton;
|
|
|
|
OpenDialog: TOpenDialog;
|
|
|
|
Tabs: TPageControl;
|
|
|
|
GeneralPage: TTabSheet;
|
|
|
|
chkConfirmDel: TCheckBox;
|
|
|
|
JPEG: TGroupBox;
|
|
|
|
DisplayPage: TTabSheet;
|
|
|
|
GroupBox2: TGroupBox;
|
|
|
|
Label4: TLabel;
|
|
|
|
Label1: TLabel;
|
|
|
|
Label30: TLabel;
|
|
|
|
txtLowQuality: TEdit;
|
|
|
|
txtMediumQuality: TEdit;
|
|
|
|
txtHighQuality: TEdit;
|
|
|
|
grpRendering: TGroupBox;
|
|
|
|
lblSampleDensity: TLabel;
|
|
|
|
lblGamma: TLabel;
|
|
|
|
lblBrightness: TLabel;
|
|
|
|
lblVibrancy: TLabel;
|
|
|
|
lblOversample: TLabel;
|
|
|
|
lblFilterRadius: TLabel;
|
|
|
|
txtSampleDensity: TEdit;
|
|
|
|
txtGamma: TEdit;
|
|
|
|
txtBrightness: TEdit;
|
|
|
|
txtVibrancy: TEdit;
|
|
|
|
txtOversample: TEdit;
|
|
|
|
txtFilterRadius: TEdit;
|
|
|
|
RandomPage: TTabSheet;
|
|
|
|
gpNumberOfTransforms: TGroupBox;
|
|
|
|
Label28: TLabel;
|
|
|
|
Label29: TLabel;
|
|
|
|
txtMinXForms: TEdit;
|
|
|
|
txtMaxXforms: TEdit;
|
|
|
|
chkKeepBackground: TCheckBox;
|
|
|
|
TabSheet6: TTabSheet;
|
|
|
|
UPRPage: TPageControl;
|
|
|
|
GroupBox11: TGroupBox;
|
|
|
|
Label26: TLabel;
|
|
|
|
Label27: TLabel;
|
|
|
|
txtUPRWidth: TEdit;
|
|
|
|
txtUPRHeight: TEdit;
|
|
|
|
gpFlameTitlePrefix: TGroupBox;
|
|
|
|
txtRandomPrefix: TEdit;
|
|
|
|
gpMutationTransforms: TGroupBox;
|
|
|
|
Label2: TLabel;
|
|
|
|
Label3: TLabel;
|
|
|
|
txtMinMutate: TEdit;
|
|
|
|
txtMaxMutate: TEdit;
|
|
|
|
gpForcedSymmetry: TGroupBox;
|
|
|
|
cmbSymType: TComboBox;
|
|
|
|
txtSymOrder: TEdit;
|
|
|
|
Label7: TLabel;
|
|
|
|
Label9: TLabel;
|
|
|
|
VariationsPage: TTabSheet;
|
|
|
|
GroupBox17: TGroupBox;
|
|
|
|
btnSetAll: TButton;
|
|
|
|
btnClearAll: TButton;
|
|
|
|
TabSheet1: TTabSheet;
|
|
|
|
grpGradient: TRadioGroup;
|
|
|
|
GroupBox3: TGroupBox;
|
|
|
|
txtMinNodes: TEdit;
|
|
|
|
txtMaxNodes: TEdit;
|
|
|
|
Label18: TLabel;
|
|
|
|
Label19: TLabel;
|
|
|
|
txtMinHue: TEdit;
|
|
|
|
txtMaxHue: TEdit;
|
|
|
|
Label31: TLabel;
|
|
|
|
Label32: TLabel;
|
|
|
|
Label33: TLabel;
|
|
|
|
txtMinSat: TEdit;
|
|
|
|
Label34: TLabel;
|
|
|
|
txtMaxSat: TEdit;
|
|
|
|
Label35: TLabel;
|
|
|
|
txtMinLum: TEdit;
|
|
|
|
Label36: TLabel;
|
|
|
|
txtMaxLum: TEdit;
|
|
|
|
udMinNodes: TUpDown;
|
|
|
|
udMaxNodes: TUpDown;
|
|
|
|
udMinHue: TUpDown;
|
|
|
|
udMaxHue: TUpDown;
|
|
|
|
udMinSat: TUpDown;
|
|
|
|
udmaxSat: TUpDown;
|
|
|
|
udMinLum: TUpDown;
|
|
|
|
udMaxLum: TUpDown;
|
|
|
|
udMinXforms: TUpDown;
|
|
|
|
udMaxXForms: TUpDown;
|
|
|
|
udMinMutate: TUpDown;
|
|
|
|
udMaxMutate: TUpDown;
|
|
|
|
udSymOrder: TUpDown;
|
|
|
|
GroupBox9: TGroupBox;
|
|
|
|
Label20: TLabel;
|
|
|
|
Label21: TLabel;
|
|
|
|
Label22: TLabel;
|
|
|
|
txtFIterDensity: TEdit;
|
|
|
|
txtUPRFilterRadius: TEdit;
|
|
|
|
txtUPROversample: TEdit;
|
|
|
|
GroupBox4: TGroupBox;
|
|
|
|
Label11: TLabel;
|
|
|
|
Label12: TLabel;
|
|
|
|
txtFCIdent: TEdit;
|
|
|
|
txtFCFile: TEdit;
|
|
|
|
GroupBox5: TGroupBox;
|
|
|
|
Label13: TLabel;
|
|
|
|
Label14: TLabel;
|
|
|
|
txtFFIdent: TEdit;
|
|
|
|
txtFFFile: TEdit;
|
|
|
|
chkAdjustDensity: TCheckBox;
|
|
|
|
TabSheet2: TTabSheet;
|
|
|
|
GroupBox6: TGroupBox;
|
|
|
|
Label5: TLabel;
|
|
|
|
Label6: TLabel;
|
|
|
|
txtNick: TEdit;
|
|
|
|
txtURL: TEdit;
|
|
|
|
Label15: TLabel;
|
|
|
|
txtPassword: TEdit;
|
|
|
|
GroupBox8: TGroupBox;
|
|
|
|
Label17: TLabel;
|
|
|
|
txtServer: TEdit;
|
|
|
|
chkResize: TCheckBox;
|
2005-12-30 08:04:49 -05:00
|
|
|
PathsPage: TTabSheet;
|
2005-03-25 03:35:39 -05:00
|
|
|
GroupBox10: TGroupBox;
|
|
|
|
btnDefGradient: TSpeedButton;
|
|
|
|
Label25: TLabel;
|
|
|
|
txtDefParameterFile: TEdit;
|
|
|
|
GroupBox12: TGroupBox;
|
|
|
|
Label23: TLabel;
|
|
|
|
txtDefSmoothFile: TEdit;
|
|
|
|
btnSmooth: TSpeedButton;
|
|
|
|
GroupBox7: TGroupBox;
|
|
|
|
btnRenderer: TSpeedButton;
|
|
|
|
Label16: TLabel;
|
|
|
|
txtRenderer: TEdit;
|
|
|
|
GroupBox14: TGroupBox;
|
|
|
|
SpeedButton2: TSpeedButton;
|
|
|
|
Label37: TLabel;
|
|
|
|
txtLibrary: TEdit;
|
|
|
|
clbVarEnabled: TCheckListBox;
|
2005-09-19 13:55:12 -04:00
|
|
|
GroupBox16: TGroupBox;
|
|
|
|
cbNrTheads: TComboBox;
|
2005-09-29 10:11:29 -04:00
|
|
|
GroupBox13: TGroupBox;
|
|
|
|
Label8: TLabel;
|
|
|
|
Label10: TLabel;
|
|
|
|
txtNumtries: TEdit;
|
|
|
|
txtTryLength: TEdit;
|
|
|
|
txtJPEGquality: TComboBox;
|
2005-10-09 09:28:00 -04:00
|
|
|
Label24: TLabel;
|
|
|
|
txtSymNVars: TEdit;
|
|
|
|
udSymNVars: TUpDown;
|
2005-10-29 14:16:33 -04:00
|
|
|
rgRotationMode: TRadioGroup;
|
|
|
|
txtBatchSize: TEdit;
|
|
|
|
udBatchSize: TUpDown;
|
|
|
|
Label38: TLabel;
|
|
|
|
Label39: TLabel;
|
2005-12-30 08:04:49 -05:00
|
|
|
chkShowTransparency: TCheckBox;
|
|
|
|
rgTransparency: TRadioGroup;
|
2006-04-05 07:10:39 -04:00
|
|
|
GroupBox15: TGroupBox;
|
|
|
|
btnBrowseSound: TSpeedButton;
|
|
|
|
txtSoundFile: TEdit;
|
|
|
|
EditorPage: TTabSheet;
|
2005-12-30 08:04:49 -05:00
|
|
|
GroupBox1: TGroupBox;
|
|
|
|
Label40: TLabel;
|
|
|
|
Label41: TLabel;
|
|
|
|
Label42: TLabel;
|
|
|
|
Label43: TLabel;
|
|
|
|
pnlBackColor: TPanel;
|
|
|
|
chkUseXFormColor: TCheckBox;
|
|
|
|
chkHelpers: TCheckBox;
|
|
|
|
pnlReference: TPanel;
|
|
|
|
pnlGridColor1: TPanel;
|
|
|
|
pnlGridColor2: TPanel;
|
|
|
|
pnlHelpersColor: TPanel;
|
2006-04-05 07:10:39 -04:00
|
|
|
rgReferenceMode: TRadioGroup;
|
2006-04-15 11:50:26 -04:00
|
|
|
chkExtendedEdit: TCheckBox;
|
2006-04-05 07:10:39 -04:00
|
|
|
chkPlaysound: TCheckBox;
|
|
|
|
btnPlay: TSpeedButton;
|
|
|
|
Label44: TLabel;
|
2006-04-15 11:50:26 -04:00
|
|
|
chkAxisLock: TCheckBox;
|
2005-03-25 03:35:39 -05:00
|
|
|
procedure btnCancelClick(Sender: TObject);
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
procedure btnOKClick(Sender: TObject);
|
|
|
|
procedure btnDefGradientClick(Sender: TObject);
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
procedure btnSmoothClick(Sender: TObject);
|
|
|
|
procedure cmbSymTypeChange(Sender: TObject);
|
|
|
|
procedure btnSetAllClick(Sender: TObject);
|
|
|
|
procedure btnClearAllClick(Sender: TObject);
|
|
|
|
procedure txtMinNodesChange(Sender: TObject);
|
|
|
|
procedure txtMaxNodesChange(Sender: TObject);
|
|
|
|
procedure txtMaxHueChange(Sender: TObject);
|
|
|
|
procedure txtMaxSatChange(Sender: TObject);
|
|
|
|
procedure txtMaxLumChange(Sender: TObject);
|
|
|
|
procedure txtMinHueChange(Sender: TObject);
|
|
|
|
procedure txtMinSatChange(Sender: TObject);
|
|
|
|
procedure txtMinLumChange(Sender: TObject);
|
|
|
|
procedure txtMinXFormsChange(Sender: TObject);
|
|
|
|
procedure txtMaxXformsChange(Sender: TObject);
|
|
|
|
procedure txtMinMutateChange(Sender: TObject);
|
|
|
|
procedure txtMaxMutateChange(Sender: TObject);
|
|
|
|
procedure btnRendererClick(Sender: TObject);
|
|
|
|
procedure SpeedButton2Click(Sender: TObject);
|
|
|
|
procedure FormCreate(Sender: TObject);
|
2005-12-30 08:04:49 -05:00
|
|
|
procedure pnlBackColorClick(Sender: TObject);
|
|
|
|
procedure pnlReferenceClick(Sender: TObject);
|
|
|
|
procedure pnlGridColor1Click(Sender: TObject);
|
|
|
|
procedure pnlGridColor2Click(Sender: TObject);
|
|
|
|
procedure pnlHelpersColorClick(Sender: TObject);
|
2006-04-05 07:10:39 -04:00
|
|
|
procedure btnBrowseSoundClick(Sender: TObject);
|
|
|
|
procedure btnPlayClick(Sender: TObject);
|
2005-03-25 03:35:39 -05:00
|
|
|
private
|
|
|
|
{ Private declarations }
|
|
|
|
public
|
|
|
|
{ Public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
OptionsForm: TOptionsForm;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.DFM}
|
|
|
|
|
2005-09-11 06:30:54 -04:00
|
|
|
uses
|
2005-12-30 08:04:49 -05:00
|
|
|
Main, Global, Editor, ControlPoint, XFormMan, Adjust;
|
2005-09-11 06:30:54 -04:00
|
|
|
|
2005-03-25 03:35:39 -05:00
|
|
|
procedure TOptionsForm.btnCancelClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.FormShow(Sender: TObject);
|
|
|
|
var
|
|
|
|
Registry: TRegistry;
|
|
|
|
i: integer;
|
|
|
|
begin
|
2005-10-29 14:16:33 -04:00
|
|
|
{ Read position from registry }
|
2005-03-25 03:35:39 -05:00
|
|
|
Registry := TRegistry.Create;
|
|
|
|
try
|
|
|
|
Registry.RootKey := HKEY_CURRENT_USER;
|
|
|
|
if Registry.OpenKey('Software\' + APP_NAME + '\Forms\Options', False) then
|
|
|
|
begin
|
|
|
|
if Registry.ValueExists('Left') then
|
|
|
|
OptionsForm.Left := Registry.ReadInteger('Left');
|
|
|
|
if Registry.ValueExists('Top') then
|
|
|
|
OptionsForm.Top := Registry.ReadInteger('Top');
|
|
|
|
end;
|
|
|
|
Registry.CloseKey;
|
|
|
|
finally
|
|
|
|
Registry.Free;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ General tab }
|
|
|
|
txtDefParameterFile.Text := DefFlameFile;
|
|
|
|
txtDefSmoothFile.Text := defSmoothPaletteFile;
|
|
|
|
txtNumtries.text := IntToStr(Numtries);
|
|
|
|
txtTryLength.text := IntToStr(Trylength);
|
|
|
|
chkConfirmDel.Checked := ConfirmDelete;
|
|
|
|
txtJPEGQuality.text := IntToStr(JPEGQuality);
|
2005-10-29 14:16:33 -04:00
|
|
|
rgReferenceMode.ItemIndex := ReferenceMode;
|
|
|
|
rgRotationMode.ItemIndex := MainForm_RotationMode;
|
2005-03-25 03:35:39 -05:00
|
|
|
udBatchSize.Position := BatchSize;
|
|
|
|
chkResize.checked := ResizeOnLoad;
|
2005-09-29 10:11:29 -04:00
|
|
|
rgTransparency.ItemIndex := PNGTransparency;
|
|
|
|
chkShowTransparency.Checked := ShowTransparency;
|
2005-09-19 13:55:12 -04:00
|
|
|
if NrTreads <= 1 then
|
|
|
|
cbNrTheads.ItemIndex := 0
|
|
|
|
else
|
|
|
|
cbNrTheads.text := intTostr(NrTreads);
|
2006-04-15 11:50:26 -04:00
|
|
|
chkExtendedEdit.Checked := ExtEditEnabled;
|
|
|
|
chkAxisLock.Checked := TransformAxisLock;
|
2006-04-05 07:10:39 -04:00
|
|
|
|
|
|
|
chkPlaySound.Checked := PlaySoundOnRenderComplete;
|
|
|
|
txtSoundFile.Text := RenderCompleteSoundFile;
|
2005-03-25 03:35:39 -05:00
|
|
|
|
|
|
|
{ Display tab }
|
|
|
|
txtSampleDensity.Text := FloatToStr(defSampleDensity);
|
|
|
|
txtGamma.Text := FloatToStr(defGamma);
|
|
|
|
txtBrightness.Text := FloatToStr(defBrightness);
|
|
|
|
txtVibrancy.Text := FloatToStr(defVibrancy);
|
|
|
|
txtOversample.Text := IntToStr(defOversample);
|
|
|
|
txtFilterRadius.Text := FloatToStr(defFilterRadius);
|
|
|
|
txtLowQuality.Text := FloatToStr(prevLowQuality);
|
|
|
|
txtMediumQuality.Text := FloatToStr(prevMediumQuality);
|
|
|
|
txtHighQuality.Text := FloatToStr(prevHighQuality);
|
|
|
|
|
2005-12-30 08:04:49 -05:00
|
|
|
pnlBackColor.Color := TColor(EditorBkgColor);
|
|
|
|
pnlGridColor1.Color := GridColor1;
|
|
|
|
pnlGridColor2.Color := GridColor2;
|
|
|
|
pnlReference.color := TColor(ReferenceTriangleColor);
|
|
|
|
|
2005-03-25 03:35:39 -05:00
|
|
|
{ Random tab }
|
|
|
|
udMinXforms.Position := randMinTransforms;
|
|
|
|
udMaxXforms.Position := randMaxTransforms;
|
|
|
|
udMinMutate.Position := mutantMinTransforms;
|
|
|
|
udMaxMutate.Position := mutantMaxTransforms;
|
|
|
|
txtRandomPrefix.text := RandomPrefix;
|
|
|
|
chkKeepbackground.Checked := KeepBackground;
|
|
|
|
cmbSymType.ItemIndex := SymmetryType;
|
2005-10-09 09:28:00 -04:00
|
|
|
if (SymmetryType = 0) or (SymmetryType = 1) then
|
|
|
|
begin
|
|
|
|
txtSymOrder.enabled := false;
|
|
|
|
txtSymNVars.enabled := false;
|
|
|
|
end;
|
2005-03-25 03:35:39 -05:00
|
|
|
udSymOrder.Position := SymmetryOrder;
|
2005-10-09 09:28:00 -04:00
|
|
|
udSymNVars.Position := SymmetryNVars;
|
2005-03-25 03:35:39 -05:00
|
|
|
|
|
|
|
{ Variations tab }
|
|
|
|
UnpackVariations(VariationOptions);
|
2005-09-11 06:30:54 -04:00
|
|
|
for i := 0 to NRVAR -1 do
|
2005-03-25 03:35:39 -05:00
|
|
|
clbVarEnabled.Checked[i] := Variations[i];
|
|
|
|
|
|
|
|
{ Gradient tab }
|
|
|
|
grpGradient.ItemIndex := randGradient;
|
|
|
|
udMinNodes.Position := MinNodes;
|
|
|
|
udMaxNodes.Position := MaxNodes;
|
|
|
|
udMinHue.Position := MinHue;
|
|
|
|
udMinSat.Position := MinSat;
|
|
|
|
udMinLum.Position := MinLum;
|
|
|
|
udMaxHue.Position := MaxHue;
|
|
|
|
udMaxSat.Position := MaxSat;
|
|
|
|
udMaxLum.Position := MaxLum;
|
|
|
|
|
|
|
|
{ UPR tab }
|
|
|
|
txtFIterDensity.text := IntToStr(UPRSampleDensity);
|
|
|
|
txtUPRFilterRadius.text := FloatToStr(UPRFilterRadius);
|
|
|
|
txtUPROversample.text := IntToStr(UPROversample);
|
|
|
|
txtFCIdent.text := UPRColoringIdent;
|
|
|
|
txtFCFile.text := UPRColoringFile;
|
|
|
|
txtFFIdent.text := UPRFormulaIdent;
|
|
|
|
txtFFFile.text := UPRFormulaFile;
|
|
|
|
txtUPRWidth.text := IntToStr(UPRWidth);
|
|
|
|
txtUPRHeight.text := IntToStr(UPRHeight);
|
|
|
|
chkAdjustDensity.checked := UPRAdjustDensity;
|
|
|
|
|
|
|
|
{ UPR tab }
|
|
|
|
txtNick.Text := SheepNick;
|
|
|
|
txtURL.Text := SheepURL;
|
|
|
|
txtPassword.Text := SheepPW;
|
|
|
|
txtRenderer.Text := HqiPath;
|
|
|
|
txtServer.Text := SheepServer;
|
|
|
|
|
|
|
|
txtLibrary.text := defLibrary;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnOKClick(Sender: TObject);
|
|
|
|
var
|
2006-03-22 11:45:46 -05:00
|
|
|
v: int64;
|
2005-03-25 03:35:39 -05:00
|
|
|
i: integer;
|
|
|
|
begin
|
|
|
|
|
|
|
|
{ Variations tab }
|
|
|
|
{ Get option values from controls. Disallow bad values }
|
2005-09-11 06:30:54 -04:00
|
|
|
for i := 0 to NRVAR -1 do
|
2005-03-25 03:35:39 -05:00
|
|
|
Variations[i] := clbVarEnabled.Checked[i];
|
|
|
|
|
|
|
|
v := PackVariations;
|
|
|
|
if v <> 0 then VariationOptions := v
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
Application.MessageBox('You must select at least one variation.', 'Apophysis', 48);
|
|
|
|
Tabs.ActivePage := VariationsPage;
|
|
|
|
Exit;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ General tab }
|
|
|
|
JPEGQuality := StrToInt(txtJPEGQuality.text);
|
|
|
|
Numtries := StrToInt(txtNumtries.text);
|
|
|
|
if NumTries < 1 then Numtries := 1;
|
|
|
|
Trylength := StrToInt(txtTrylength.text);
|
|
|
|
if Trylength < 100 then trylength := 100;
|
|
|
|
if JPEGQuality > 100 then JPEGQuality := 100;
|
|
|
|
if JPEGQuality < 1 then JPEGQuality := 100;
|
|
|
|
BatchSize := udBatchSize.Position;
|
|
|
|
if BatchSize < 1 then BatchSize := 1;
|
|
|
|
if BatchSize > 300 then BatchSize := 300;
|
|
|
|
|
2005-09-29 10:11:29 -04:00
|
|
|
PNGTransparency := rgTransparency.ItemIndex;
|
|
|
|
ShowTransparency := chkShowTransparency.Checked;
|
2005-09-19 13:55:12 -04:00
|
|
|
|
|
|
|
NrTreads := StrToIntDef(cbNrTheads.text, 0);
|
2005-03-25 03:35:39 -05:00
|
|
|
ConfirmDelete := chkConfirmDel.Checked;
|
2006-04-05 07:10:39 -04:00
|
|
|
|
2005-10-29 14:16:33 -04:00
|
|
|
MainForm_RotationMode := rgRotationMode.ItemIndex;
|
2005-03-25 03:35:39 -05:00
|
|
|
ResizeOnLoad := chkResize.checked;
|
2006-04-05 07:10:39 -04:00
|
|
|
|
|
|
|
// Editor
|
|
|
|
ReferenceMode := rgReferenceMode.ItemIndex;
|
2006-04-15 11:50:26 -04:00
|
|
|
ExtEditEnabled := chkExtendedEdit.Checked;
|
|
|
|
TransformAxisLock := chkAxisLock.Checked;
|
2006-04-05 07:10:39 -04:00
|
|
|
|
2005-03-25 03:35:39 -05:00
|
|
|
{ Display tab }
|
|
|
|
defSampleDensity := StrToFloat(txtSampleDensity.Text);
|
|
|
|
if defSampleDensity > 100 then defSampleDensity := 100;
|
|
|
|
if defSampleDensity <= 0 then defSampleDensity := 0.1;
|
|
|
|
defGamma := StrToFloat(txtGamma.Text);
|
|
|
|
if defGamma < 0.1 then defGamma := 0.1;
|
|
|
|
defBrightness := StrToFloat(txtBrightness.Text);
|
|
|
|
if defBrightness < 0.1 then defBrightness := 0.1;
|
|
|
|
defVibrancy := StrToFloat(txtVibrancy.Text);
|
|
|
|
if defVibrancy < 0 then defVibrancy := 0.1;
|
|
|
|
defFilterRadius := StrToFloat(txtFilterRadius.Text);
|
|
|
|
if defFilterRadius <= 0 then defFilterRadius := 0.1;
|
|
|
|
defOversample := StrToInt(txtOversample.Text);
|
|
|
|
if defOversample > 4 then defOversample := 4;
|
|
|
|
if defOversample < 1 then defOversample := 1;
|
|
|
|
prevLowQuality := StrToFloat(txtLowQuality.Text);
|
|
|
|
if prevLowQuality > 100 then prevLowQuality := 100;
|
|
|
|
if prevLowQuality < 0.01 then prevLowQuality := 0.01;
|
|
|
|
prevMediumQuality := StrToFloat(txtMediumQuality.Text);
|
|
|
|
if prevMediumQuality > 100 then prevMediumQuality := 100;
|
|
|
|
if prevMediumQuality < 0.01 then prevMediumQuality := 0.01;
|
|
|
|
prevHighQuality := StrToFloat(txtHighQuality.Text);
|
|
|
|
if prevHighQuality > 100 then prevHighQuality := 100;
|
|
|
|
if prevHighQuality < 0.01 then prevHighQuality := 0.01;
|
|
|
|
|
|
|
|
{ Random tab }
|
|
|
|
randMinTransforms := udMinXforms.Position;
|
|
|
|
randMaxTransforms := udMaxXforms.Position;
|
|
|
|
mutantMinTransforms := udMinMutate.Position;
|
|
|
|
mutantMaxTransforms := udMaxMutate.Position;
|
|
|
|
RandomPrefix := txtRandomPrefix.text;
|
|
|
|
SymmetryType := cmbSymType.ItemIndex;
|
|
|
|
SymmetryOrder := udSymOrder.Position;
|
2005-10-09 09:28:00 -04:00
|
|
|
SymmetryNVars := udSymNVars.Position;
|
2005-03-25 03:35:39 -05:00
|
|
|
KeepBackground := chkKeepbackground.Checked;
|
|
|
|
|
|
|
|
{Gradient tab }
|
|
|
|
randGradient := grpGradient.ItemIndex;
|
|
|
|
MinNodes := udMinNodes.Position;
|
|
|
|
MaxNodes := udMaxNodes.Position;
|
|
|
|
MinHue := udMinHue.Position;
|
|
|
|
MinSat := udMinSat.Position;
|
|
|
|
MinLum := udMinLum.Position;
|
|
|
|
MaxHue := udMaxHue.Position;
|
|
|
|
MaxSat := udMaxSat.Position;
|
|
|
|
MaxLum := udMaxLum.Position;
|
|
|
|
|
|
|
|
{ UPR options }
|
|
|
|
UPRSampleDensity := StrToInt(txtFIterDensity.text);
|
|
|
|
UPRFilterRadius := StrToFloat(txtUPRFilterRadius.text);
|
|
|
|
UPROversample := StrToInt(txtUPROversample.text);
|
|
|
|
UPRColoringIdent := txtFCIdent.text;
|
|
|
|
UPRColoringFile := txtFCFile.text;
|
|
|
|
UPRFormulaIdent := txtFFIdent.text;
|
|
|
|
UPRFormulaFile := txtFFFile.text;
|
|
|
|
UPRAdjustDensity := chkAdjustDensity.checked;
|
|
|
|
UPRWidth := StrToInt(txtUPRWidth.text);
|
|
|
|
UPRHeight := StrToInt(txtUPRHeight.text);
|
|
|
|
|
|
|
|
{ Sheep options }
|
|
|
|
SheepNick := txtNick.Text;
|
|
|
|
SheepURL := txtURL.Text;
|
|
|
|
SheepPW := txtPassword.text;
|
|
|
|
HqiPath := txtRenderer.text;
|
|
|
|
SheepServer := txtServer.text;
|
|
|
|
|
|
|
|
{Paths}
|
|
|
|
defLibrary := txtLibrary.text;
|
2006-04-05 07:10:39 -04:00
|
|
|
defFlameFile := txtDefParameterFile.Text;
|
|
|
|
defSmoothPaletteFile := txtDefSmoothFile.Text;
|
|
|
|
PlaySoundOnRenderComplete := chkPlaySound.Checked;
|
|
|
|
RenderCompleteSoundFile := txtSoundFile.Text;
|
2005-03-25 03:35:39 -05:00
|
|
|
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnDefGradientClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
OpenDialog.Filter := 'Flame files (*.flame)|*.flame|Apophysis 1.0 parameters (*.apo;*.fla)|*.apo;*.fla';
|
|
|
|
OpenDialog.FileName := '';
|
|
|
|
if OpenDialog.Execute then
|
|
|
|
begin
|
|
|
|
txtDefParameterFile.text := OpenDialog.FileName;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
var
|
|
|
|
Registry: TRegistry;
|
|
|
|
begin
|
|
|
|
{ Write position to registry }
|
|
|
|
Registry := TRegistry.Create;
|
|
|
|
try
|
|
|
|
Registry.RootKey := HKEY_CURRENT_USER;
|
|
|
|
if Registry.OpenKey('\Software\' + APP_NAME + '\Forms\Options', True) then
|
|
|
|
begin
|
|
|
|
Registry.WriteInteger('Top', OptionsForm.Top);
|
|
|
|
Registry.WriteInteger('Left', OptionsForm.Left);
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
Registry.Free;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnSmoothClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
OpenDialog.Filter := 'Gradient files (*.ugr)|*.ugr';
|
|
|
|
OpenDialog.InitialDir := ExtractFilePath(defSmoothPaletteFile);
|
|
|
|
OpenDialog.FileName := '';
|
|
|
|
OpenDialog.DefaultExt := 'ugr';
|
|
|
|
if OpenDialog.Execute then
|
|
|
|
begin
|
|
|
|
txtDefSmoothFile.text := OpenDialog.FileName;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.cmbSymTypeChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if (cmbSymType.ItemIndex = 0) or (cmbSymType.ItemIndex = 1) then
|
2005-10-09 09:28:00 -04:00
|
|
|
begin
|
|
|
|
txtSymOrder.enabled := false;
|
|
|
|
txtSymNVars.enabled := false;
|
|
|
|
end else
|
|
|
|
begin
|
2005-03-25 03:35:39 -05:00
|
|
|
txtSymOrder.enabled := true;
|
2005-10-09 09:28:00 -04:00
|
|
|
txtSymNVars.enabled := true;
|
|
|
|
end;
|
2005-03-25 03:35:39 -05:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnSetAllClick(Sender: TObject);
|
|
|
|
var
|
|
|
|
i: integer;
|
|
|
|
begin
|
2005-09-11 06:30:54 -04:00
|
|
|
for i := 0 to NRVAR - 1 do
|
2005-03-25 03:35:39 -05:00
|
|
|
clbVarEnabled.Checked[i] := True;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnClearAllClick(Sender: TObject);
|
|
|
|
var
|
|
|
|
i: integer;
|
|
|
|
begin
|
2005-09-11 06:30:54 -04:00
|
|
|
for i := 0 to NRVAR - 1 do
|
2005-03-25 03:35:39 -05:00
|
|
|
clbVarEnabled.Checked[i] := False;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinNodesChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinNodes.Text) > udMaxNodes.position then
|
|
|
|
udMaxNodes.Position := StrToInt(txtMinNodes.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxNodesChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxNodes.Text) < udMinNodes.position then
|
|
|
|
udMinNodes.Position := StrToInt(txtMaxNodes.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxHueChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxHue.Text) < udMinHue.position then
|
|
|
|
udMinHue.Position := StrToInt(txtMaxHue.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxSatChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxSat.Text) < udMinSat.position then
|
|
|
|
udMinSat.Position := StrToInt(txtMaxSat.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxLumChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxLum.Text) < udMinLum.position then
|
|
|
|
udMinLum.Position := StrToInt(txtMaxLum.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinHueChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinHue.Text) > udMaxHue.position then
|
|
|
|
udMaxHue.Position := StrToInt(txtMinHue.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinSatChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinSat.Text) > udMaxSat.position then
|
|
|
|
udMaxSat.Position := StrToInt(txtMinSat.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinLumChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinLum.Text) > udMaxLum.position then
|
|
|
|
udMaxLum.Position := StrToInt(txtMinLum.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinXFormsChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinXForms.Text) > udMaxXForms.position then
|
|
|
|
udMaxXFOrms.Position := StrToInt(txtMinXForms.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxXformsChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxXForms.Text) < udMinXForms.position then
|
|
|
|
udMinXForms.Position := StrToInt(txtMaxXforms.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMinMutateChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMinMutate.Text) > udMaxMutate.position then
|
|
|
|
udMaxMutate.Position := StrToInt(txtMinMutate.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.txtMaxMutateChange(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if StrToInt(txtMaxMutate.Text) < udMinMutate.position then
|
|
|
|
udMinMutate.Position := StrToInt(txtMaxMutate.Text);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnRendererClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
OpenDialog.Filter := 'Executables (*.exe)|*.exe';
|
|
|
|
OpenDialog.InitialDir := ExtractFilePath(HqiPath);
|
|
|
|
OpenDialog.FileName := '';
|
|
|
|
if OpenDialog.Execute then
|
|
|
|
begin
|
|
|
|
txtRenderer.text := OpenDialog.FileName;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.SpeedButton2Click(Sender: TObject);
|
|
|
|
begin
|
|
|
|
OpenDialog.Filter := 'Script files (*.asc)|*.asc';
|
|
|
|
OpenDialog.InitialDir := ExtractFilePath(defLibrary);
|
|
|
|
OpenDialog.FileName := '';
|
|
|
|
if OpenDialog.Execute then
|
|
|
|
begin
|
|
|
|
txtLibrary.text := OpenDialog.FileName;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.FormCreate(Sender: TObject);
|
|
|
|
var
|
|
|
|
i: integer;
|
|
|
|
begin
|
2005-09-11 06:30:54 -04:00
|
|
|
for i:= 0 to NRVAR - 1 do begin
|
|
|
|
clbVarEnabled.AddItem(varnames(i),nil);
|
2005-03-25 03:35:39 -05:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2005-12-30 08:04:49 -05:00
|
|
|
procedure TOptionsForm.pnlBackColorClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AdjustForm.ColorDialog.Color := pnlBackColor.Color;
|
|
|
|
if AdjustForm.ColorDialog.Execute then
|
|
|
|
begin
|
|
|
|
pnlBackColor.Color := AdjustForm.ColorDialog.Color;
|
|
|
|
EditorBkgColor := Integer(pnlBackColor.color);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.pnlReferenceClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AdjustForm.ColorDialog.Color := pnlReference.Color;
|
|
|
|
if AdjustForm.ColorDialog.Execute then
|
|
|
|
begin
|
|
|
|
pnlReference.Color := AdjustForm.ColorDialog.Color;
|
|
|
|
ReferenceTriangleColor := Integer(pnlReference.color);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.pnlGridColor1Click(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AdjustForm.ColorDialog.Color := pnlGridColor1.Color;
|
|
|
|
if AdjustForm.ColorDialog.Execute then
|
|
|
|
begin
|
|
|
|
pnlGridColor1.Color := AdjustForm.ColorDialog.Color;
|
|
|
|
GridColor1 := Integer(pnlGridColor1.color);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.pnlGridColor2Click(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AdjustForm.ColorDialog.Color := pnlGridColor2.Color;
|
|
|
|
if AdjustForm.ColorDialog.Execute then
|
|
|
|
begin
|
|
|
|
pnlGridColor2.Color := AdjustForm.ColorDialog.Color;
|
|
|
|
GridColor2 := Integer(pnlGridColor2.color);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.pnlHelpersColorClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AdjustForm.ColorDialog.Color := pnlHelpersColor.Color;
|
|
|
|
if AdjustForm.ColorDialog.Execute then
|
|
|
|
begin
|
|
|
|
pnlHelpersColor.Color := AdjustForm.ColorDialog.Color;
|
|
|
|
HelpersColor := Integer(pnlHelpersColor.color);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2006-04-05 07:10:39 -04:00
|
|
|
procedure TOptionsForm.btnBrowseSoundClick(Sender: TObject);
|
|
|
|
begin
|
2006-04-13 12:21:32 -04:00
|
|
|
OpenDialog.InitialDir := ExtractFilePath(RenderCompleteSoundFile);
|
|
|
|
OpenDialog.Filter := 'Waveform files (*.wav)|*.wav';
|
2006-04-05 07:10:39 -04:00
|
|
|
OpenDialog.FileName := '';
|
|
|
|
if OpenDialog.Execute then
|
|
|
|
begin
|
|
|
|
txtSoundFile.text := OpenDialog.FileName;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TOptionsForm.btnPlayClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if txtSoundFile.text <> '' then
|
2006-04-13 12:21:32 -04:00
|
|
|
sndPlaySound(PChar(txtSoundFile.text), SND_FILENAME or SND_ASYNC)
|
|
|
|
else
|
|
|
|
sndPlaySound(pchar(SND_ALIAS_SYSTEMASTERISK), SND_ALIAS_ID or SND_NOSTOP or SND_ASYNC);
|
2006-04-05 07:10:39 -04:00
|
|
|
end;
|
|
|
|
|
2005-03-25 03:35:39 -05:00
|
|
|
end.
|
|
|
|
|