47 static float aColor[] = { 1.0, 0.0, 0.0, 1.0 };
105 const int BUFSIZE = 1024;
113 while (name != NULL) {
137 const int BUFSIZE = 1024;
148 snprintf(buf, BUFSIZE,
"%sdrivers/%s/%s.xml",
GetLocalDir(), curDrv->dname, curDrv->dname);
152 snprintf(buf, BUFSIZE,
"drivers/%s/%s.xml", curDrv->dname, curDrv->dname);
156 if (robhdle != NULL) {
207 if ((curDrv->
index == robotIdx) && (strcmp(curDrv->
dname, cardllname) == 0)) {
221 if ((strlen(cardllname) == 0) || (curDrv->
human)) {
261 const int BUFSIZE = 1024;
315 snprintf(buf, BUFSIZE,
"%sdrivers",
GetLibDir ());
319 if (curmod != NULL) {
321 curmod = curmod->
next;
324 sp = strrchr(curmod->
sopath,
'/');
331 dname[strlen(dname) - strlen(DLLEXT) - 1] = 0;
332 snprintf(buf, BUFSIZE,
"%sdrivers/%s/%s.xml",
GetLocalDir(), dname, dname);
335 snprintf(buf, BUFSIZE,
"drivers/%s/%s.xml", dname, dname);
345 snprintf(path, BUFSIZE,
"cars/%s/%s.xml", carName, carName);
346 if (!stat(path, &st)) {
351 curDrv->
dname = strdup(dname);
353 curDrv->
car = carhdle;
362 GfOut(
"Driver %s not selected because car %s is not readable\n", curmod->
modInfo[i].
name, carName);
365 GfOut(
"Driver %s not selected because car %s is not present\n", curmod->
modInfo[i].
name, carName);
370 }
while (curmod != list);
379 for (i = 1; i < nCars+1; i++) {
386 if (curDrv != NULL) {
388 if ((curDrv->
index == robotIdx || strcmp(curDrv->
name, robotName) == 0) && (strcmp(curDrv->
dname, cardllname) == 0)) {
391 curDrv->sel = index++;
401 if (curDrv != NULL) {
403 if (curDrv->
sel == 0) {
413 if (curDrv != NULL) {
415 if ((curDrv->
index == robotIdx) && (strcmp(curDrv->
dname, cardllname) == 0)) {
421 if (curDrv == NULL) {
425 if (curDrv == NULL) {
int GfParmSetStr(void *handle, const char *path, const char *key, const char *val)
Set a string parameter in the parameter set handle.
char * GfuiScrollListExtractSelectedElement(void *scr, int Id, void **userData)
Extract the selected element from the scroll list (removed).
tModInfo modInfo[MAX_MOD_ITF]
module info list for this dll
void * GfParmReadFile(const char *file, int mode)
Read parameter set from file and return handle to parameter set.
static void rmdsDeactivate(void *screen)
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.
int GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist)
Get the generic module information of the DLLs of the specified directory.
static void rmdsActivate(void *)
#define GFPARM_RMODE_STD
if handle already openned return it
#define GF_TAILQ_INSERT_TAIL(head, elm, field)
Insert an element at the tail.
struct ModList * next
next module in list
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.
#define RM_ATTR_FOCUSEDIDX
void GfuiAddKey(void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Keyboard callback to a screen.
char * GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData)
Get the selected element from the scroll list.
Robot Module Interface Definition.
#define MAX_MOD_ITF
Maximum number of interface in one DLL.
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.
#define GF_TAILQ_INSERT_HEAD(head, elm, field)
Insert an element at the head.
static void rmdsSetFocus(void *)
void * prevScreen
Race manager screen to go back.
static void rmFreeDrvList(void)
int GfuiScrollListMoveSelectedElement(void *scr, int Id, int delta)
Move the selected element within the scroll list.
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
static void rmdsSelect(void *)
static void rmdsAddKeys(void)
static void rmSelectDeselect(void *)
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 int selectedScrollList
static void rmdsClickOnDriver(void *)
static int PickDrvCategoryLabelId
GF_TAILQ_ENTRY(struct DrvElt) link
char * GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
Extract the specified element from the scroll list.
void * GfuiScreenCreateEx(float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
Create a screen.
static int nbMaxSelectedDrivers
static int nbSelectedDrivers
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
int GfuiFontHeight(int font)
char * GfuiScrollListGetElement(void *scr, int Id, int index, void **userData)
Get the specified element from the scroll list.
char * sopath
path name of file
#define GF_TAILQ_INIT(head)
Head initialization (Mandatory)
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
static int PickDrvCarLabelId
int GfModFreeInfoList(tModList **modlist)
Free the info contained in the specified list.
static int unselectedScrollList
void(* tfuiCallback)(void *)
This is the car structure.
This is the race information structures.
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.
#define GF_TAILQ_FIRST(head)
First element of a TAILQ.
int GfParmSetNum(void *handle, const char *path, const char *key, const char *unit, tdble val)
Set a numerical parameter in 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.
static void rmMove(void *vd)
void GfuiHelpScreen(void *prevScreen)
Generate a help screen.
#define GF_TAILQ_REMOVE(head, elm, field)
Remove an element.
int GfParmListClean(void *handle, const char *path)
Remove all the subsections in a section in the parameter set handle.
void GfuiScreenShot(void *)
Save a screen shot in png format.
char * name
name of the module (short) (NULL if no module)
int index
index if multiple interface in one dll
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 GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
void * param
Pointer to race manager parameter set (to set the driver)
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.
GF_TAILQ_HEAD(DrvListHead, tDrvElt)
#define GF_TAILQ_NEXT(elm, field)
Next element of a TAILQ.
#define GFUI_FONT_MEDIUM_C
int GfParmGetEltNb(void *handle, const char *path)
Count the number of subsections in a section in the parameter set handle.
void * nextScreen
Race manager screen to go after select.
list of module interfaces
Track Structure and Track Loader Module Definition.
Structure for driver selection.
char * GfParmGetName(void *handle)
Get the name property of the parameter set handle.
static int PickDrvNameLabelId