hksonngan / mandelbulber

Automatically exported from code.google.com/p/mandelbulber
GNU General Public License v3.0
0 stars 0 forks source link

Proposed patch: make it possible to override settings on the commandline #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As discussed on fractalforms (e.g., 
http://www.fractalforums.com/mandelbulber/additional-command-line-options-wanted
-%29/ ), it would be nice to override settings from the .fract file on the 
commandline.

This series of patches implements that.  The patch is relative to r130.  
Because it is cumulative with my patch for issue 11, the line number 
information may be a little different than in r130.

Patch 1/6 begins by using glib functions for parsing and formatting numbers 
that always do so according to the rules of the "C" locale, rather than the 
existing code which tries to swap commas and periods at the right times.  This 
is necessary for the later patches, because a subsequent commit breaks up 
LoadSettings in such a way that the right value of locale_dot is not available.

Patch 2/6 refactors LoadSettings into three functions, LoadSettings, 
LoadOneSetting and LoadSettingsPost.

Patch 3/6 adds parsing of "-o key=value" commandline parameters, which can be 
used whenever a parameter file is specified on the commandline.

Patch 4/6 makes these parameters actually do something.  I tested that -o 
image_width=4000 -o image_height=3000 actually rendered the image at the 
desired resolution.

Patch 5/6 gets rid of locale_dot because it's no longer needed. (the 
locale_test configuration file item could be dropped, but this patch doesn't do 
that; continuing to write it will give better backwards-compatibility)

Patch 6/6 adds logic so that the commandline value can be specified in the 
user's locale, so that a user in the de_DE.UTF-8 (German) locale can specify 
'mandelbulber -o gamma=1,7'.

Original issue reported on code.google.com by jep...@gmail.com on 9 May 2011 at 3:59

Attachments:

GoogleCodeExporter commented 8 years ago
The original patch had a bug that prevented saving any working file.  Please 
apply the updated version instead.

Original comment by jep...@gmail.com on 9 May 2011 at 9:21

Attachments:

GoogleCodeExporter commented 8 years ago
Committed as r132..r138

Compared to the earlier patch, -res WWWxHHH and -fpk NNN were added to make it 
easy to override these specific settings.

Original comment by jep...@unpythonic.net on 10 May 2011 at 3:00