Gobligine/doc/development.html
2004-04-07 18:14:01 +00:00

266 lines
8.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!--
---- $Id$
---- (c) Copyright 2001-2003 by Lutz Sammer and Nehal Mistry
---- This program is free software; you can redistribute it and/or modify
---- it under the terms of the GNU General Public License as published by
---- the Free Software Foundation; only version 2 of the License.
----
---- This program is distributed in the hope that it will be useful,
---- but WITHOUT ANY WARRANTY; without even the implied warranty of
---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
---- GNU General Public License for more details.
----
---- You should have received a copy of the GNU General Public License
---- along with this program; if not, write to the Free Software
---- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
---- 02111-1307, USA.
-->
<title>Development for Stratagus Version 2.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<h1>Development for Stratagus Version 2.0</h1>
<hr>
This file should give you some information to help with development of Stratagus.<p>
<h2>Mailing list</h2>
If you want to help with development for Stratagus you should
<a href="http://mail.nongnu.org/mailman/listinfo/stratagus-devel/">join</a>
the stratagus-devel mailing list.<br> You may also want to look at the
<a href="http://mail.nongnu.org/archive/html/stratagus-devel/">archives.</a>
<h2>IRC - Internet Relay Chat</h2>
You can try to meet other Stratagus developers and users on the
<a href="http://www.freenode.net/">FreeNode</a> IRC Network, in channel
<a href="irc://irc.freenode.net/stratagus">#Stratagus</a>.
<h2>Bugs and tasks</h2>
You can find <a
href="http://savannah.nongnu.org/bugs/?group=stratagus">known bugs</a>
and <a href="http://savannah.nongnu.org/pm/?group=stratagus">planned
tasks</a> on the <a
href="http://savannah.nongnu.org/projects/stratagus/">Savannah pages
of Stratagus</a>.<p>
Before starting on a bug or task, please ask on the mailing list or in the
IRC channel whether anybody else is already working on it.
<h2>Building Stratagus</h2>
<h3>Installing CVS client</h3>
If you want to help develop, it is the best that you use CVS. To do
so, first you need CVS for your system. Savannah has a <a
href="http://savannah.nongnu.org/cvs/?group=stratagus">guide</a> that
will help you get started.
<h3>Getting Stratagus from CVS</h3>
<h4>There are 3 modules in the CVS repository.</h4>
<ul>
<li>stratagus - The Stratagus engine source<p>
The source to the Stratagus engine. The source is licenced
under the GNU General Public License.
<b>This module is needed for development.</b>
<li>fcmp - The Stratagus Media Project<p>
A collection of free media (free sounds, music, videos, graphics,
animations and models), licensed under the GNU General Public License.
<li>crafted - The Stratagus Map Editor<p>
A map editor for Stratagus. This is obsolete now as Stratagus
has an internal editor.
</ul>
<h4>How do I access to these modules?</h4>
The instructions for accessing the modules are on the
<a href="http://savannah.nongnu.org/cvs/?group=stratagus">project cvs</a> page.<br>
NOTE: it is highly recommended that you use the -z3 flag, this compresses
the data and therefore speeds the transfer up.<p>
For example:<p>
cvs -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/stratagus login<br />
<i>"When prompted for a password for anonymous, simply press the Enter key."</i><br>
cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/stratagus co stratagus<br />
This is done only once. To update your CVS directory, go into
the module directory and type 'cvs -z3 -q update -dP'.<p>
You may put these flags in your ~/.cvsrc file so that you only
need to type 'cvs update', the cvs (1) man page will show you how.
<h3>Getting Stratagus without CVS</h3>
Please note CVS is always the latest and it is easier for you to keep
up to date. But if for some reason you cannot get the source via CVS,
you find can regular snapshots of Stratagus
<a href="http://savannah.nongnu.org/files/?group=stratagus">here</a>.
<h3>Compiling Stratagus</h3>
You can find instructions for compiling Stratagus at
<a href="install.html">install.html</a>.<br>
Since you already have a copy of the source, you may skip
ahead to step 2.
<h2>Source code documentation</h2>
Valery Shchedrin has introduced tagged source
documentation for Stratagus.<p>
You need either
<a href="http://www.doxygen.org">DoxyGen</a> or
<a href="http://www.zib.de/Visual/software/doc++/index.html">DOC++</a>
to generate source code documentation. You may then
use the following commands to produce the documentation:
<ul>
<li>If you use DoxyGen: <b>make doc</b>
<li>If you use DOC++: <b>make doc++</b>
</ul>
<h3>Tags used in source code</h3>
We use the doc++ tags:<p>
Multi line source code documentation:<p>
/** ... */<p>
Single line source code documentation:<p>
/// ... <p>
Start grouping:<p>
//@{ or /*@{*/<p>
End grouping:<p>
//@} or /*@}*/<p>
<ul>
<li>@name
<br>Name of file or group.
<li>@param
<br>Describes function/macro parameter
<li>@return
<br>Describes function return
<li>@see
<br>Links to other section
</ul><p>
Please read the doxygen/doc++ documentation.
<h2>Empty C prototype file</h2>
<pre>
// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
// T H E W A R B E G I N S
// Stratagus - A free fantasy real time strategy game engine
//
/**@name {filename}.c - {One line description of this file} */
//
// (c) Copyright 2003 by {insert your name here}
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; only version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// $Id$
//@{
/*----------------------------------------------------------------------------
-- Includes
----------------------------------------------------------------------------*/
#include &lt;stdio.h&gt;
#include "stratagus.h"
// More game includes.
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
// Global and local variables of this module.
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
// Local and global functions of this module.
//@}
</pre>
<h2>Coding style</h2>
You can use your own coding style in your own modules.
If you fix in other modules, please imitate the coding style of the original coder.
<p>We suggest the
<a href="/usr/src/linux/Documentation/CodingStyle">Linux kernel coding style</a> (also
found online <a href="http://lwn.net/2001/1115/a/CodingStyle.php3">here</a>).
<ul>
<li>Write ANSI C.
<li>Use 8 spaces tabulators.
<li>Use 4 spaces indentation levels.
<li>No line should be longer than 78 characters.
<li>Use C++ comments for to end of line comments.
<li>Use { } even for one statement blocks.
</ul>
NOTE: If you make big changes please always extend the copyright with your name,
and always update the copyright year if required.<p>
<h2>Sending a patch</h2>
Once you have completed some work, you will probably want it to be
included in the main Stratagus source.<p>
Follow these steps:<p>
<ul>
<li>cvs -q update -d
<li>cvs -q diff -u &gt; your-nickname.diff
<li>upload 'your-nickname.diff' to the
<a href=http://savannah.nongnu.org/patch/?group=stratagus">patch tracker</a>.
</ul>
Please also read the <a href="datadir.html">Stratagus data directory description.</a><p>
<hr>
(C) Copyright 1998-2003 by The <a href="http://stratagus.sf.net">Stratagus</a> Project
under the <a href="gpl.html">GNU General Public License</a>.<br>
All trademarks and copyrights on this page are owned by their respective owners.<br>
</body>
</html>