Skip to content

Commit ff5a81e

Browse files
committed
DOCS: Formatting fixes.
1 parent e0b7fed commit ff5a81e

26 files changed

+463
-472
lines changed

docs/Coding_guidelines.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ Code
88

99
VDrift code is formatted using all tabs and no spaces. The following example demonstrates VDrift's coding style.
1010

11-
`class EXAMPLECLASS`
12-
`{`
13-
`private:`
14-
`        int data;`
15-
`public:`
16-
`        EXAMPLECLASS();`
17-
`        ~EXAMPLECLASS(); `
18-
`        void MemberFunction();`
19-
`};`
20-
`// Add the sum of the number 1 - 10 to data.`
21-
`void EXAMPLECLASS::MemberFunction()`
22-
`{`
23-
`        // loop and add i to data  <-- Useless comment, should be avoided.`
24-
`        for (int i = 1; i <= 10; i++)`
25-
`        {`
26-
`                data += i;`
27-
`        }`
28-
`}`
11+
class EXAMPLECLASS
12+
{
13+
private:
14+
        int data;
15+
public:
16+
        EXAMPLECLASS();
17+
        ~EXAMPLECLASS();
18+
        void MemberFunction();
19+
};
20+
// Add the sum of the number 1 - 10 to data.
21+
void EXAMPLECLASS::MemberFunction()
22+
{
23+
        // loop and add i to data  <-- Useless comment, should be avoided.
24+
        for (int i = 1; i <= 10; i++)
25+
        {
26+
                data += i;
27+
        }
28+
}
2929

3030
Indentation and Naming
3131
----------------------

docs/Compiling.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This page shows how to compile VDrift from source. It assumes you have downloaded the source code either by getting the source package from the [latest release](Downloading.md), or by [getting the development version](Getting_the_development_version.md). \_\_TOC\_\_
1+
This page shows how to compile VDrift from source. It assumes you have downloaded the source code either by getting the source package from the [latest release](Downloading.md), or by [getting the development version](Getting_the_development_version.md).
22

33
Windows
44
-------
@@ -9,19 +9,19 @@ Windows
99
- Install [MSYS2](http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/) and update local packages.
1010
- Install build tools.
1111

12-
`pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf scons`
12+
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf scons'
1313

1414
- Install VDrift dependencies.
1515

16-
`pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-bullet mingw-w64-x86_64-curl mingw-w64-x86_64-libvorbis`
16+
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-bullet mingw-w64-x86_64-curl mingw-w64-x86_64-libvorbis
1717

1818
- Build VDrift using MinGW-w64 Win64 Shell.
1919

20-
`scons`
20+
scons
2121

2222
- For more build options run
2323

24-
`scons --help`
24+
scons --help
2525

2626
### Building with Code::Blocks/MinGW (obsolete)
2727

