48 static void rmSet(
void *vp);
71 }
else if (value < v->
min) {
76 const int BUFSIZE = 32;
79 snprintf(buf, BUFSIZE,
format, value);
99 if (fabs(
v->
min -
v->
max) >= 0.0001f) {
112 const int BUFSIZE = 256;
122 if (fabs(
v->
min -
v->
max) < 0.0001f) {
123 snprintf(buf, BUFSIZE,
"%s",
"N/A");
132 const int minw = 30+4*(bw+sp);
133 if (w < minw) w = minw;
135 id =
GfuiEditboxCreate(
scr, buf, font, x + 2*(bw+sp) + 5,
y, w - 4*(bw+sp) - 10, len,
this, (
tfuiCallback)NULL,
rmSet, 5);
194 if (carhandle == 0) {
195 GfError(
"carhandle NULL in %s, line %d\n", __FILE__, __LINE__);
218 if (carhandle == 0) {
219 GfError(
"carhandle NULL in %s, line %d\n", __FILE__, __LINE__);
240 static std::vector<cGuiSetupValue*>
values;
250 static const char*
f52 =
"%5.2f";
251 static const char*
f43 =
"%4.3f";
252 static const char*
d3 =
"%3.0f";
253 static const char*
d5 =
"%5.0f";
256 static const char*
setuplabel[6] = {
"Practice",
"Qualifying",
"Race",
"Backup 1",
"Backup 2",
"Backup 3"};
275 for (std::vector<cGuiSetupValue*>::iterator it =
values.begin(); it !=
values.end(); ++it) {
286 for (i = 0; i < n; i++) {
305 GfError(
"failed to init from default setup in %s, line %d\n", __FILE__, __LINE__);
310 for (std::vector<cGuiSetupValue*>::iterator it =
values.begin(); it !=
values.end(); ++it) {
327 const int BUFSIZE = 1024;
335 rmIdx = car->_driverIndex;
342 for (std::vector<cGuiSetupValue*>::iterator it =
values.begin(); it !=
values.end(); ++it) {
353 static const int x0 = 20;
354 static const int y0 = 428;
355 static const int dy = -12;
356 static const int xoff = 112;
357 static const int xoff2 = 40;
369 int y = y0 + (4.3f * dy);
380 static const char* wheellabel[4] = {
"Front right wheel",
"Front left wheel",
"Rear right wheel",
"Rear left wheel"};
382 for (i = 0; i < 4; i++) {
390 y = y0 + (4.3f * dy);
430 static const char* axlelabel[2] = {
"Front axle",
"Rear axle"};
433 for (j = 0; j < 2; j++) {
457 static const char* diffPos[3] = {
"Front differential",
"Rear differential",
"Center differential"};
458 static const char* diffType[5] = {
"None",
"Spool",
"Free",
"1.5 way LSD",
"Viscous coupler"};
460 for (i = 0; i < 3; i++) {
476 for (i = 0; i < 8; i++) {
477 snprintf(buf, BUFSIZE,
"%d:", i + 1);
484 const int buttonwidth = 102;
485 int x = buttonwidth/2 + x0;
489 for (j = 0; j < 6; j++) {
496 for (j = 0; j < 6; j++) {
510 const char* savebuttontext;
512 savebuttontext =
"Save practice setup and leave";
514 savebuttontext =
"Save qualifying setup and leave";
static void onSave(void *vp)
Race Manager General Info.
char * GfuiEditboxGetString(void *scr, int id)
Get the string.
tdble GfParmUnit2SI(const char *unit, tdble val)
Convert a value given in unit to SI.
cGuiSetupValue(void *scr, tCarPitSetupValue *v, const char *unit, const char *format, int font, int x, int y, int w, int len)
tCarPitSetupValue gearsratio[MAX_GEARS - 2]
int GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a button to a screen.
tCarPitSetupValue suspslowrebound[4]
static void * rmCarHandle
tCarPitSetupValue thirdX0[2]
static std::vector< cGuiSetupValue * > values
tCarPitSetupValue diffmaxtqbias[3]
void GfParmReleaseHandle(void *parmHandle)
Release given parameter set handle parmHandle.
tCarPitSetupValue suspslowbump[4]
void GfuiScreenRelease(void *scr)
Release the given screen.
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
void setValue(tdble value)
tCarPitSetupValue brakePressure
static void rmUpdatePP(void *vp)
int GfuiEditboxCreate(void *scr, const char *text, int font, int x, int y, int width, int maxlen, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost, int margin)
Add a editbox to a screen.
tSituation * s
Situation during race.
static void onLoadDefault(void *vp)
#define GFUI_FONT_SMALL_C
tdble GfParmSI2Unit(const char *unit, tdble val)
Convert a value from SI to given unit.
static int loadbuttonid[6]
tCarPitSetupValue diffratio[3]
static void rmUpdateP(void *vp)
The Gaming Framework API (client part).
tCarPitSetupValue brakeRepartition
tCarPitSetupValue steerLock
static void rmUpdateMM(void *vp)
tCarPitSetupValue suspbumpthreshold[4]
tCarPitSetupValue arbspring[2]
tCarPitSetupValue difflockinginputtq[3]
static const char * unitNm
char * internalname
Internal name of the track.
void * GfuiScreenCreateEx(float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
Create a screen.
tCarPitSetupValue thirdspring[2]
static void onSaveAndExit(void *vp)
void GfuiEditboxSetString(void *scr, int id, const char *text)
Set a new string.
static const char * unitcms
float tdble
Floating point type used in TORCS.
static void rmUpdateM(void *vp)
static void onActivate(void *vp)
tCarPitSetupValue susppackers[4]
tCarPitSetupValue wheelrideheight[4]
static const char * unitdeg
static tCarPitSetup * rmSetup
tTrack * track
Current track.
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
tCarPitSetupValue thirdrebound[2]
tCarPitSetupValue thirdbump[2]
tCarPitSetupValue suspfastbump[4]
void(* tfuiCallback)(void *)
This is the car structure.
tCarPitSetupValue wheelcamber[4]
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
int GfuiEnable(void *scr, int id, int flag)
Enable / Disable an object.
tCarPitSetupValue wingangle[2]
tCarPitSetupValue diffmintqbias[3]
tCarPitSetupValue suspreboundthreshold[4]
static void rmSet(void *vp)
Scalar min(Scalar x, Scalar y)
static const char * unitkpa
static void onLoad(void *vp)
static const char * setuplabel[6]
static const char * unitlbfins
tCarPitSetupValue suspfastrebound[4]
static void enableLoadButtons()
static const char * unitmm
tCarPitSetupValue suspspring[4]
tCarPitSetupValue wheelcaster[4]
tCarPitSetupValue diffslipbias[3]
static rtCarPitSetupType setuptype[6]
tCarPitSetupValue wheeltoe[4]
tCarPitSetupValue difflockinginputbraketq[3]
static const char * unitlbfin