1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: Configuration File</TITLE>
<META NAME="description" CONTENT="Crystal Space: Configuration File">
<META NAME="keywords" CONTENT="Crystal Space: Configuration File">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC121"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_46.html#SEC120"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_48.html#SEC122"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_45.html#SEC119"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_45.html#SEC119"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_53.html#SEC134"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H2> 3.2 Configuration File </H2>
<!--docid::SEC121::-->
<P>
Most applications have an accompanying configuration file which describes
configuration options particular to that application. Similarly, most
plug-in modules have have their config file. Configuration files are named
with the file extension `<TT>.cfg</TT>' and are typically located within the
virtual directory `<TT>/config/</TT>' which is most usually mounted at the
physical location `<TT>CS/data/config</TT>'.
</P><P>
The format of these files is simple. They consist of a number of <EM>keys</EM>,
each of which consists of a name, a value and an optional comment. Key names
contain dots to create some kind of hierarchy, similar to a file system:
`<SAMP>Video.OpenGL.EnableDither</SAMP>'. This should be interpreted at the key
`<SAMP>EnableDither</SAMP>' in the sub-section `<SAMP>OpenGL.</SAMP>', which resides in
section `<SAMP>Video.</SAMP>' (note that the dots are part of the section names).
</P><P>
The file itself looks like this:
<TABLE><tr><td> </td><td class=example><pre>; This is the comment for Section.Keyname
Section.Keyname = Value
; Comments may be
; several lines long
; The option 'Section.TestOption' has no comment attached to it.
Video.OpenGL.EnableDither = true
Section.TestOption = false
; Comments at the end of the file do not belong to any configuration
; key. When a config file is loaded and saved again later this
; end-of-file comment is put back at the end of the config file.
</pre></td></tr></table></P><P>
When you run an application, all configuration domains are combined to one
big database of options. When this happens, options from higher-priority
domains override options from lower-priority domains. These domains are (from
low to high priority):
<UL>
<LI>
Plug-In configuration files, such as `<TT>CS/data/config/opengl.cfg</TT>'. These
files define the default values for the plug-in configuration.
<P>
<LI>
The application configuration file. This is the file which you specify in
<CODE><VAR>System</VAR>->Initialize(argc, argv, <VAR>ConfigFile</VAR>)</CODE>. This file
defines the default values for the application configuration, and can
override the configuration for plug-in modules if an application requires
this.
<P>
<LI>
The user-specific, application-neutral domain. This domain only makes sense
in a multi-user environment, thus you can disable it in `<TT>system.cfg</TT>' or
in the application config file if you have a single-user system.
<P>
This domain is intended for users who want to override the configuration from
the lower-priority domains explained above. This is an application-neutral
domain, so any options you define here are used by all applications.
</P><P>
<EM>Warning</EM>: Currently this domain does not yet properly support multi-user
environments. All options are stored in `<TT>CS/data/config/user.cfg</TT>' and are
prepended with the string `<SAMP>Global.</SAMP>'. So for example the option
`<SAMP>Walktest.Settings.FPS</SAMP>' will be called
`<SAMP>Global.Walktest.Settings.FPS</SAMP>'.
</P><P>
<LI>
Ther user-specific, application-specific domain. This domain works like the
application-neutral user domain, except that it is not application-neutral.
A user may set options in this domain, for example, if he wants different
screen size settings for different applications.
<P>
<EM>Warning</EM>: Currently, this domain not yet properly support multi-user
environments. All options are stored in `<TT>CS/data/config/user.cfg</TT>' and are
prepended with the string `<SAMP>ApplicationID.</SAMP>', where `<SAMP>ApplicationID</SAMP>' is
defined in the user-neutral, application-specific config file (e.g.
`<TT>walktest.cfg</TT>').
</P><P>
<LI>
The command-line parameters. <STRONG>Note</STRONG>: This is not yet implemented.
</UL>
<P>
Thus you can set any option in your application's
config file to override options from the plug-in config files. And you can
again override those options with a line in the user configuration.
</P><P>
If the application tries to change options in the config file, these changes
are always applied to the user-specific, application-specific domain. The
only exception are applications that disable the user configuration
altogether, in which case the changes are applied to the user-neutral,
application-specific configuration.
</P><P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="cs_48.html#SEC122">3.2.1 System Configuration</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="cs_49.html#SEC125">3.2.2 Graphics Configuration</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="cs_50.html#SEC126">3.2.3 Engine Configuration</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="cs_51.html#SEC129">3.2.4 Sound Configuration</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="cs_52.html#SEC133">3.2.5 Console Configuration</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE></BLOCKQUOTE>
<P>
<A NAME="Config System"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_46.html#SEC120"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_48.html#SEC122"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_45.html#SEC119"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_45.html#SEC119"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_53.html#SEC134"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|