@@ -30,18 +30,18 @@ Windows
3030
- Download [Code::Blocks nightly](http://forums.codeblocks.org/index.php/board,20.0.html)
3131
- Run the following command from the **vdrift** folder to generate the build files.
3232

33-
`vdrift-win\premake4 codeblocks`
33+
vdrift-win\premake4 codeblocks
3434

3535
### Building with MSVC (obsolete)
3636

3737
- Run the appropriate command from the **vdrift** folder to generate the project files.
3838
- Microsoft Visual C++ 2008:
3939

40-
`vdrift-win\premake4 vs2008`
40+
vdrift-win\premake4 vs2008
4141

42-
- - Microsoft Visual C++ 2010:
42+
- Microsoft Visual C++ 2010:
4343

44-
`vdrift-win\premake4 vs2010`
44+
vdrift-win\premake4 vs2010
4545

4646
OS X
4747
----
@@ -62,10 +62,7 @@ The required build tools include:
6262

6363
The required libraries include:
6464

65-
- [Bullet](http://bulletphysics.org/wordpress/) - Open Source Physics Library (minimum version 2.83). Only the following libraries are required:
66-
- BulletCollision
67-
- BulletDynamics
68-
- LinearMath
65+
- [Bullet](http://bulletphysics.org/wordpress/) - Open Source Physics Library (minimum version 2.83).
6966
- [libcurl](http://curl.haxx.se/) - Multiprotocol file transfer library (minimum version 7.21.6)
7067
- [libvorbis](http://xiph.org/vorbis/) - The Vorbis General Audio Compression Codec Library (minimum version 1.2.0)
7168
- [SDL](http://www.libsdl.org/) - Simple DirectMedia Layer Library (minimum version 2.0.0)
@@ -77,66 +74,66 @@ Make sure you have all the required libraries and build tools. Make sure you als
7774

7875
All required packages can be installed using this command:
7976

80-
`sudo yum install bullet-devel gcc-c++ libvorbis-devel scons SDL2-devel SDL2_image-devel curl-devel`
77+
sudo yum install bullet-devel gcc-c++ libvorbis-devel scons SDL2-devel SDL2_image-devel curl-devel
8178

8279
#### Ubuntu
8380

8481
Ubuntu 12.04 does not include libbullet and SDL2 packages. They are available in following ppas though:
8582

86-
`   sudo add-apt-repository ppa:roblib/ppa`
87-
`   sudo add-apt-repository ppa:zoogie/sdl2-snapshots`
83+
sudo add-apt-repository ppa:roblib/ppa
84+
sudo add-apt-repository ppa:zoogie/sdl2-snapshots
8885

8986
All required packages can be installed using this command:
9087

91-
`   sudo apt-get install g++ scons libsdl2-dev libsdl2-image-dev libbullet-dev libvorbis-dev libcurl4-gnutls-dev`
88+
sudo apt-get install g++ scons libsdl2-dev libsdl2-image-dev libbullet-dev libvorbis-dev libcurl4-gnutls-dev
9289

9390
### Compiling
9491

9592
To compile VDrift just run SCons in the root directory of the sources.
9693

97-
`scons`
94+
scons
9895

9996
#### Optional: Compile Options
10097

10198
You can use one or more compile options. To compile with optimization for a certain platform, you can use the arch flag:
10299

103-
`scons arch=a64`
100+
scons arch=a64
104101

105102
Compiling VDrift in release mode will turn off debugging options, and enable more compiler optimizations. VDrift runs much more quickly in release mode:
106103

107-
`scons release=1`
104+
scons release=1
108105

109106
To enable force feedback, use this flag:
110107

111-
`scons force_feedback=1`
108+
scons force_feedback=1
112109

113110
You can get a list of all compile time options with:
114111

115-
`scons --help`
112+
scons --help
116113

117114
These options are probably best left off the first time you compile. If you have problems compiling or running VDrift, it is easier to debug with them off. Once you verify that VDrift is compiling, then recompile with these optimizations to improve performance.
118115

119116
### Installing
120117

121118
VDrift does not need to be installed to work and you can run it from the folder where you compiled it. If you do want to install, use the SCons build target install.
122119

123-
`sudo scons install`
120+
sudo scons install
124121

125122
#### Optional: Installation Location
126123

127124
There are also some install options - to change where VDrift is installed, use the prefix flag:
128125

129-
`scons install prefix=/usr/local`
126+
scons install prefix=/usr/local
130127

131128
### Cleaning
132129

133130
Building the project creates several artefacts that do not need to be stored, because they can be regenerated on demand. Cleaning them up can be done with SCons, too:
134131

135-
`scons --clean`
132+
scons --clean
136133

137134
To remove all additional temporary files run:
138135

139-
`rm -rf .sconf_temp/ .sconsign.dblite config.log vdrift.conf`
136+
rm -rf .sconf_temp/ .sconsign.dblite config.log vdrift.conf
140137

141138
FreeBSD
142139
-------
@@ -147,16 +144,16 @@ To compile VDrift on FreeBSD, use the ports system.
147144

148145
If you downloaded a release, simply run `make` on the **vdrift** port:
149146

150-
` cd /usr/ports/games/vdrift && make install clean clean-depends`
147+
cd /usr/ports/games/vdrift && make install clean clean-depends
151148

152149
### Development Version
153150

154151
If you downloaded the development version, copy the **vdrift** and **vdrift-data** ports to **vdrift-devel** and **vdrift-data-devel**:
155152

156-
` cd /usr/ports/games && cp -rf vdrift vdrift-devel && cp -rf vdrift-data vdrift-data-devel`
153+
cd /usr/ports/games && cp -rf vdrift vdrift-devel && cp -rf vdrift-data vdrift-data-devel
157154

158155
To compile, run `make` on the newly-created **vdrift-devel** port:
159156

160-
` cd /usr/ports/games/vdrift-devel && make install clean clean-depends`
157+
cd /usr/ports/games/vdrift-devel && make install clean clean-depends
161158

162159
<Category:Development>

docs/Config_file_format.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ Example
6565

6666
A file in this format might look like this.
6767

68-
`name = Example`
69-
`[ first ]`
70-
`stuff = 567`
71-
`blah = hello`
72-
`radius = 0.555`
73-
`[ 2nd ]`
74-
`beans = on`
75-
`now = 1`
76-
`position = 5,6,7`
68+
name = Example
69+
[ first ]
70+
stuff = 567
71+
blah = hello
72+
radius = 0.555
73+
[ 2nd ]
74+
beans = on
75+
now = 1
76+
position = 5,6,7
7777

7878
In the file, there are two categories, each with three data items. These items would be referenced by the following identifier strings, respectively:
7979

docs/Configuring_the_sound.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ Sound settings
55

66
Configuring the sound is done by editing [VDrift.config](VDrift_config.md) manually, or by changing the settings in the Options -&gt; Sounds menu. As there is no game music yet, the only option is the volume of game sounds:
77

8-
`[sound]`
9-
`volume = 1`
8+
[sound]
9+
volume = 1
1010

1111
Troubleshooting sound
1212
---------------------
1313

1414
If the engine sound is very broken or choppy sounding, and you hear some noise or crackling, you need to tell OpenAL to try to use a different sound backend. If you don't have an ~/.openalrc file, create it with these contents, or modify your current one to look like this:
1515

16-
`(define devices                 '(native alsa sdl arts esd null))`
17-
`(define alsa-device             "dsp0")`
18-
`(define speaker-num             2)`
19-
`;(define sampling-rate          22050)`
16+
(define devices                 '(native alsa sdl arts esd null))
17+
(define alsa-device             "dsp0")
18+
(define speaker-num             2)
19+
;(define sampling-rate          22050)
2020

2121
The important line here is the "define devices" line, OpenAL attempts to use each of those sound output methods in order. It uses the first one that works; in some cases native will work best, in other cases perhaps alsa. If Gnome is running its sound daemon, esd would be the best choice, while KDE usually uses artsd.
2222

@@ -34,7 +34,7 @@ On older versions of OpenAL, ALUT was part of the OpenAL library. At some point
3434

3535
To accomodate users of the old version of OpenAL with ALUT included, there is a switch in the SCons build system used on Linux and FreeBSD. To compile VDrift with "old OpenAL" support, simply add the option to the scons compile command:
3636

37-
`scons old_openal=1`
37+
scons old_openal=1
3838

3939
For more information on the build system see [Using SCons](Using_SCons.md).
4040

docs/Creating_tracks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Getting the level editor
1818

1919
In the Linux console, copy *everything* below:
2020

21-
`git clone `[`https://github.com/VDrift/trackeditor`](https://github.com/VDrift/trackeditor)` vdrift-trackeditor`
21+
git clone https://github.com/VDrift/trackeditor vdrift-trackeditor
2222

2323
Directions for creating tracks
2424
------------------------------
@@ -39,15 +39,15 @@ Directions for creating tracks
3939

4040
- `cd` to the **trackeditor/joepack** folder. Compile the joepack tool by running
4141

42-
`scons`
42+
scons
4343

4444
- `cd` to the ***TRACKEDITOR\_TP*/objects** folder (this is important, the packfile stores relative paths) and run
4545

46-
`/path/to/trackeditor/joepack/joepack -c objects.jpk *.joe`
46+
/path/to/trackeditor/joepack/joepack -c objects.jpk *.joe
4747

4848
- If you want, this command will show you the files in the joepack to allow you to verify the previous step worked correctly:
4949

50-
`/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk`
50+
/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk
5151

5252
- Copy *TRACKEDITOR\_TP* into the main VDrift tracks folder *VDRIFT\_TP* (for example **/home/joe/vdrift/data/tracks/parkinglot**). Erase ***VDRIFT\_TP*/objects/\*.joe** since they are all in the pack file now.
5353
- Add ***VDRIFT\_TP*/about.txt** and ensure that the first line is the name of the track. You should put information about the track author, where the track came from, etc in the second line and on.

docs/Debugging.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ General
55

66
VDrift outputs most of its debugging info on to the console via "cout" statements. There are some logs kept in ~/.vdrift/logs/ but they are not used much. To get more output on the console, users can simply use the **-verbose** option when running the game:
77

8-
`vdrift -verbose`
8+
vdrift -verbose
99

1010
This will drastically increase the amount of debugging output. This may reduce game performance but makes it easier to get an idea of where problems are occurring.
1111

@@ -18,23 +18,23 @@ If the game crashes it is easiest to get information about the crash from GDB, t
1818

1919
On Linux debugging can be done using **gdb**. First, VDrift must be compiled with debugging symbols. To turn on debugging symbols simply use the **release=0** option when running SCons:
2020

21-
`scons release=0`
21+
scons release=0
2222

2323
Now the binary (which is in the build/ directory if it is not installed) can be analyzed with GDB. Make sure you have the program **gdb** installed on your system, then run GDB on the vdrift binary (change "build/vdrift" to just "vdrift" if you ran **scons install**):
2424

25-
`gdb build/vdrift`
25+
gdb build/vdrift
2626

2727
This will put you on the gdb shell where you can then run the game. Here you can also specify any command line arguments to pass to the game. **-verbose** is added here as an example, but no options are necessary for debugging.
2828

29-
`(gdb) run -verbose`
29+
(gdb) run -verbose
3030

3131
Now the game will run. You may notice that when running in GDB game performance is less than normal. This is a natural side effect of GDB and nothing to worry about.
3232

3333
#### Obtaining a backtrace
3434

3535
If the game crashes (commonly resulting in a "Segmentation Fault" error) while running in GDB it is possible to obtain a *backtrace* of the crash. This is basically the stack of function calls that happened to trigger the crash. To obtain a backtrace within GDB, wait for the game to crash, and then when returned to the GDB prompt, enter the **backtrace** command:
3636

37-
`(gdb) backtrace`
37+
(gdb) backtrace
3838

3939
The output of this command can be posted on the VDrift forums for the developers to see. Please follow up on your post, as we may have other questions for you or may need you to perform other tests to properly identify the problem.
4040

docs/Drift_scoring.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,10 @@ At the beginning of a drift, the game starts accumulating the score for this dri
3131
- **Base score** - This is simply the length the car has travelled in this drift (in meters). A longer drift will earn higher base score.
3232
- **Bonus score** - This contains 3 components:
3333
- **drift length bonus** - same value as the base score, effectively giving double bonus to longer drifts.
34-
- **maximum drift speed bonus** - the value is
35-
36-
`the maximum drift speed (in m/s) / 2`
37-
38-
e.g. a maximum drift speed of 20 m/s will earn a bonus of 10.
39-
40-
- - **maximum drift angle bonus** - the value is
41-
42-
`the maximum drift angle (in radian) * 40 / PI`
43-
44-
e.g. a maximum drift angle of PI/4 (45 degrees) will earn a bonus of 10.
34+
- **maximum drift speed bonus** - the value is the maximum drift speed (in m/s) / 2
35+
- e.g. a maximum drift speed of 20 m/s will earn a bonus of 10.
36+
- **maximum drift angle bonus** - the value is the maximum drift angle (in radian) * 40 / PI
37+
- e.g. a maximum drift angle of PI/4 (45 degrees) will earn a bonus of 10.
4538

4639
If the car goes off track or spins out during a drift, the accumulated drift score is not added to the total score. An accumulated drift score of less than 5 is not added to the total either.
4740

0 commit comments

Comments
 (0)