diff --git a/2.10/Source/FormRender.dfm b/2.10/Source/FormRender.dfm index 0a83df3..9fe4734 100644 --- a/2.10/Source/FormRender.dfm +++ b/2.10/Source/FormRender.dfm @@ -49,13 +49,6 @@ object RenderForm: TRenderForm OnShow = FormShow PixelsPerInch = 96 TextHeight = 13 - object Label6: TLabel - Left = 204 - Top = 340 - Width = 118 - Height = 13 - Caption = 'TestValue Nr Of Threads' - end object ProgressBar: TProgressBar Left = 0 Top = 392 @@ -469,16 +462,6 @@ object RenderForm: TRenderForm Caption = 'Post render' TabOrder = 9 end - object edtNrThreads: TEdit - Left = 336 - Top = 336 - Width = 73 - Height = 21 - BiDiMode = bdRightToLeft - ParentBiDiMode = False - TabOrder = 13 - Text = '1' - end object SaveDialog: TSaveDialog Left = 368 Top = 256 diff --git a/2.10/Source/FormRender.pas b/2.10/Source/FormRender.pas index 3db5fe2..ac39de3 100644 --- a/2.10/Source/FormRender.pas +++ b/2.10/Source/FormRender.pas @@ -66,8 +66,6 @@ type StatusBar: TStatusBar; chkShutdown: TCheckBox; cbPostProcess: TCheckBox; - edtNrThreads: TEdit; - Label6: TLabel; txtDensity: TComboBox; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -339,7 +337,7 @@ begin Renderer.Compatibility := compatibility; Renderer.SetCP(cp); Renderer.Priority := tpLower; - Renderer.NrThreads := StrToInt(edtNrThreads.text); + Renderer.NrThreads := NrTreads; Renderer.Resume; // enable screensaver diff --git a/2.10/Source/Global.pas b/2.10/Source/Global.pas index d7abc92..7b71ca4 100644 --- a/2.10/Source/Global.pas +++ b/2.10/Source/Global.pas @@ -127,7 +127,10 @@ var defLibrary: string; LimitVibrancy: Boolean; DefaultPalette: TColorMap; - + PNGTransparency: integer; + ShowTransparency: boolean; + NrTreads: Integer; + UseNrThreads: integer; function Round6(x: double): double; diff --git a/2.10/Source/ImageMaker.pas b/2.10/Source/ImageMaker.pas index c02b4fa..d39db13 100644 --- a/2.10/Source/ImageMaker.pas +++ b/2.10/Source/ImageMaker.pas @@ -146,8 +146,10 @@ end; /////////////////////////////////////////////////////////////////////////////// function TImageMaker.GetImage: TBitmap; begin -// Result := GetTransparentImage; - Result := FBitmap; + if ShowTransparency then + Result := GetTransparentImage + else + Result := FBitmap; end; /////////////////////////////////////////////////////////////////////////////// @@ -193,8 +195,14 @@ end; /////////////////////////////////////////////////////////////////////////////// procedure TImageMaker.CreateImage(YOffset: integer); begin - CreateImage_Flame3(YOffset); -// CreateImage_MB(YOffset); + Case PNGTransparency of + 0,1: + CreateImage_Flame3(YOffset); + 2: + CreateImage_MB(YOffset); + else + Exception.CreateFmt('Unexpected value of PNGTransparency [%d]', [PNGTransparency]); + end; end; /////////////////////////////////////////////////////////////////////////////// @@ -586,13 +594,22 @@ begin if UpperCase(ExtractFileExt(FileName)) = '.PNG' then begin PngObject := TPngObject.Create; PngObject.Assign(FBitmap); - PngObject.CreateAlpha; - for i:= 0 to FAlphaBitmap.Height - 1 do begin - rowbm := PByteArray(FAlphaBitmap.scanline[i]); - rowpng := PByteArray(PngObject.AlphaScanline[i]); - for row := 0 to FAlphaBitmap.Width -1 do begin - rowpng[row] := rowbm[row]; + Case PNGTransparency of + 0: + ; // do nothing + 1,2: + begin + PngObject.CreateAlpha; + for i:= 0 to FAlphaBitmap.Height - 1 do begin + rowbm := PByteArray(FAlphaBitmap.scanline[i]); + rowpng := PByteArray(PngObject.AlphaScanline[i]); + for row := 0 to FAlphaBitmap.Width -1 do begin + rowpng[row] := rowbm[row]; + end; + end; end; + else + Exception.CreateFmt('Unexpected value of PNGTransparency [%d]', [PNGTransparency]); end; PngObject.SaveToFile(FileName); diff --git a/2.10/Source/Options.dfm b/2.10/Source/Options.dfm index b9eb493..1556970 100644 --- a/2.10/Source/Options.dfm +++ b/2.10/Source/Options.dfm @@ -161,6 +161,68 @@ object OptionsForm: TOptionsForm Caption = 'Resize on load' TabOrder = 5 end + object GroupBox15: TGroupBox + Left = 8 + Top = 134 + Width = 129 + Height = 83 + Caption = 'PNG Transparency' + TabOrder = 6 + object RadioButton1: TRadioButton + Left = 12 + Top = 16 + Width = 113 + Height = 17 + Caption = 'No transparency' + TabOrder = 0 + end + object RadioButton2: TRadioButton + Left = 12 + Top = 32 + Width = 113 + Height = 17 + Caption = 'Like Flame3' + TabOrder = 1 + end + object RadioButton3: TRadioButton + Left = 12 + Top = 48 + Width = 113 + Height = 17 + Caption = 'Like Flamesong' + TabOrder = 2 + end + end + object GroupBox16: TGroupBox + Left = 140 + Top = 134 + Width = 117 + Height = 51 + Caption = 'Nr processors' + TabOrder = 7 + object cbNrTheads: TComboBox + Left = 12 + Top = 20 + Width = 89 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + Text = '200' + Items.Strings = ( + 'Off' + '2' + '4' + '8') + end + end + object cbShowTransparancy: TCheckBox + Left = 144 + Top = 196 + Width = 169 + Height = 17 + Caption = 'Show Transparancy' + TabOrder = 8 + end end object DisplayPage: TTabSheet Caption = 'Display' @@ -553,10 +615,11 @@ object OptionsForm: TOptionsForm object clbVarEnabled: TCheckListBox Left = 12 Top = 16 - Width = 205 + Width = 309 Height = 189 ItemHeight = 13 TabOrder = 0 + TabWidth = 100 end end object btnSetAll: TButton diff --git a/2.10/Source/Options.pas b/2.10/Source/Options.pas index 42b30ce..3f6120a 100644 --- a/2.10/Source/Options.pas +++ b/2.10/Source/Options.pas @@ -174,6 +174,13 @@ type Label37: TLabel; txtLibrary: TEdit; clbVarEnabled: TCheckListBox; + GroupBox15: TGroupBox; + RadioButton1: TRadioButton; + RadioButton2: TRadioButton; + RadioButton3: TRadioButton; + GroupBox16: TGroupBox; + cbNrTheads: TComboBox; + cbShowTransparancy: TCheckBox; procedure btnCancelClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure btnOKClick(Sender: TObject); @@ -250,6 +257,17 @@ begin chkFixedReference.Checked := FixedReference; udBatchSize.Position := BatchSize; chkResize.checked := ResizeOnLoad; + case PNGTransparency of + 0: RadioButton1.Checked := True; + 1: RadioButton2.Checked := True; + 2: RadioButton3.Checked := True; + else + end; + if NrTreads <= 1 then + cbNrTheads.ItemIndex := 0 + else + cbNrTheads.text := intTostr(NrTreads); + cbShowTransparancy.Checked := ShowTransparency; { Display tab } txtSampleDensity.Text := FloatToStr(defSampleDensity); @@ -345,6 +363,16 @@ begin if BatchSize < 1 then BatchSize := 1; if BatchSize > 300 then BatchSize := 300; + if RadioButton1.Checked then + PNGTransparency := 0 + else if RadioButton2.Checked then + PNGTransparency := 1 + else if RadioButton3.Checked then + PNGTransparency := 2; + + ShowTransparency := cbShowTransparancy.Checked; + + NrTreads := StrToIntDef(cbNrTheads.text, 0); ConfirmDelete := chkConfirmDel.Checked; FixedReference := chkFixedReference.Checked; ResizeOnLoad := chkResize.checked; diff --git a/2.10/Source/Regstry.pas b/2.10/Source/Regstry.pas index bb14e90..98cd999 100644 --- a/2.10/Source/Regstry.pas +++ b/2.10/Source/Regstry.pas @@ -480,11 +480,29 @@ begin if Registry.ValueExists('ShowProgress') then begin ShowProgress := Registry.ReadBool('ShowProgress'); - end - else - begin + end else begin ShowProgress := true; end; + if Registry.ValueExists('PNGTransparency') then begin + PNGTransparency := Registry.ReadInteger('PNGTransparency'); + end else begin + PNGTransparency := 2 + end; + if Registry.ValueExists('ShowTransparency') then begin + ShowTransparency := Registry.ReadBool('ShowTransparency'); + end else begin + ShowTransparency := False; + end; + if Registry.ValueExists('NrTreads') then begin + NrTreads := Registry.ReadInteger('NrTreads'); + end else begin + NrTreads := 1; + end; + if Registry.ValueExists('UseNrThreads') then begin + UseNrThreads := Registry.ReadInteger('UseNrThreads'); + end else begin + UseNrThreads := 1; + end; end else begin @@ -542,6 +560,10 @@ begin SheepServer := 'http://v2d5.sheepserver.net/'; ResizeOnLoad := False; ShowProgress := true; + PNGTransparency := 2; + ShowTransparency := False; + NrTreads := 1; + UseNrThreads := 1; end; Registry.CloseKey; { Render } @@ -876,6 +898,11 @@ begin Registry.WriteBool('ShowProgress', ShowProgress); Registry.WriteBool('KeepBackground', KeepBackground); Registry.WriteString('FunctionLibrary', defLibrary); + + Registry.WriteBool('ShowTransparency', ShowTransparency); + Registry.WriteInteger('PNGTransparency', PNGTransparency); + Registry.WriteInteger('NrTreads', NrTreads); + Registry.WriteInteger('UseNrThreads', UseNrThreads); end; { Display } if Registry.OpenKey('\Software\' + APP_NAME + '\Display', True) then