Update of /cvsroot/apophysis/2.10/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21821/Source Modified Files: Adjust.dfm Adjust.pas Browser.dfm Browser.pas Global.pas Main.dfm Main.pas RndFlame.pas ScriptForm.pas Log Message: Store the cmapindex and use it to select the correct gradien in the adjust window Index: Adjust.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Adjust.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Adjust.pas 23 Sep 2005 11:22:49 -0000 1.6 --- Adjust.pas 25 Sep 2005 08:10:09 -0000 1.7 *************** *** 282,285 **** --- 282,286 ---- function PresetToStr(n: integer): string; + procedure UpdateGradient(Pal: TColorMap); // -- public *************** *** 292,296 **** procedure UpdateFlame; - procedure UpdateGradient(Pal: TColorMap); end; --- 293,296 ---- *************** *** 365,369 **** DrawPreview; ! Palette:=cp.cmap; DrawPalette; end; --- 365,374 ---- DrawPreview; ! // gradient ! if cp.cmapindex >= 0 then ! cmbPalette.ItemIndex := cp.cmapindex; ! ScrollBar.Position := 0; ! Palette := cp.cmap; ! BackupPal := cp.cmap; DrawPalette; end; Index: RndFlame.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/RndFlame.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RndFlame.pas 11 Sep 2005 10:30:54 -0000 1.6 --- RndFlame.pas 25 Sep 2005 08:10:09 -0000 1.7 *************** *** 39,43 **** cmap_index := Random(NRCMAPS); GetCMap(cmap_index, 1, DestCP.cmap); ! cmap_index := DestCP.cmapindex; DestCP.cmapIndex := cmap_index; end; --- 39,43 ---- cmap_index := Random(NRCMAPS); GetCMap(cmap_index, 1, DestCP.cmap); ! // cmap_index := DestCP.cmapindex; DestCP.cmapIndex := cmap_index; end; Index: Browser.dfm =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Browser.dfm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Browser.dfm 11 Sep 2005 07:09:54 -0000 1.3 --- Browser.dfm 25 Sep 2005 08:10:09 -0000 1.4 *************** *** 44,48 **** 000080030000800300008003000080070000800F0000801F0000803F0000} OldCreateOrder = False - Position = poDefaultPosOnly OnClose = FormClose OnCreate = FormCreate --- 44,47 ---- *************** *** 55,59 **** Top = 4 Width = 372 ! Height = 105 Align = alClient BevelOuter = bvNone --- 54,58 ---- Top = 4 Width = 372 ! Height = 99 Align = alClient BevelOuter = bvNone *************** *** 99,103 **** object pnlControls: TPanel Left = 0 ! Top = 109 Width = 372 Height = 51 --- 98,102 ---- object pnlControls: TPanel Left = 0 ! Top = 103 Width = 372 Height = 51 Index: Browser.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Browser.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Browser.pas 11 Sep 2005 07:09:54 -0000 1.3 --- Browser.pas 25 Sep 2005 08:10:09 -0000 1.4 *************** *** 471,478 **** MainForm.UpdateUndo; MainCp.cmap := Palette; - //gradientForm.UpdateGradient(Palette); - AdjustForm.UpdateGradient(Palette); if EditForm.Visible then EditForm.UpdateDisplay; ! // if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; MainForm.RedrawTimer.enabled := true; --- 471,476 ---- MainForm.UpdateUndo; MainCp.cmap := Palette; if EditForm.Visible then EditForm.UpdateDisplay; ! if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; MainForm.RedrawTimer.enabled := true; Index: Adjust.dfm =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Adjust.dfm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Adjust.dfm 23 Sep 2005 11:22:49 -0000 1.7 --- Adjust.dfm 25 Sep 2005 08:10:09 -0000 1.8 *************** *** 174,178 **** Width = 390 Height = 131 ! ActivePage = TabSheet2 Align = alBottom TabOrder = 1 --- 174,178 ---- Width = 390 Height = 131 ! ActivePage = TabSheet3 Align = alBottom TabOrder = 1 *************** *** 913,917 **** Width = 73 Height = 21 ! ItemHeight = 13 ItemIndex = 0 TabOrder = 7 --- 913,917 ---- Width = 73 Height = 21 ! ItemHeight = 0 ItemIndex = 0 TabOrder = 7 *************** *** 931,935 **** Width = 73 Height = 21 ! ItemHeight = 13 ItemIndex = 0 TabOrder = 8 --- 931,935 ---- Width = 73 Height = 21 ! ItemHeight = 0 ItemIndex = 0 TabOrder = 8 Index: ScriptForm.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/ScriptForm.pas,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ScriptForm.pas 11 Sep 2005 17:11:21 -0000 1.10 --- ScriptForm.pas 25 Sep 2005 08:10:09 -0000 1.11 *************** *** 2959,2966 **** MainForm.RedrawTimer.enabled := true; if EditForm.Visible then EditForm.UpdateDisplay; ! // if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; - // if GradientForm.Visible then GradientForm.UpdateGradient(cmap) - if AdjustForm.Visible then AdjustForm.UpdateGradient(cmap) end; --- 2959,2964 ---- MainForm.RedrawTimer.enabled := true; if EditForm.Visible then EditForm.UpdateDisplay; ! if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; end; Index: Main.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Main.pas,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Main.pas 21 Sep 2005 13:42:24 -0000 1.18 --- Main.pas 25 Sep 2005 08:10:09 -0000 1.19 *************** *** 1364,1372 **** y := cp1.center[1]; pal := ''; hue := ''; ! if sheep then ! begin pal := 'palette="' + IntToStr(cp1.cmapindex) + '" '; hue := 'hue="' + format('%g', [cp1.hue_rotation]) + '" '; ! end; if Trim(SheepNick) <> '' then nick := 'nick="' + Trim(SheepNick) + '"'; if Trim(SheepURL) <> '' then url := 'url="' + Trim(SheepURL) + '" '; --- 1364,1372 ---- y := cp1.center[1]; pal := ''; hue := ''; ! // if sheep then ! // begin pal := 'palette="' + IntToStr(cp1.cmapindex) + '" '; hue := 'hue="' + format('%g', [cp1.hue_rotation]) + '" '; ! // end; if Trim(SheepNick) <> '' then nick := 'nick="' + Trim(SheepNick) + '"'; if Trim(SheepURL) <> '' then url := 'url="' + Trim(SheepURL) + '" '; *************** *** 1387,1390 **** --- 1387,1391 ---- format('gamma="%g" ', [cp1.gamma]) + format('vibrancy="%g" ', [cp1.vibrancy]) + hue + url + nick + '>'); + { Write transform parameters } t := NumXForms(cp1); *************** *** 2335,2340 **** IntToStr(RandomIndex); Transforms := TrianglesFromCP(MainCp, MainTriangles); ! // if GradientForm.visible then GradientForm.UpdateGradient(Maincp.cmap); ! if AdjustForm.visible then AdjustForm.UpdateGradient(Maincp.cmap); StatusBar.Panels[2].text := maincp.name; --- 2336,2342 ---- IntToStr(RandomIndex); Transforms := TrianglesFromCP(MainCp, MainTriangles); ! ! if AdjustForm.visible then ! AdjustForm.UpdateDisplay; StatusBar.Panels[2].text := maincp.name; *************** *** 2978,2983 **** procedure TMainForm.UpdateWindows; begin ! if AdjustForm.visible then AdjustForm.UpdateGradient(maincp.cmap); ! // if GradientForm.visible then GradientForm.UpdateGradient(maincp.cmap); if EditForm.visible then EditForm.UpdateDisplay; --- 2980,2985 ---- procedure TMainForm.UpdateWindows; begin ! if AdjustForm.visible then ! AdjustForm.UpdateDisplay; if EditForm.visible then EditForm.UpdateDisplay; *************** *** 3053,3059 **** // Trim undo index from title maincp.name := Copy(Fstrings[0], 6, length(Fstrings[0]) - 7); ! if SavedPal then maincp.cmap := palette; ! // if GradientForm.visible then GradientForm.UpdateGradient(maincp.cmap); ! if AdjustForm.visible then AdjustForm.UpdateGradient(maincp.cmap); RedrawTimer.Enabled := True; UpdateWindows; --- 3055,3064 ---- // Trim undo index from title maincp.name := Copy(Fstrings[0], 6, length(Fstrings[0]) - 7); ! ! if SavedPal then ! maincp.cmap := palette; ! if AdjustForm.visible then ! AdjustForm.UpdateDisplay; ! RedrawTimer.Enabled := True; UpdateWindows; *************** *** 3122,3127 **** procedure TMainForm.mnuGradClick(Sender: TObject); begin - //gradientForm.UpdateGradient(maincp.cmap); - //GradientForm.Show; AdjustForm.UpdateDisplay; AdjustForm.PageControl.TabIndex:=2; --- 3127,3130 ---- *************** *** 3300,3304 **** UpdateUndo; maincp.cmap := Pal; ! AdjustForm.UpdateGradient(maincp.cmap); if EditForm.Visible then EditForm.UpdateDisplay; --- 3303,3307 ---- UpdateUndo; maincp.cmap := Pal; ! AdjustForm.UpdateDisplay; if EditForm.Visible then EditForm.UpdateDisplay; *************** *** 3721,3729 **** StopThread; nxform := 0; ParseCp.symmetry := 0; XMLScanner.LoadFromBuffer(params); XMLScanner.Execute; cp1.copy(ParseCp); ! if Parsecp.cmapindex <> -1 then begin if cp1.cmapindex < NRCMAPS then --- 3724,3733 ---- StopThread; nxform := 0; + Parsecp.cmapindex := -2; // generate pallet from cmapindex and hue (apo 1 and earlier) ParseCp.symmetry := 0; XMLScanner.LoadFromBuffer(params); XMLScanner.Execute; cp1.copy(ParseCp); ! if Parsecp.cmapindex = -2 then begin if cp1.cmapindex < NRCMAPS then *************** *** 3731,3742 **** else ShowMessage('Palette index too high'); ! end; ! if (cp1.hue_rotation > 0) and (cp1.hue_rotation < 1) then ! begin ! for i := 0 to 255 do ! begin ! RGBToHSV(cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2], h, s, v); ! h := Round(360 + h + (cp1.hue_rotation * 360)) mod 360; ! HSVToRGB(h, s, v, cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2]); end; end; --- 3735,3746 ---- else ShowMessage('Palette index too high'); ! ! if (cp1.hue_rotation > 0) and (cp1.hue_rotation < 1) then begin ! for i := 0 to 255 do ! begin ! RGBToHSV(cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2], h, s, v); ! h := Round(360 + h + (cp1.hue_rotation * 360)) mod 360; ! HSVToRGB(h, s, v, cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2]); ! end; end; end; *************** *** 4095,4098 **** --- 4099,4106 ---- i: integer; begin + // diable generating pallete + if Parsecp.cmapindex = -2 then + Parsecp.cmapindex := -1; + Assert(Count = 256,'only 256 color Colormaps are supported at the moment'); Assert((Count * 8) = Length(data),'Data size MisMatch'); *************** *** 4173,4176 **** --- 4181,4188 ---- if TagName = 'color' then begin + // diable generating pallete + if Parsecp.cmapindex = -2 then + Parsecp.cmapindex := -1; + i := StrToInt(Attributes.value('index')); v := Attributes.value('rgb'); Index: Main.dfm =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Main.dfm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Main.dfm 12 Sep 2005 12:59:59 -0000 1.16 --- Main.dfm 25 Sep 2005 08:10:09 -0000 1.17 *************** *** 28,32 **** Top = 28 Width = 4 ! Height = 480 end object ToolBar: TToolBar --- 28,32 ---- Top = 28 Width = 4 ! Height = 494 end object ToolBar: TToolBar *************** *** 284,288 **** Top = 28 Width = 160 ! Height = 480 Align = alLeft Columns = < --- 284,288 ---- Top = 28 Width = 160 ! Height = 494 Align = alLeft Columns = < *************** *** 303,307 **** Top = 28 Width = 433 ! Height = 480 Align = alClient BevelInner = bvLowered --- 303,307 ---- Top = 28 Width = 433 ! Height = 494 Align = alClient BevelInner = bvLowered *************** *** 327,331 **** object StatusBar: TStatusBar Left = 0 ! Top = 508 Width = 597 Height = 19 --- 327,331 ---- object StatusBar: TStatusBar Left = 0 ! Top = 522 Width = 597 Height = 19 Index: Global.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/Global.pas,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Global.pas 19 Sep 2005 17:55:11 -0000 1.7 --- Global.pas 25 Sep 2005 08:10:09 -0000 1.8 *************** *** 77,81 **** ImageFolder: string; UPRPath: string; // Name and folder of last UPR file - UpdateGradient: boolean; cmap_index: integer; // Index to current gradient Variation: TVariation; // Current variation --- 77,80 ---- |