TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
results.cpp
Go to the documentation of this file.
1/***************************************************************************
2
3 file : results.cpp
4 created : Fri Apr 14 22:36:36 CEST 2000
5 copyright : (C) 2000-2026 by Eric Espie, Bernhard Wymann
6 email : berniw@bluewin.ch
7
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
23
24#include <stdlib.h>
25#include <stdio.h>
26#ifdef WIN32
27#include <windows.h>
28#endif
29#include <tgfclient.h>
30#include <osspec.h>
31#include <racescreens.h>
32#include <robottools.h>
33#include <robot.h>
34#include <portability.h>
35
36static int rmSaveId;
37static void *rmScrHdle = NULL;
38
39static void rmPracticeResults(void *prevHdle, tRmInfo *info, int start);
40static void rmRaceResults(void *prevHdle, tRmInfo *info, int start);
41static void rmQualifResults(void *prevHdle, tRmInfo *info, int start);
42static void rmShowStandings(void *prevHdle, tRmInfo *info, int start);
43
44#define MAX_LINES 20
45
46typedef struct
47{
48 void *prevHdle;
50 int start;
51} tRaceCall;
52
55
56
57static void rmSaveRes(tRmInfo *info)
58{
60 GfParmWriteFile(0, info->results, "Results");
62}
63
64
66{
67 void *prevScr = rmScrHdle;
68
69 rmPracticeResults(prc->prevHdle, prc->info, prc->start);
70 GfuiScreenRelease(prevScr);
71}
72
73
74static void rmPracticeResults(void *prevHdle, tRmInfo *info, int start)
75{
76 void *results = info->results;
77 const char *race = info->_reRaceName;
78 int i;
79 int x1, x2, x3, x4, x5, x6;
80 int offset;
81 int y;
82 const int BUFSIZE = 1024;
83 char buf[BUFSIZE];
84 char path[BUFSIZE];
85 const int TIMEFMTSIZE = 256;
86 char timefmt[TIMEFMTSIZE];
87 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
88 int totLaps;
89
91 snprintf(buf, BUFSIZE, "Practice Results");
92 GfuiTitleCreate(rmScrHdle, buf, strlen(buf));
93 snprintf(path, BUFSIZE, "%s/%s/%s", info->track->name, RE_SECT_RESULTS, race);
94 snprintf(buf, BUFSIZE, "%s on track %s", GfParmGetStr(results, path, RM_ATTR_DRVNAME, ""), info->track->name);
96 320, 420, GFUI_ALIGN_HC_VB, 0);
97 GfuiScreenAddBgImg(rmScrHdle, "data/img/splash-result.png");
98
99 offset = 90;
100
101 x1 = offset + 30;
102 x2 = offset + 50;
103 x3 = offset + 130;
104 x4 = offset + 240;
105 x5 = offset + 310;
106 x6 = offset + 400;
107
108 y = 400;
110 GfuiLabelCreateEx(rmScrHdle, "Time", fgcolor, GFUI_FONT_MEDIUM_C, x2+20, y, GFUI_ALIGN_HL_VB, 0);
111 GfuiLabelCreateEx(rmScrHdle, "Best", fgcolor, GFUI_FONT_MEDIUM_C, x3+20, y, GFUI_ALIGN_HL_VB, 0);
112 GfuiLabelCreateEx(rmScrHdle, "Top Spd", fgcolor, GFUI_FONT_MEDIUM_C, x4, y, GFUI_ALIGN_HC_VB, 0);
113 GfuiLabelCreateEx(rmScrHdle, "Min Spd", fgcolor, GFUI_FONT_MEDIUM_C, x5, y, GFUI_ALIGN_HC_VB, 0);
114 GfuiLabelCreateEx(rmScrHdle, "Damages", fgcolor, GFUI_FONT_MEDIUM_C, x6, y, GFUI_ALIGN_HC_VB, 0);
115 y -= 20;
116
117 snprintf(path, BUFSIZE, "%s/%s/%s", info->track->name, RE_SECT_RESULTS, race);
118 totLaps = (int)GfParmGetEltNb(results, path);
119 for (i = 0 + start; i < MIN(start + MAX_LINES, totLaps); i++) {
120 snprintf(path, BUFSIZE, "%s/%s/%s/%d", info->track->name, RE_SECT_RESULTS, race, i + 1);
121
122 /* Lap */
123 snprintf(buf, BUFSIZE, "%d", i+1);
125
126 /* Time */
127 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_TIME, NULL, 0), 0);
129
130 /* Best Lap Time */
131 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_BEST_LAP_TIME, NULL, 0), 0);
133
134 /* Top Spd */
135 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_TOP_SPEED, NULL, 0) * 3.6));
137
138 /* Min Spd */
139 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_BOT_SPEED, NULL, 0) * 3.6));
141
142 /* Damages */
143 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_DAMMAGES, NULL, 0)));
145
146 y -= 15;
147 }
148
149 if (start > 0) {
150 RmPrevRace.prevHdle = prevHdle;
151 RmPrevRace.info = info;
152 RmPrevRace.start = start - MAX_LINES;
153 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-up.png", "data/img/arrow-up.png",
154 "data/img/arrow-up.png", "data/img/arrow-up-pushed.png",
155 80, 40, GFUI_ALIGN_HL_VB, 1,
157 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_UP, "Previous Results", [] { rmChgPracticeScreen(&RmPrevRace); }, tGfuiAction());
158 }
159
161 "Continue",
163 320,
164 40,
165 150,
167 0,
168 [prevHdle] { GfuiScreenReplace(prevHdle); },
169 tGfuiAction(),
170 tGfuiAction());
171
172 if (i < totLaps) {
173 RmNextRace.prevHdle = prevHdle;
174 RmNextRace.info = info;
175 RmNextRace.start = start + MAX_LINES;
176 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-down.png", "data/img/arrow-down.png",
177 "data/img/arrow-down.png", "data/img/arrow-down-pushed.png",
178 540, 40, GFUI_ALIGN_HL_VB, 1,
180 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_DOWN, "Next Results", [] { rmChgPracticeScreen(&RmNextRace); }, tGfuiAction());
181 }
182
183 GfuiAddKeyAction(rmScrHdle, (unsigned char)27, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
184 GfuiAddKeyAction(rmScrHdle, (unsigned char)13, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
185 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_F12, "Take a Screen Shot", [] { GfuiScreenShot(NULL); }, tGfuiAction());
186
188}
189
190
191static void rmChgRaceScreen(tRaceCall *prc)
192{
193 void *prevScr = rmScrHdle;
194
195 rmRaceResults(prc->prevHdle, prc->info, prc->start);
196 GfuiScreenRelease(prevScr);
197}
198
199
200static void rmRaceResults(void *prevHdle, tRmInfo *info, int start)
201{
202 void *results = info->results;
203 const char *race = info->_reRaceName;
204 int i;
205 int x1, x2, x3, x4, x5, x6, x7, x8, x9;
206 int dlap;
207 int y;
208 const int BUFSIZE = 1024;
209 char buf[BUFSIZE];
210 char path[BUFSIZE];
211 const int TIMEFMTSIZE = 256;
212 char timefmt[TIMEFMTSIZE];
213 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
214 int laps, totLaps;
215 tdble refTime;
216 int nbCars;
217
219 snprintf(buf, BUFSIZE, "Race Results");
220 GfuiTitleCreate(rmScrHdle, buf, strlen(buf));
221 snprintf(buf, BUFSIZE, "%s", info->track->name);
223 320, 420, GFUI_ALIGN_HC_VB, 0);
224 GfuiScreenAddBgImg(rmScrHdle, "data/img/splash-result.png");
225
226 x1 = 30;
227 x2 = 60;
228 x3 = 260;
229 x4 = 330;
230 x5 = 360;
231 x6 = 420;
232 x7 = 490;
233 x8 = 545;
234 x9 = 630;
235
236 y = 400;
238 GfuiLabelCreateEx(rmScrHdle, "Driver", fgcolor, GFUI_FONT_MEDIUM_C, x2+10, y, GFUI_ALIGN_HL_VB, 0);
242 GfuiLabelCreateEx(rmScrHdle, "Top Spd", fgcolor, GFUI_FONT_MEDIUM_C, x6, y, GFUI_ALIGN_HC_VB, 0);
245 GfuiLabelCreateEx(rmScrHdle, "Penalty", fgcolor, GFUI_FONT_MEDIUM_C, x9, y, GFUI_ALIGN_HR_VB, 0);
246 y -= 20;
247
248 snprintf(path, BUFSIZE, "%s/%s/%s", info->track->name, RE_SECT_RESULTS, race);
249 totLaps = (int)GfParmGetNum(results, path, RE_ATTR_LAPS, NULL, 0);
250 snprintf(path, BUFSIZE, "%s/%s/%s/%s/%d", info->track->name, RE_SECT_RESULTS, race, RE_SECT_RANK, 1);
251 refTime = GfParmGetNum(results, path, RE_ATTR_TIME, NULL, 0);
252 snprintf(path, BUFSIZE, "%s/%s/%s/%s", info->track->name, RE_SECT_RESULTS, race, RE_SECT_RANK);
253 nbCars = (int)GfParmGetEltNb(results, path);
254 for (i = start; i < MIN(start + MAX_LINES, nbCars); i++) {
255 snprintf(path, BUFSIZE, "%s/%s/%s/%s/%d", info->track->name, RE_SECT_RESULTS, race, RE_SECT_RANK, i + 1);
256 laps = (int)GfParmGetNum(results, path, RE_ATTR_LAPS, NULL, 0);
257
258 snprintf(buf, BUFSIZE, "%d", i+1);
260 x1, y, GFUI_ALIGN_HC_VB, 0);
261
263 x2, y, GFUI_ALIGN_HL_VB, 0);
264
265 if (laps == totLaps) {
266 if (i == 0) {
267 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_TIME, NULL, 0), 0);
268 } else {
269 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_TIME, NULL, 0) - refTime, 1);
270 }
272 } else {
273 dlap = totLaps - laps;
274 if (dlap == 1) {
275 snprintf(buf, BUFSIZE, "+1 Lap");
276 } else {
277 snprintf(buf, BUFSIZE, "+%d Laps", dlap);
278 }
280
281 }
282
283 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_BEST_LAP_TIME, NULL, 0), 0);
285 x4, y, GFUI_ALIGN_HR_VB, 0);
286
287 snprintf(buf, BUFSIZE, "%d", laps);
289 x5, y, GFUI_ALIGN_HC_VB, 0);
290
291 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_TOP_SPEED, NULL, 0) * 3.6));
293 x6, y, GFUI_ALIGN_HC_VB, 0);
294
295 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_DAMMAGES, NULL, 0)));
297 x7, y, GFUI_ALIGN_HC_VB, 0);
298
299 snprintf(buf, BUFSIZE, "%d", (int)(GfParmGetNum(results, path, RE_ATTR_NB_PIT_STOPS, NULL, 0)));
301 x8, y, GFUI_ALIGN_HC_VB, 0);
302
303 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_PENALTYTIME, NULL, 0), 0);
305
306 y -= 15;
307 }
308
309 if (start > 0) {
310 RmPrevRace.prevHdle = prevHdle;
311 RmPrevRace.info = info;
312 RmPrevRace.start = start - MAX_LINES;
313 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-up.png", "data/img/arrow-up.png",
314 "data/img/arrow-up.png", "data/img/arrow-up-pushed.png",
315 80, 40, GFUI_ALIGN_HL_VB, 1,
317 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_UP, "Previous Results", [] { rmChgRaceScreen(&RmPrevRace); }, tGfuiAction());
318 }
319
321 "Continue",
323 /* 210, */
324 320,
325 40,
326 150,
328 0,
329 [prevHdle] { GfuiScreenReplace(prevHdle); },
330 tGfuiAction(),
331 tGfuiAction());
332
333 if (i < nbCars) {
334 RmNextRace.prevHdle = prevHdle;
335 RmNextRace.info = info;
336 RmNextRace.start = start + MAX_LINES;
337 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-down.png", "data/img/arrow-down.png",
338 "data/img/arrow-down.png", "data/img/arrow-down-pushed.png",
339 540, 40, GFUI_ALIGN_HL_VB, 1,
341 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_DOWN, "Next Results", [] { rmChgRaceScreen(&RmNextRace); }, tGfuiAction());
342 }
343
344 GfuiAddKeyAction(rmScrHdle, (unsigned char)27, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
345 GfuiAddKeyAction(rmScrHdle, (unsigned char)13, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
346 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_F12, "Take a Screen Shot", [] { GfuiScreenShot(NULL); }, tGfuiAction());
347
349}
350
351
353{
354 void *prevScr = rmScrHdle;
355
356 rmQualifResults(prc->prevHdle, prc->info, prc->start);
357 GfuiScreenRelease(prevScr);
358}
359
360
361static void rmQualifResults(void *prevHdle, tRmInfo *info, int start)
362{
363 void *results = info->results;
364 const char *race = info->_reRaceName;
365 int i;
366 int x1, x2, x3;
367 int y;
368 const int BUFSIZE = 1024;
369 char buf[BUFSIZE];
370 char path[BUFSIZE];
371 const int TIMEFMTSIZE = 256;
372 char timefmt[TIMEFMTSIZE];
373 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
374 int nbCars;
375 int offset;
376
378 snprintf(buf, BUFSIZE, "Qualification Results");
379 GfuiTitleCreate(rmScrHdle, buf, strlen(buf));
380 snprintf(buf, BUFSIZE, "%s", info->track->name);
382 320, 420, GFUI_ALIGN_HC_VB, 0);
383 GfuiScreenAddBgImg(rmScrHdle, "data/img/splash-result.png");
384
385 offset = 200;
386 x1 = offset + 30;
387 x2 = offset + 60;
388 x3 = offset + 240;
389
390 y = 400;
392 GfuiLabelCreateEx(rmScrHdle, "Driver", fgcolor, GFUI_FONT_MEDIUM_C, x2+10, y, GFUI_ALIGN_HL_VB, 0);
394 y -= 20;
395
396 snprintf(path, BUFSIZE, "%s/%s/%s/%s", info->track->name, RE_SECT_RESULTS, race, RE_SECT_RANK);
397 nbCars = (int)GfParmGetEltNb(results, path);
398
399 for (i = start; i < MIN(start + MAX_LINES, nbCars); i++) {
400 snprintf(path, BUFSIZE, "%s/%s/%s/%s/%d", info->track->name, RE_SECT_RESULTS, race, RE_SECT_RANK, i + 1);
401
402 snprintf(buf, BUFSIZE, "%d", i+1);
404 x1, y, GFUI_ALIGN_HC_VB, 0);
405
407 x2, y, GFUI_ALIGN_HL_VB, 0);
408
409 GfTime2Str(timefmt, TIMEFMTSIZE, GfParmGetNum(results, path, RE_ATTR_BEST_LAP_TIME, NULL, 0), 0);
411 x3, y, GFUI_ALIGN_HR_VB, 0);
412 y -= 15;
413 }
414
415
416 if (start > 0) {
417 RmPrevRace.prevHdle = prevHdle;
418 RmPrevRace.info = info;
419 RmPrevRace.start = start - MAX_LINES;
420 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-up.png", "data/img/arrow-up.png",
421 "data/img/arrow-up.png", "data/img/arrow-up-pushed.png",
422 80, 40, GFUI_ALIGN_HL_VB, 1,
424 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_UP, "Previous Results", [] { rmChgQualifScreen(&RmPrevRace); }, tGfuiAction());
425 }
426
428 "Continue",
430 320,
431 40,
432 150,
434 0,
435 [prevHdle] { GfuiScreenReplace(prevHdle); },
436 tGfuiAction(),
437 tGfuiAction());
438
439 if (i < nbCars) {
440 RmNextRace.prevHdle = prevHdle;
441 RmNextRace.info = info;
442 RmNextRace.start = start + MAX_LINES;
443 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-down.png", "data/img/arrow-down.png",
444 "data/img/arrow-down.png", "data/img/arrow-down-pushed.png",
445 540, 40, GFUI_ALIGN_HL_VB, 1,
447 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_DOWN, "Next Results", [] { rmChgQualifScreen(&RmNextRace); }, tGfuiAction());
448 }
449
450 GfuiAddKeyAction(rmScrHdle, (unsigned char)27, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
451 GfuiAddKeyAction(rmScrHdle, (unsigned char)13, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
452 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_F12, "Take a Screen Shot", [] { GfuiScreenShot(NULL); }, tGfuiAction());
453
455}
456
457
459{
460 void *prevScr = rmScrHdle;
461
462 rmShowStandings(prc->prevHdle, prc->info, prc->start);
463 GfuiScreenRelease(prevScr);
464}
465
466
467static void rmShowStandings(void *prevHdle, tRmInfo *info, int start)
468{
469 int i;
470 int x1, x2, x3;
471 int y;
472 const int BUFSIZE = 1024;
473 char buf[BUFSIZE];
474 char path[BUFSIZE];
475 float fgcolor[4] = {1.0, 0.0, 1.0, 1.0};
476 int nbCars;
477 int offset;
478 void *results = info->results;
479 const char *race = info->_reRaceName;
480
482 snprintf(buf, BUFSIZE, "%s Results", race);
483 GfuiTitleCreate(rmScrHdle, buf, strlen(buf));
484
485 GfuiScreenAddBgImg(rmScrHdle, "data/img/splash-result.png");
486
487 offset = 200;
488 x1 = offset + 30;
489 x2 = offset + 60;
490 x3 = offset + 240;
491
492 y = 400;
494 GfuiLabelCreateEx(rmScrHdle, "Driver", fgcolor, GFUI_FONT_MEDIUM_C, x2+10, y, GFUI_ALIGN_HL_VB, 0);
496 y -= 20;
497
498 nbCars = (int)GfParmGetEltNb(results, RE_SECT_STANDINGS);
499 for (i = start; i < MIN(start + MAX_LINES, nbCars); i++) {
500 snprintf(path, BUFSIZE, "%s/%d", RE_SECT_STANDINGS, i + 1);
501
502 snprintf(buf, BUFSIZE, "%d", i+1);
504 x1, y, GFUI_ALIGN_HC_VB, 0);
505
507 x2, y, GFUI_ALIGN_HL_VB, 0);
508
509 snprintf(buf, BUFSIZE, "%d", (int)GfParmGetNum(results, path, RE_ATTR_POINTS, NULL, 0));
511 x3, y, GFUI_ALIGN_HR_VB, 0);
512 y -= 15;
513 }
514
515
516 if (start > 0) {
517 RmPrevRace.prevHdle = prevHdle;
518 RmPrevRace.info = info;
519 RmPrevRace.start = start - MAX_LINES;
520 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-up.png", "data/img/arrow-up.png",
521 "data/img/arrow-up.png", "data/img/arrow-up-pushed.png",
522 80, 40, GFUI_ALIGN_HL_VB, 1,
524 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_UP, "Previous Results", [] { rmChgStandingScreen(&RmPrevRace); }, tGfuiAction());
525 }
526
528 "Continue",
530 210,
531 40,
532 150,
534 0,
535 [prevHdle] { GfuiScreenReplace(prevHdle); },
536 tGfuiAction(),
537 tGfuiAction());
538
540 "Save",
542 430,
543 40,
544 150,
546 0,
547 [info] { rmSaveRes(info); },
548 tGfuiAction(),
549 tGfuiAction());
550
551 if (i < nbCars) {
552 RmNextRace.prevHdle = prevHdle;
553 RmNextRace.info = info;
554 RmNextRace.start = start + MAX_LINES;
555 GfuiGrButtonCreateAction(rmScrHdle, "data/img/arrow-down.png", "data/img/arrow-down.png",
556 "data/img/arrow-down.png", "data/img/arrow-down-pushed.png",
557 540, 40, GFUI_ALIGN_HL_VB, 1,
559 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_PAGE_DOWN, "Next Results", [] { rmChgStandingScreen(&RmNextRace); }, tGfuiAction());
560 }
561
562 GfuiAddKeyAction(rmScrHdle, (unsigned char)27, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
563 GfuiAddKeyAction(rmScrHdle, (unsigned char)13, "", [prevHdle] { GfuiScreenReplace(prevHdle); }, tGfuiAction());
564 GfuiAddSKeyAction(rmScrHdle, GLUT_KEY_F12, "Take a Screen Shot", [] { GfuiScreenShot(NULL); }, tGfuiAction());
565
567}
568
569
575void RmShowResults(void *prevHdle, tRmInfo *info)
576{
577 switch (info->s->_raceType) {
578 case RM_TYPE_PRACTICE:
579 rmPracticeResults(prevHdle, info, 0);
580 return;
581
582 case RM_TYPE_RACE:
583 rmRaceResults(prevHdle, info, 0);
584 return;
585
586 case RM_TYPE_QUALIF:
587 rmQualifResults(prevHdle, info, 0);
588 return;
589 }
590}
591
592
598void RmShowStandings(void *prevHdle, tRmInfo *info)
599{
600 rmShowStandings(prevHdle, info, 0);
601}
static Vector y[4]
Definition Convex.cpp:56
float tdble
Floating point type used in TORCS.
Definition tgf.h:47
void GfuiScreenRelease(void *scr)
Release the given screen.
Definition gui.cpp:670
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
Definition guilabel.cpp:150
void GfuiAddKeyAction(void *scr, unsigned char key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Keyboard callback to a screen.
Definition gui.cpp:809
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
Definition gui.cpp:1058
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.
Definition gui.cpp:895
void GfuiScreenReplace(void *screen)
Activate a screen and make it current plus release the current screen.
Definition gui.cpp:549
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).
Definition guilabel.cpp:51
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
Definition guilabel.cpp:121
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.
Definition guibutton.cpp:58
void * GfuiScreenCreate(void)
Create a new screen.
Definition gui.cpp:588
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
Definition gui.cpp:508
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.
Definition params.cpp:2453
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
Definition params.cpp:2534
int GfParmCreateDirectory(const char *file, void *parmHandle)
Create directory for parameter set handle if it does not yet exist.
Definition params.cpp:1793
int GfParmWriteFile(const char *file, void *parmHandle, const char *name)
Write parameter set into file.
Definition params.cpp:1732
int GfParmGetEltNb(void *handle, const char *path)
Count the number of subsections in a section in the parameter set handle.
Definition params.cpp:2243
void RmShowStandings(void *prevHdle, tRmInfo *info)
Display standings.
Definition results.cpp:598
void RmShowResults(void *prevHdle, tRmInfo *info)
Display results.
Definition results.cpp:575
void GfuiScreenShot(void *)
Save a screen shot in png format.
Definition gui.cpp:998
void GfTime2Str(char *result, int resultSize, tdble sec, int sgn)
Convert a time in seconds (float) to an ascii string.
Definition tgf.cpp:192
#define MAX_LINES
static void * rmScrHdle
#define RM_ATTR_DRVNAME
Definition raceman.h:259
#define RE_SECT_STANDINGS
Definition raceman.h:341
struct RmInfo tRmInfo
Race Manager General Info.
#define RE_ATTR_POINTS
Definition raceman.h:356
#define RE_SECT_RANK
Definition raceman.h:343
#define RM_TYPE_PRACTICE
Definition raceman.h:70
#define RE_ATTR_TOP_SPEED
Definition raceman.h:352
#define RE_ATTR_LAPS
Definition raceman.h:349
#define RE_ATTR_BOT_SPEED
Definition raceman.h:353
#define RM_TYPE_RACE
Definition raceman.h:72
#define RE_ATTR_PENALTYTIME
Definition raceman.h:357
#define RE_ATTR_NAME
Definition raceman.h:345
#define RE_ATTR_TIME
Definition raceman.h:351
#define RE_ATTR_DAMMAGES
Definition raceman.h:354
#define RE_ATTR_BEST_LAP_TIME
Definition raceman.h:350
#define RE_ATTR_NB_PIT_STOPS
Definition raceman.h:355
#define RE_SECT_RESULTS
Definition raceman.h:342
#define RM_TYPE_QUALIF
Definition raceman.h:71
static void rmChgStandingScreen(tRaceCall *prc)
Definition results.cpp:458
static void rmSaveRes(tRmInfo *info)
Definition results.cpp:57
static void rmChgRaceScreen(tRaceCall *prc)
Definition results.cpp:191
static void rmChgPracticeScreen(tRaceCall *prc)
Definition results.cpp:65
static void rmQualifResults(void *prevHdle, tRmInfo *info, int start)
Definition results.cpp:361
static void rmPracticeResults(void *prevHdle, tRmInfo *info, int start)
Definition results.cpp:74
static void rmShowStandings(void *prevHdle, tRmInfo *info, int start)
Definition results.cpp:467
static void rmChgQualifScreen(tRaceCall *prc)
Definition results.cpp:352
tRaceCall RmNextRace
Definition results.cpp:53
static void rmRaceResults(void *prevHdle, tRmInfo *info, int start)
Definition results.cpp:200
tRaceCall RmPrevRace
Definition results.cpp:54
static int rmSaveId
Definition results.cpp:36
tTrack * track
Current track.
Definition raceman.h:223
void * results
Race results.
Definition raceman.h:225
tSituation * s
Situation during race.
Definition raceman.h:222
int start
Definition results.cpp:50
void * prevHdle
Definition results.cpp:48
tRmInfo * info
Definition results.cpp:49
const char * name
Name of the track.
Definition track.h:534
#define MIN(x, y)
Definition tgf.h:56
#define GFUI_FONT_LARGE
Definition tgfclient.h:248
#define GFUI_INVISIBLE
Object invisibility flag.
Definition tgfclient.h:239
#define GFUI_FONT_LARGE_C
Definition tgfclient.h:252
#define GFUI_FONT_MEDIUM_C
Definition tgfclient.h:253
#define GFUI_ALIGN_HL_VB
Definition tgfclient.h:71
std::function< void()> tGfuiAction
Definition tgfclient.h:107
#define GFUI_ALIGN_HR_VB
Definition tgfclient.h:77
#define GFUI_ALIGN_HC_VB
Definition tgfclient.h:74