31 #define NO_DRV "--- empty ---" 32 #define dllname "human" 96 #define _Name info.name 97 #define _DispName info.dispname 110 const int BUFSIZE = 1024;
182 const int BUFSIZE = 1024;
191 free(curCar->_DispName);
195 free(curCat->_DispName);
201 if ((curFile != NULL) && (curFile->
name[0] !=
'.')) {
203 curFile = curFile->
next;
206 char* str = strchr(curFile->
name,
'.');
208 curCat->_Name = strdup(curFile->
name);
209 snprintf(buf, BUFSIZE,
"categories/%s.xml", curFile->
name);
217 }
while (curFile != files);
223 if ((curFile != NULL) && (curFile->
name[0] !=
'.')) {
225 curFile = curFile->
next;
227 curCar->_Name = strdup(curFile->
name);
228 snprintf(buf, BUFSIZE,
"cars/%s/%s.xml", curFile->
name, curFile->
name);
238 if (curCat != NULL) {
240 if (strcmp(curCat->_Name, str) == 0) {
245 curCar->
cat = curCat;
248 }
while (curFile != files);
258 if (curCar == NULL) {
259 GfOut(
"Removing empty category %s\n", tmpCat->_DispName);
262 free(tmpCat->_DispName);
265 }
while (curCat != NULL);
280 for (i = 0; i <
NB_DRV; i++) {
310 const int SSTRINGSIZE = 256;
311 char sstring[SSTRINGSIZE];
319 const int BUFSIZE = 1024;
324 if (drvinfo == NULL) {
328 for (i = 0; i <
NB_DRV; i++) {
331 if (strlen(driver) == 0) {
359 if (strcmp(car->_Name, str) == 0) {
363 }
while (!found && ((car =
GF_TAILQ_NEXT(car, link)) != NULL));
365 }
while (!found && ((cat =
GF_TAILQ_NEXT(cat, link)) != NULL));
382 for (i = 0; i <
NB_DRV; i++) {
409 const int BUFSIZE = 1024;
414 if (drvinfo == NULL) {
418 for (i = 0; i <
NB_DRV; i++) {
438 for (i = 0; i <
NB_DRV; i++) {
476 const int BUFSIZE = 1024;
491 const int BUFSIZE = 1024;
546 }
while (car == NULL);
554 }
while (car == NULL);
585 long delta = (long)vdelta;
619 int x,
y, x2, x3, x4, dy;
620 static int firstTime = 1;
675 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
680 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
690 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
695 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
709 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
714 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
728 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
733 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
743 "data/img/arrow-left.png",
"data/img/arrow-left-pushed.png",
748 "data/img/arrow-right.png",
"data/img/arrow-right-pushed.png",
static int GenDrvList(void)
static void ChangeTrans(void *)
int GfParmSetStr(void *handle, const char *path, const char *key, const char *val)
Set a string parameter in the parameter set handle.
char * GfuiEditboxGetString(void *scr, int id)
Get the string.
static void GenCarsInfo(void)
static void ChangeName(void *)
void * GfParmReadFile(const char *file, int mode)
Read parameter set from file and return handle to parameter set.
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.
static const int nbLevels
#define GFPARM_RMODE_STD
if handle already openned return it
struct PlayerInfo tPlayerInfo
#define GF_TAILQ_INSERT_TAIL(head, elm, field)
Insert an element at the tail.
static tPlayerInfo * curPlayer
static void onSelect(void *)
static void DeletePlayer(void *)
int GfuiScrollListInsertElement(void *scr, int Id, char *element, int index, void *userData)
Insert an element in a scroll list.
void GfParmReleaseHandle(void *parmHandle)
Release given parameter set handle parmHandle.
static tCatsInfoHead CatsInfoList
void GfuiAddKey(void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Keyboard callback to a screen.
static float LabelColor[]
char * GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData)
Get the selected element from the scroll list.
static void ChangeLevel(void *vp)
Robot Module Interface Definition.
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.
tCarsInfoHead CarsInfoList
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.
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
List of (DLL) files for a Directory.
int GfParmWriteFile(const char *file, void *parmHandle, const char *name)
Write parameter set into file.
GF_TAILQ_ENTRY(struct tCarInfo) link
const char * GfParmGetStr(void *parmHandle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle.
The Gaming Framework API (client part).
static void ChangeCat(void *vp)
static tPlayerInfo PlayersInfo[NB_DRV]
char * GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
Extract the specified element from the scroll list.
static void ConfControls(void *)
void GfuiEditboxSetString(void *scr, int id, const char *text)
Set a new string.
struct FList * next
Next entry.
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
float tdble
Floating point type used in TORCS.
const char * transmission
int GfuiFontHeight(int font)
#define GFPARM_RMODE_REREAD
reread the parameters from file and release the previous ones
#define GF_TAILQ_INIT(head)
Head initialization (Mandatory)
void GfuiLabelSetColor(void *scr, int id, float *color)
Change the color of a label.
static const char * level_str[]
static void refreshEditVal(void)
static void SaveDrvList(void *)
void * TorcsDriverMenuInit(void *prevMenu)
void(* tfuiCallback)(void *)
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
void GfuiAddSKey(void *scr, int key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Special Keyboard shortcut to the screen.
void GfDirFreeList(tFList *list, tfDirfreeUserData freeUserData, bool freename, bool freedispname)
Free a directory list.
int GfuiEnable(void *scr, int id, int flag)
Enable / Disable an object.
static void ChangeReverse(void *vdelta)
#define GF_TAILQ_FIRST(head)
First element of a TAILQ.
#define GF_TAILQ_PREV(elm, headname, field)
Previous element of a TAILQ.
GF_TAILQ_ENTRY(struct tCatInfo) link
int GfParmSetNum(void *handle, const char *path, const char *key, const char *unit, tdble val)
Set a numerical parameter in the parameter set handle.
static void ChangeNum(void *)
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
#define GF_TAILQ_REMOVE(head, elm, field)
Remove an element.
void GfuiScreenShot(void *)
Save a screen shot in png format.
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
int GfuiScrollListCreate(void *scr, int font, int x, int y, int align, int width, int height, int scrollBarPos, void *userDataOnSelect, tfuiCallback onSelect)
Create a new scroll list.
int GfuiGrButtonCreate(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed, int x, int y, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a graphical button to a screen.
void * GfuiScreenCreate(void)
Create a new screen.
#define GF_TAILQ_NEXT(elm, field)
Next element of a TAILQ.
void * TorcsControlMenuInit(void *prevMenu, int idx)
static void UpdtScrollList(void)
#define GFUI_FONT_MEDIUM_C
Track Structure and Track Loader Module Definition.
#define GF_TAILQ_LAST(head, headname)
Last element of a TAILQ.
char * GfParmGetName(void *handle)
Get the name property of the parameter set handle.
static void ChangePits(void *)
tFList * GfDirGetList(const char *dir)
Get the list of files of a given directory.
#define GFPARM_RMODE_CREAT
Create the file if doesn't exist.
GF_TAILQ_HEAD(CarsInfoHead, struct tCarInfo)
#define HM_ATT_AUTOREVERSE
static void ChangeCar(void *vp)