Helpers for selecting a valid race-manager track. More...
#include <stdio.h>#include <string.h>#include <tgf.h>#include <track.h>#include <raceman.h>#include "racetrackselect.h"
Go to the source code of this file.
Functions | |
| static bool | reBuildTrackFileName (const char *category, const char *trackName, char *trackFile, int trackFileSize) |
| Build the track XML path for a category/name pair. | |
| bool | ReTrackFileExists (const char *category, const char *trackName, char *trackFile, int trackFileSize) |
| Check whether a track XML file exists and can be parsed. | |
| std::vector< tReTrackCandidate > | ReFindAvailableTracks (void) |
| Find all available tracks under the current TORCS track search path. | |
| bool | ReResolveTrackSelection (void *params, int curTrackIndex, const std::vector< tReTrackCandidate > &availableTracks, tReTrackSelection *selection, bool updateParams) |
| Resolve the current race-manager track entry to an available track. | |
Helpers for selecting a valid race-manager track.
Definition in file racetrackselect.cpp.
|
static |
Build the track XML path for a category/name pair.
| [in] | category | Track category directory name |
| [in] | trackName | Track directory and XML base name |
| [in,out] | trackFile | Buffer receiving the generated track XML path |
| [in] | trackFileSize | Size of trackFile in bytes |
Definition at line 54 of file racetrackselect.cpp.
| std::vector< tReTrackCandidate > ReFindAvailableTracks | ( | void | ) |
Find all available tracks under the current TORCS track search path.
Definition at line 88 of file racetrackselect.cpp.

| bool ReResolveTrackSelection | ( | void * | params, |
| int | curTrackIndex, | ||
| const std::vector< tReTrackCandidate > & | availableTracks, | ||
| tReTrackSelection * | selection, | ||
| bool | updateParams ) |
Resolve the current race-manager track entry to an available track.
The configured track is kept when it is present in availableTracks. If it is missing, the first available track in the same category is preferred, otherwise the first available track is used. When updateParams is true, a fallback selection is written back to the current race-manager track section.
| [in,out] | params | Race-manager parameter handle |
| [in] | curTrackIndex | Current track section index under RM_SECT_TRACKS |
| [in] | availableTracks | Ordered list of valid track candidates |
| [in,out] | selection | Resolved track selection result |
| [in] | updateParams | true to write fallback category/name to params |
Definition at line 125 of file racetrackselect.cpp.

| bool ReTrackFileExists | ( | const char * | category, |
| const char * | trackName, | ||
| char * | trackFile, | ||
| int | trackFileSize ) |
Check whether a track XML file exists and can be parsed.
| [in] | category | Track category directory name |
| [in] | trackName | Track directory and XML base name |
| [in,out] | trackFile | Optional buffer receiving the generated track XML path |
| [in] | trackFileSize | Size of trackFile in bytes |
Definition at line 66 of file racetrackselect.cpp.
