/****************************************************************************
 * Welcome to Greenshift.  Copyright (c) 2001,2002 Jared Ivey
 *
 * This software is OSI Certified Open Source Software.
 * OSI Certified is a certification mark of the Open Source Initiative.
 *
 * Greenshift is open source, and free software, released under the GNU GPL.
 *
 * Source code and updates available at:
 * http://greenshift.net
 * http://www.prism.gatech.edu/~gte466i/
 *
 * jared@greenshift.net
 * gte466i@prism.gatech.edu
 * projectgreenshift@yahoo.com
 *
 ****************************************************************************/

GForcePath = "G-Force Files", /* specifies which subdirectory to look in for
                               * G-Force configs.  Greenshift is compatible
                               * with all G-Force configs, and I thought it
                               * would be wrong to distribute parts of
                               * G-Force along with Greenshift.  Get G-Force
                               * from http://www.55ware.com/
                               *
                               * More G-Force configs are available from:
                               *   http://www.gfconfigs.com
                               *   http://homepage.mac.com/whitecap/
                               *
                               * Although compatible with G-Force configs,
                               * Greenshift is ENTIRELY my creation.  I
                               * designed it from the ground up without
                               * copying any code.  Greenshift is now
                               * open source (like G-Force) since I have
                               * completed most of the base functionality.
                               */

/****************************************************************************
 * NOTE: you may be confused why some numbers have quotes around them, and
 * others don't.  There really is no reason, other than Greenshift supports
 * both, and I wasn't consistent in the way I typed the numbers.
 ****************************************************************************/


/*
 * NOTE: many variable names have changed.
 *       To help clarify, here's a list of the old and new equivalents
 *
 * OLD                   NEW
 *
 * fullscreen_depth      screen_depth
 * calculated_depth      canvas_depth
 *
 * visible_width         canvas_width
 * visible_height        canvas_height
 *
 * display_width         buffer_width
 * display_height        buffer_height
 *
 *                       window_width
 *                       window_height
 *
 *                       screen_width
 *                       screen_height
 *
 * max_frames            maximum_frames
 */


/**************************************************************************
 * BIT DEPTH
 *
 * "screen_depth" - valid values include 8, 16, 24, 32
 *
 * this is dependent on your hardware, so if your video card doesn't support
 * 32 bit color, don't use it.  Greenshift should automatically try 24 bit
 * color if 32 bit color fails.  Actually, 24 bit color looks exactly the
 * same since both represent 16 Million colors.  32 bit color also includes
 * an 8 bit alpha channel, and since alpha is not used in Greenshift, 32 and
 * 24 bit are pretty much identical, except 24 bit may sometimes display
 * faster since one less byte needs to be copied for each pixel.
 *
 * "canvas_depth" - valid values include 8, 16, 32
 *
 * the visualization data is rendered and manipulated in this bit depth.
 * this is NOT hardware dependent, and does not have to be the same as the
 * screen depth, so any value should work on any system.
 */
screen_depth  = "8",  /* display mode when in fullscreen  */
canvas_depth  = "8",  /* number of bits to render the vis */


/****************************************************************************
 * BUFFER DIMENSIONS
 *
 * buffer_width and buffer_height are the dimensions of the offscreen
 * video memory that greenshift draws to.  This is stretched to either the
 * window dimensions or fullscreen dimensions, depending on which is
 * currently active.
 *
 * The buffer dimensions should be greater or equal to the canvas dimensions
 */
//buffer_width  = "1024", buffer_height = "768",
//buffer_width  = "800",  buffer_height = "600",
buffer_width  = "640",  buffer_height = "480",



/****************************************************************************
 * CANVAS DIMENSIONS - THIS IS WHAT AFFECTS RENDER SPEED THE MOST
 *
 * canvas_width and canvas_height are the dimensions of the offscreen
 * system memory that greenshift draws to.  This is copied to video memory
 * specified by buffer_width and buffer_height
 *
 * the canvas dimensions are ignored if greater than the buffer dimensions
 *
 * NOTE:
 * the canvas dimensions *must* be even,
 * because some code assumes a multiple of 2
 * if an odd height is used, the image will be backwards
 */
