Plugin interface for RBR
========================

This archive contains the source code needed to create plugins for RBR. The main purpose is to
provide players with functionality to conduct online championships and other custom modes of play.
Also provided is an example plugin that enables players to choose a stage and drive it, logging the
results to a text file.

How to use the compiled plugin
==============================

When compiling the solution you will end up with a dll file called RBRTestPlugin.dll. This file
needs to be placed in a folder called Plugins which needs to be created under the game root
folder ( e.g. C:\Program Files\SCi Games\Richard Burns Rally\Plugins ). The game should load 
the plugin into memory at startup.

Gameflow when using a plugin
============================
The plugins that are found under the are listed under Options\Plugins menu in RBR. The 
plugin will, when selected, display its own menu page, from which a stage can be started. After the
stage is completed the plugin may display a results page. Once the user skips this he is returned
to the front-end page displayed by the plugin.

Making a plugin
===============

This archive should contain the following files:

	- IPlugin.h					: The plugin interface use by RBR
	- IRBRGame.h				: Game interface that the plugin
	- PluginHelpers.h/cpp		: Some helper functions for the plugin
	- Gendef.h					: A list of defines for the stock graphics, use for drawing.
	- TestPlugin.h				: Implementation of the rbr test plugin
	- RBRTestPlugin.cpp			: Contains DllMain and RBR_CreatePlugin
	- RBRTestPlugin.def			: Export definitions
	- RBRTestPlugin.sln/vcproj	: Visual Studio solution files for VC2003
	- stdafx.h/cpp				: Precomplied header files
	- ReadMe.txt				: This file

Making a plugin consists of building a DLL exporting a single function (RBR_CreatePlugin)
which should return a pointer to a C++ class implementing the interface IPlugin. Examples of 
this can be found in RBRTestPlugin.def and RBRTestPlugin.cpp.

The actual plugin in this example is contained in TestPlugin.h. Plugins are based on a callback
architecture, in which the plugin recieves callbacks from the game at various points in the
race, and in the frontend/results screen. Only the currently active plugin (the one selected
from within the options screen) recieves callbacks.

Each class is documented in more detail in the source code. Don't change the IPlugin.h, IRBRGame.h 
or Gendef.h files or your plugin will not work as intended or even at all.
