30#include <portability.h>
81 if (
rmCar->_pitFuel < 0.0f) {
82 rmCar->_pitFuel = 0.0f;
83 }
else if (
rmCar->_pitFuel > maxFuel) {
84 rmCar->_pitFuel = maxFuel;
95 int maxRepair =
rmCar->_dammage;
99 if (
rmCar->_pitRepair < 0) {
100 rmCar->_pitRepair = 0;
101 }
else if (
rmCar->_pitRepair > maxRepair) {
102 rmCar->_pitRepair = maxRepair;
116 const int BUFSIZE = 32;
119 snprintf(buf, BUFSIZE,
"%.1f",
rmCar->_pitFuel);
126 const int BUFSIZE = 32;
129 snprintf(buf, BUFSIZE,
"%d",
rmCar->_pitRepair);
138 rmCar->pitcmd.fuel = (
tdble)strtod(val, (
char **)NULL);
149 rmCar->pitcmd.repair = strtol(val, (
char **)NULL, 0);
175static void rmShowButtonTip(
int buttonId,
int tipLabelId,
int disabledTipLabelId,
bool available)
182 int labelId = available ? tipLabelId : disabledTipLabelId;
257 const int BUFSIZE = 256;
280 snprintf(buf, BUFSIZE,
"Driver: %s", car->_name);
285 snprintf(buf, BUFSIZE,
"Remaining Laps: %d", car->_remainingLaps);
289 snprintf(buf, BUFSIZE,
"Remaining Fuel: %.1f l", car->_fuel);
296 snprintf(buf, BUFSIZE,
"%.1f", car->
pitcmd.
fuel);
311 int x2 = x + dx - 15;
312 int x3 = x + dx + 100 + 14;
325 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
330 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
struct CarElt tCarElt
Car structure (tCarElt).
struct CarPenalty tCarPenalty
One penalty.
#define RM_PENALTY_STOPANDGO
static float LabelColor[]
float tdble
Floating point type used in TORCS.
int GfuiButtonGetFocused(void)
Get the Id of the button focused in the current screen.
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
int GfuiFontHeight(int font)
Get the height of an initialized GUI font.
void GfuiScreenRelease(void *scr)
Release the given screen.
int GfuiFontWidth(int font, const char *text)
Measure text using an initialized GUI font.
int GfuiEditboxCreateAction(void *scr, const char *text, int font, int x, int y, int width, int maxlen, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost, int margin)
Add an edit box to a screen.
void * GfuiMenuScreenCreate(const char *title)
Create a new menu screen.
int GfuiVisibilitySet(void *scr, int id, int visible)
Set/unset the visibility attribute of an object.
int GfuiEnable(void *scr, int id, int flag)
Enable / Disable an object.
void GfuiEditboxSetString(void *scr, int id, const char *text)
Set a new string.
char * GfuiEditboxGetString(void *scr, int id)
Get the current text of an edit box.
int GfuiTipCreate(void *scr, const char *text, int maxlen)
Add a Tip (generally associated with a button).
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.
void GfuiLabelSetColor(void *scr, int id, float *color)
Change the color of a label.
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.
int GfuiScreenIsActive(void *screen)
Tell if the screen is active or not.
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.
#define GF_TAILQ_FIRST(head)
First element of a TAILQ.
struct RmInfo tRmInfo
Race Manager General Info.
tSituation * s
Situation during race.
int skillLevel
Driver's skill level (0=rookie -> 3=pro)
void(* tfuiCallback)(void *)
#define GFUI_INVISIBLE
Object invisibility flag.
#define GFUI_FONT_LARGE_C
#define GFUI_FONT_MEDIUM_C
std::function< void()> tGfuiAction
#define GFUI_VISIBLE
Object visibility flag.