//canvas_width  = "1024",
//canvas_width  = "800",
//canvas_width  = "640",
canvas_width  = "buffer_width",

//canvas_height = "canvas_width*3/10", /* height for 10:3 aspect ratio */
//canvas_height = "canvas_width*9/16", /* height for 16:9 aspect ratio */
canvas_height = "canvas_width*19/32", /* default G-Force height, 32:19 aspect */

canvas_aspect = "canvas_width/canvas_height",


/****************************************************************************
 * WINDOW DIMENSIONS
 *
 * dimensions of the window
 */
//window_width    = "640",        window_height = "480",
window_width    = "buffer_width", window_height = "buffer_height",


/****************************************************************************
 * FULLSCREEN DIMENSIONS
 *
 * resolution when in fullscreen
 */
//screen_width  = "1024",         screen_height = "768",
//screen_width  = "800",          screen_height = "600",
//screen_width  = "640",          screen_height = "480",
screen_width    = "buffer_width", screen_height = "buffer_height",





/****************************************************************************
 * FRAMERATE REGULATION
 *
 * the algorithm goes something like this:
 * if framerate is too low
 * then
 *     if current waveshape took longer to draw than all particles combined
 *     then
 *         set a new waveshape immediately, without tweening from the current
 *     else
 *         remove the slowest particle
 */
//max_framerate  = "1033",  /* desired sustained framerate */
max_framerate  = "42",  /* desired sustained framerate */
//max_framerate  = "33",    /* desired sustained framerate */
min_framerate  = "14",  /* if the framerate drops below min_framerate,
                         * Greenshift takes measures to increase fps instantly
                         * (ie: reduce the number of particles)
                         */

/****************************************************************************
 * MISCELLANEOUS
 */
show_framerate  = "1", /* F key toggles at runtime */
show_debug_info = "1", /* D key toggles at runtime */

fullscreen      = "0", /* 0 = start windowed,
                        * 1 = fullscreen mode
                        *
                        * Alt+Enter, or double clicking toggles at runtime
                        * toggling at runtime does not change this setting
                        */



/****************************************************************************
 *
 * Timing and Tweening Settings
 *
 ****************************************************************************/

maximum_frames  = "22", /* maximum num frames used to tween delta fields  */
default_frames  = "22", /* default num frames used to tween delta fields  */
tween_repeat    = "4",  /* number of times to repeat each tween frame.    */
plain_repeat    = "1",  /* number of times to repeat each of the normal
                         * delta field frames.                            */

                       /* Setting tween_repeat to 2 is almost like setting
                        * default_frames twice as high,
                        * setting to 4 is like 4 times as high... etc..
                        * except precalculation doesn't take twice as long
                        */
                       /* Time dependent delta fields aren't supported yet
                        * so plain_repeat has no effect (leave it at 1)
                        */

/* FFTT is used to adjust the spectrum data so it has "prettier" values.
 * it works, but is not implemented correctly yet.
 */
FFTT="0.5 * log( 0.00390625 * x * ( 1.3 + w ) + 1 )",

   /* a random number between 0 and 1 is picked every
    * "particle_interval" seconds, if it is less than
    * "particle_probability", then a new particle is started
    */
particle_probability = ".04/((NUM_PARTICLES+1)^1.55)",

deltafield_interval  = "0",           /* constantly render the next DF      */
waveshape_interval   = "13+rand(11)", /* time before WS starts tweening     */
particle_lifetime    = " 6+rand(18)", /* time a particle is visible         */
particle_interval    = "1",     /* time between particle probability checks */
palette_interval     = "10+rand(20)", /* time between palette shifts        */

deltafield_tween     = " 3+rand( 7)", /* seconds taken to morph deltafields */
waveshape_tween      = " 6+rand(13)", /* seconds taken to morph waveshapes  */
particle_tween       = " 6+rand(13)", /* seconds taken to morph particles   */
palette_tween        = " 3+rand(18)", /* seconds taken to morph palettes    */

