32#include <robottools.h>
34#include <portability.h>
77 const char *race = info->_reRaceName;
79 int x1, x2, x3, x4, x5, x6;
82 const int BUFSIZE = 1024;
85 const int TIMEFMTSIZE = 256;
86 char timefmt[TIMEFMTSIZE];
87 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
91 snprintf(buf, BUFSIZE,
"Practice Results");
119 for (i = 0 + start; i <
MIN(start +
MAX_LINES, totLaps); i++) {
123 snprintf(buf, BUFSIZE,
"%d", i+1);
154 "data/img/arrow-up.png",
"data/img/arrow-up-pushed.png",
177 "data/img/arrow-down.png",
"data/img/arrow-down-pushed.png",
203 const char *race = info->_reRaceName;
205 int x1, x2, x3, x4, x5, x6, x7, x8, x9;
208 const int BUFSIZE = 1024;
211 const int TIMEFMTSIZE = 256;
212 char timefmt[TIMEFMTSIZE];
213 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
219 snprintf(buf, BUFSIZE,
"Race Results");
221 snprintf(buf, BUFSIZE,
"%s", info->
track->
name);
254 for (i = start; i <
MIN(start +
MAX_LINES, nbCars); i++) {
258 snprintf(buf, BUFSIZE,
"%d", i+1);
265 if (laps == totLaps) {
273 dlap = totLaps - laps;
275 snprintf(buf, BUFSIZE,
"+1 Lap");
277 snprintf(buf, BUFSIZE,
"+%d Laps", dlap);
287 snprintf(buf, BUFSIZE,
"%d", laps);
314 "data/img/arrow-up.png",
"data/img/arrow-up-pushed.png",
338 "data/img/arrow-down.png",
"data/img/arrow-down-pushed.png",
364 const char *race = info->_reRaceName;
368 const int BUFSIZE = 1024;
371 const int TIMEFMTSIZE = 256;
372 char timefmt[TIMEFMTSIZE];
373 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
378 snprintf(buf, BUFSIZE,
"Qualification Results");
380 snprintf(buf, BUFSIZE,
"%s", info->
track->
name);
399 for (i = start; i <
MIN(start +
MAX_LINES, nbCars); i++) {
402 snprintf(buf, BUFSIZE,
"%d", i+1);
421 "data/img/arrow-up.png",
"data/img/arrow-up-pushed.png",
444 "data/img/arrow-down.png",
"data/img/arrow-down-pushed.png",
472 const int BUFSIZE = 1024;
475 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
479 const char *race = info->_reRaceName;
482 snprintf(buf, BUFSIZE,
"%s Results", race);
499 for (i = start; i <
MIN(start +
MAX_LINES, nbCars); i++) {
502 snprintf(buf, BUFSIZE,
"%d", i+1);
521 "data/img/arrow-up.png",
"data/img/arrow-up-pushed.png",
556 "data/img/arrow-down.png",
"data/img/arrow-down-pushed.png",
577 switch (info->
s->_raceType) {
float tdble
Floating point type used in TORCS.
void GfuiScreenRelease(void *scr)
Release the given screen.
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
void GfuiAddKeyAction(void *scr, unsigned char key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Keyboard callback to a screen.
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
int GfuiVisibilitySet(void *scr, int id, int visible)
Set/unset the visibility attribute of an object.
void GfuiAddSKeyAction(void *scr, int key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Special Keyboard shortcut to the screen.
void GfuiScreenReplace(void *screen)
Activate a screen and make it current plus release the current screen.
int GfuiLabelCreateEx(void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen)
Create a new label (extended version).
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
int GfuiGrButtonCreateAction(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed, int x, int y, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Add a graphical button to a screen.
void * GfuiScreenCreate(void)
Create a new screen.
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
int GfuiButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Add a button to a screen.
const char * GfParmGetStr(void *parmHandle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle.
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
int GfParmCreateDirectory(const char *file, void *parmHandle)
Create directory for parameter set handle if it does not yet exist.
int GfParmWriteFile(const char *file, void *parmHandle, const char *name)
Write parameter set into file.
int GfParmGetEltNb(void *handle, const char *path)
Count the number of subsections in a section in the parameter set handle.
void GfuiScreenShot(void *)
Save a screen shot in png format.
void GfTime2Str(char *result, int resultSize, tdble sec, int sgn)
Convert a time in seconds (float) to an ascii string.
#define RE_SECT_STANDINGS
struct RmInfo tRmInfo
Race Manager General Info.
#define RE_ATTR_TOP_SPEED
#define RE_ATTR_BOT_SPEED
#define RE_ATTR_PENALTYTIME
#define RE_ATTR_BEST_LAP_TIME
#define RE_ATTR_NB_PIT_STOPS
static void rmChgStandingScreen(tRaceCall *prc)
static void rmSaveRes(tRmInfo *info)
static void rmChgRaceScreen(tRaceCall *prc)
static void rmChgPracticeScreen(tRaceCall *prc)
static void rmQualifResults(void *prevHdle, tRmInfo *info, int start)
static void rmPracticeResults(void *prevHdle, tRmInfo *info, int start)
static void rmShowStandings(void *prevHdle, tRmInfo *info, int start)
static void rmChgQualifScreen(tRaceCall *prc)
static void rmRaceResults(void *prevHdle, tRmInfo *info, int start)
tTrack * track
Current track.
void * results
Race results.
tSituation * s
Situation during race.
const char * name
Name of the track.
#define GFUI_INVISIBLE
Object invisibility flag.
#define GFUI_FONT_LARGE_C
#define GFUI_FONT_MEDIUM_C
std::function< void()> tGfuiAction