Palomino - Configuration Module

©2004,2009  Jim E. Brooks   http://www.palomino3d.org



Overview of Configuration

[2007/12]

Configuration is input from 3 sources (in order of precedence):

  1. cmd-line args
  2. binary configuration file (.cfg) represented by ConfBin class
  3. textual configuration file (.conf) represented by ConfTxt class

The combined configuration is stored in a Conf object (C struct) which is per-module.


Textual Configuration (ConfTxt)

[2007/12]

The ConfTxt class retrieves static configuration that the user can edit. Textual configuration is read once at startup. The program does not modify it (unlike ConfBin).

ConfTxt is a primitive Template Method class. It reads a .conf file as a C++ stream and defers the processing of lines to the abstract ProcessField().


Binary Configuration (ConfBin)

[2007/12] [2004/06]

The ConfBin class stores and retrieves program state that originates from execution (as opposed to static configuration).

The configuration files is considered binary (not intended to be user-editable) but is in fact composed of lines of text. The configuration is a set of key/value pairs. A value can be 1 of 3 types: int, float, string. The configuration file consists of lines of human-readable plain-text. Each line defines a key/value pair. The file terminates at a line containing "END". For example:

# palomino configuration (gfx::ConfigFile v2)  [2007/12 old name survives since format hasn't changed]
int collisions 1
int joystick 0
int joystick_axis3 1
int response_chase 0
int response_eye 0
double fog_density 0.50000000000000000000
double gui_zoom 1.00000000000000000000
string lod 3 MID
END

Last modified: Sat Nov 7 14:46:34 CST 2009