/* currently deltafield_tween and
 * particle_tween are not used.
 * DeltaFields tween in a specified
 * number of frames, not an amount of time,
 * and particles don't tween yet.
 */

   /*
    * the default G-Force timing expressions seem to do
    * a good job, so I may have borrowed some of them
    *
    * PPrb=".04/((NUM_PARTICLES+1)^1.55)",
    * PDur=" 6 + rnd( 18 )",
    * WInt="15 + rnd( 15 )",
    * CInt="10 + rnd( 20 )",
    * DInt="20 + rnd( 20 )",
    * WMor="6 + rnd( 13 )",
    * CMor="3 + rnd( 18 )",
    * DMor="3 + rnd( 7 )",
    * FFTT="1.1 * log( 0.0078125 * x * ( 1.3 + w ) + 1 )",
    */



/****************************************************************************
 *
 * Example of how to use the "cheap trick" to gain speed
 *
 ****************************************************************************/

// Below are a couple sets of values that tell Greenshift to
// render a smaller image, but stretch it to fill the screen.
//
// the values are currently commented out, but
// when the beginning of the line looks like //*
// then the lines following are not commented
// if the beginning of the line looks like /*
// then the lines following are commented


/* add a slash to the beginning of this line to see a "cheap trick"
max_framerate   = 1033,
show_debug_info = 0,
screen_depth    = 16,   
canvas_depth    = 8,

screen_width  = 640,
screen_height = 480,
window_width  = 640,
window_height = 480,

buffer_width  = "screen_width/2",
buffer_height = "screen_height/2",
/**/


/* add a slash to the beginning of this line to see a "cheap trick"
max_framerate   = 1033,
show_debug_info = 0,
screen_depth    = 16,   
canvas_depth    = 8,

screen_width  = 640,
screen_height = 480,
window_width  = 640,
window_height = 480,

canvas_width  = 320,
canvas_height = 190,

buffer_width  = 320,
buffer_height = 240,
/**/

/* add a slash to the beginning of this line to see a "cheap trick"
max_framerate   = 64,
show_debug_info = 0,
screen_depth    = 16,   
canvas_depth    = 8,

screen_width  = 800,
screen_height = 600,
window_width  = 800,
window_height = 600,

buffer_width  = 400,
buffer_height = 300,
/**/

/* add a slash to the beginning of this line to see another "cheap trick"
max_framerate   = 1033,
show_debug_info = 0,
screen_depth    = 8,
canvas_depth    = 8,

screen_width  = 640,
screen_height = 480,
window_width  = 640,
window_height = 480,

canvas_width  = 480,
canvas_height = 284,

buffer_width  = 480,
buffer_height = 360,
/**/




/****************************************************************************
 *###########################################################################
 * Use Overlay mode AT YOUR OWN RISK. I have only seen it work on my machine,
 * and one other machine that also has a Voodoo3 video card.
 * Testing on other people's machines has either simply failed, and reverted
 * to non-overlay mode, or bluescreened.
 *
 * There is almost zero error checking, and could possibly bluescreen very
 * easily, depending on if your video card likes overlays
 *
 * the worst it should do is bluescreen
 *###########################################################################
 ****************************************************************************/
overlay_mode      = "0",/* 0 = don't use overlay */
                        /* 1 = start in overlay mode */
                        /* double right click toggles at runtime */
overlay_color_key = "0",/* the color the overlay replaces */
                        /* suggestion: set desktop background to this color,
                         * maximize the window, and then minimize the window
                         */

keyR="0",
keyG="0",
keyB="0",




/*
 * render_width  = "320",
 * render_height = "190",
 * offscreen_width   = "640",
 * offscreen_height  = "480",
 */


/****************************************************************************
 *
 * This is the end of the main settings section,
 * and the beginning of the special settings section
 *
 * each set of special settings is marked by a section header: [section-name]
 *
 ****************************************************************************/



[alias]
  /* an alias is a way to map one string onto another
   * (say a less descriptive name to a more descriptive one)
   * G-Force uses a lot of hard to remember abbreviations.
   * to make my life easier, I include the ability to map the
   * 4 character or less G-Force abbreviations to my set of variable
   * names which may have any length without affecting speed
   */
/* MACROS
 *
 * external alias's - for things to the right of an equals sign in a config
 *
 * used by expressions in configs to convert from
 * G-Force functions/variables, to the actual function/variable names I use
 * the value to the left of the = is what's in G-Force configs
 */
NUM_SAMPLE_BINS = Default_samples,
NUM_FFT_BINS    = Default_FFT_Samples,
flor            = floor,
trnc            = trunc,
rnd             = rand,
arccos          = acos,
arcsin          = asin,
arctan          = atan,
arccosh         = acosh,
arcsinh         = asinh,
arctanh         = atanh,

/*
 * internal alias's - for things to the left of an equals sign in a config
 *
 * used by my code internally
 * to convert from what I look for to the G-Force variable names
 * the value to the right of the = is what's in G-Force configs
 *
 * For the most part, I hate abbreviations in my code, and try to avoid them
 * when possible.  This is so I can spell out what I am reading in from a
 * config, and have it translated to the four character abbreviation
 * actually used in the config files.
 */
Aspect          = Aspc,
Connected       = ConB,
LineWidth       = LWdt,
PenColor        = Pen,
SourceX         = srcX,
SourceY         = srcY,
SourceRadius    = srcR,
SourceTheta     = srcT,
Steps           = Stps,
Version         = Vers,



[constant]
  /* a constant is kindof like an alias, except it represents a
   * constant value.  If a constant is defined with the same name
   * as a config variable constant, then the value will be used if
   * the variable is not defined in the config file.
   */
Default_FFT_Samples= 93,
Default_Samples    = 260,
Version            = 100,
Aspect             = 1,
false              = 0,
true               = 1,
pi                 = 3.1415926535897932384626433832795,
two_pi             = "3.1415926535897932384626433832795 * 2",
half_pi            = "3.1415926535897932384626433832795 / 2",
pi2                = "3.1415926535897932384626433832795 * 2",
pi_2               = "3.1415926535897932384626433832795 / 2",
e                  = 2.71828182845904523536,
radians_per_degree = "pi / 180",
Parametric_steps   = Default_Samples,
FourD_steps        = "flor(sqrt(Parametric_steps))-1",


        /* FourD_steps is for both x AND z directions,
         * so that's why the default should be close to
         * the square root of the default number of steps
         *
         * There is a little bit of extra overhead for 4D
         * so that's why an extra 1 is subtracted
         */

/* Parametric mode is the default
 * (all G-Force files are Parametric)
 * and s ranges from 0 to 1.
 *
 * In FourD mode, you use two other variables
 * x and z, which range from -1 to 1.
 * s can still be used in FourD mode, since s is defined as
 * the pythagorean distance from the origin.  This allows s to always
 * represent a number from 0 to 1, no matter what mode is used.
 *
 * s = sqrt(sqr(x) + sqr(z))
 *
 * I'm thinking of adding a few variables like rx, ry, rz, to have access
 * to the rotated values.  I'm not sure yet, these are just ideas right now.
 */
        /*
         * when in FourD mode, the s variable is defined as
         * the pythagorean distance from (0,0) to (x,z)
         * so, s = sqrt(sqr(x)+sqr(z))
         */


[defaults]
 /*
  * these are the defaults for variable expressions in configs
  */
POV                = "5",
rotation_order     = "yxz",
x_rotation         = "-0.125*pi", //"-pi/8",
y_rotation         = "0.25*pi", //"pi/4",
z_rotation         = "0",


//default Mode is parametric
//Mode = "Parametric",



/****************************************************************************
 *
 * Everything else below in the file is ignored
 *
 * I mean it's all read in, it's just not used yet.
 *
 * this file just contains ideas I had about
 * what I might put in a config file, and
 * the file format is not finished, so this config
 * probably will not work with any other builds of Greenshift.
 *
 ****************************************************************************/



[function]

rad2deg(r) = "r / radians_per_degree",
deg2rad(d) = "d * radians_per_degree",


[default]
virtual_aspect_ratio = 1.0,
edge_wrap            = true,
displacement_factor  = 1.0,


[version]
Vers = 042

