TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
tgf.h
Go to the documentation of this file.
1/***************************************************************************
2 tgf.h -- Interface file for The Gaming Framework
3 -------------------
4 created : Fri Aug 13 22:32:14 CEST 1999
5 copyright : (C) 1999-2026 by Eric Espie, Bernhard Wymann
6 email : berniw@bluewin.ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
22
23
24
25#ifndef __TGF__H__
26#define __TGF__H__
27
28#include <stdio.h>
29#ifndef WIN32
30#include <sys/param.h>
31#include <assert.h>
32#endif /* WIN32 */
33#include <stdlib.h>
34#ifdef WIN32
35#include <windows.h>
36#endif
37#include <stdarg.h>
38#include <cstring>
39#include <math.h>
40#include <osspec.h>
41
42
43/* typedef double tdble; */
47typedef float tdble;
48
49extern void GfInit(void);
50
51#ifndef MAX
52#define MAX(x,y) ((x) > (y) ? (x) : (y))
53#endif
54
55#ifndef MIN
56#define MIN(x,y) ((x) < (y) ? (x) : (y))
57#endif
58
59#define FREEZ(x) do { \
60 if (x) { \
61 free(x); \
62 x = 0; \
63 } \
64} while (0)
65
66#define freez FREEZ
67
68const double PI = 3.14159265358979323846;
69const tdble G = 9.80665f;
70
71/* conversion */
72#define RADS2RPM(x) ((x)*9.549296585)
73#define RPM2RADS(x) ((x)*.104719755)
74#define RAD2DEG(x) ((x)*(180.0/PI))
75#define DEG2RAD(x) ((x)*(PI/180.0))
76#define FEET2M(x) ((x)*0.304801)
77#define SIGN(x) ((x) < 0.0f ? -1.0f : 1.0f)
78
80#define NORM0_2PI(x) \
81do { \
82 while ((x) > 2.0*PI) { (x) -= (tdble) (2.0*PI); } \
83 while ((x) < 0.0) { (x) += (tdble) (2.0*PI); } \
84} while (0)
85
87#define NORM_PI_PI(x) \
88do { \
89 while ((x) > PI) { (x) -= (tdble) (2.0*PI); } \
90 while ((x) < -PI) { (x) += (tdble) (2.0*PI); } \
91} while (0)
92
93
94#ifndef DIST
96#define DIST(x1, y1, x2, y2) sqrt(((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
97#endif
98
99#ifndef MIN
101#define MIN(x,y) ((x) < (y) ? (x) : (y))
102#endif
103
104
105typedef struct {
106 float x;
107 float y;
108 float z;
109} t3Df;
110
114typedef struct {
118} t3Dd;
119
120typedef struct {
121 int x;
122 int y;
123 int z;
124} t3Di;
125
137
141typedef struct
142{
146} tDynPt;
147
149typedef struct
150{
153} tForces;
154
155
156// <esppat>
157#ifdef WIN32
158#define malloc _tgf_win_malloc
159#define calloc _tgf_win_calloc
160#define realloc _tgf_win_realloc
161#define free _tgf_win_free
162#define strdup _tgf_win_strdup
163#define _strdup _tgf_win_strdup
164extern void * _tgf_win_malloc(size_t size);
165extern void * _tgf_win_calloc(size_t num, size_t size);
166extern void * _tgf_win_realloc(void * memblock, size_t size);
167extern void _tgf_win_free(void * memblock);
168extern char * _tgf_win_strdup(const char * str);
169#endif // WIN32
170// </esppat>
171
172/*********************************
173 * Interface For Dynamic Modules *
174 *********************************/
175
179typedef int (*tfModPrivInit)(int index, void *);
180
184#define MAX_MOD_ITF 10
185
187typedef struct ModInfo {
188 char *name;
189 char *desc;
191 unsigned int gfId;
192 int index;
193 int prio;
194 int magic;
195 enum { INVALID_INDEX = -9999 };
197
198/* module init function interface */
199typedef int (*tfModInfo)(tModInfo *); /* first function called in the module */
200
202typedef struct ModList {
204#ifdef _WIN32
205 HMODULE handle;
206#else
207 void *handle;
208#endif
209 char *sopath;
210 struct ModList *next;
212
213
214extern int GfModLoad(unsigned int gfid, char *dllname, tModList **modlist);
215extern int GfModLoadDir(unsigned int gfid, char *dir, tModList **modlist);
216extern int GfModUnloadList(tModList **modlist);
217extern int GfModInfo(unsigned int gfid, char *filename, tModList **modlist);
218extern int GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist);
219extern int GfModFreeInfoList(tModList **modlist);
220
221/************************
222 * Directory management *
223 ************************/
224
228typedef struct FList
229{
230 struct FList *next;
231 struct FList *prev;
232 char *name;
233 char *dispName;
234 void *userData;
236
237extern tFList *GfDirGetList(const char *dir);
238extern tFList *GfDirGetListFiltered(const char *dir, const char *suffix);
239typedef void (*tfDirfreeUserData)(void*);
240extern void GfDirFreeList(tFList *list, tfDirfreeUserData freeUserDatabool, bool freename = false, bool freedispname = false);
241
242
243/**********************************
244 * Interface For Parameter Files *
245 **********************************/
246
247/*
248 * This set of function is used to store and retrieve
249 * values in parameters files.
250 */
251
252
253/* parameters file type */
254#define GFPARM_PARAMETER 0
255#define GFPARM_TEMPLATE 1
256#define GFPARM_PARAM_STR "param"
257#define GFPARM_TEMPL_STR "template"
258
259/* parameters access mode */
260#define GFPARM_MODIFIABLE 1
261#define GFPARM_WRITABLE 2
262
263/* parameter file read */
264#define GFPARM_RMODE_STD 0x01
265#define GFPARM_RMODE_REREAD 0x02
266#define GFPARM_RMODE_CREAT 0x04
267#define GFPARM_RMODE_PRIVATE 0x08
268
269extern void *GfParmReadFile(const char *file, int mode);
270/* parameter file write */
271extern int GfParmWriteFile(const char *file, void* handle, const char *name);
272extern int GfParmCreateDirectory(const char *file, void *parmHandle);
273
274extern char *GfParmGetName(void *handle);
275extern char *GfParmGetFileName(void *handle);
276
277/* set the dtd and header values */
278extern void GfParmSetDTD (void *parmHandle, char *dtd, char*header);
279
280/* get string parameter value */
281extern const char *GfParmGetStr(void *handle, const char *path, const char *key, const char *deflt);
282/* get string parameter value */
283extern const char *GfParmGetCurStr(void *handle, const char *path, const char *key, const char *deflt);
284/* set string parameter value */
285extern int GfParmSetStr(void *handle, const char *path, const char *key, const char *val);
286/* set string parameter value */
287extern int GfParmSetCurStr(void *handle, const char *path, const char *key, const char *val);
288
289/* get num parameter value */
290extern tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt);
291/* get num parameter value */
292extern tdble GfParmGetCurNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt);
293/* set num parameter value */
294extern int GfParmSetNum(void *handle, const char *path, const char *key, const char *unit, tdble val);
295extern int GfParmSetNumEx(void *handle, const char *path, const char *key, const char *unit, tdble val, tdble min, tdble max);
296/* set num parameter value */
297extern int GfParmSetCurNum(void *handle, const char *path, const char *key, const char *unit, tdble val);
298
299
300/* clean all the parameters of a set */
301extern void GfParmClean(void *handle);
302/* clean the parms and release the handle without updating the file */
303extern void GfParmReleaseHandle(void *handle);
304
305/* Convert a value in "units" into SI */
306extern tdble GfParmUnit2SI(const char *unit, tdble val);
307/* convert a value in SI to "units" */
308extern tdble GfParmSI2Unit(const char *unit, tdble val);
309
310/* compare and merge different handles */
311extern int GfParmCheckHandle(void *ref, void *tgt);
312#define GFPARM_MMODE_SRC 1
313#define GFPARM_MMODE_DST 2
314#define GFPARM_MMODE_RELSRC 4
315#define GFPARM_MMODE_RELDST 8
316extern void *GfParmMergeHandles(void *ref, void *tgt, int mode);
317extern int GfParmGetNumBoundaries(void *handle, const char *path, const char *key, tdble *min, tdble *max);
318
319
320extern int GfParmGetEltNb(void *handle, const char *path);
321extern int GfParmListSeekFirst(void *handle, const char *path);
322extern int GfParmListSeekNext(void *handle, const char *path);
323extern char *GfParmListGetCurEltName(void *handle, const char *path);
324extern int GfParmListClean(void *handle, const char *path);
325
326/*******************
327 * Trace Interface *
328 *******************/
329
330#ifdef WIN32
331#define GfTrace printf
332#define GfFatal printf
333#else
334
335#define GfTrace printf
336
337static inline void
338GfFatal(const char *fmt, ...)
339{
340 va_list ap;
341 va_start(ap, fmt);
342 vprintf(fmt, ap);
343 va_end(ap);
344 /* GfScrShutdown(); */
345 assert (0);
346 exit (1);
347}
348#endif
349
350#define GfError printf
351
352#if !(_DEBUG || DEBUG)
353//#ifdef WIN32
354//#define GfOut printf
355//#else
356
357
363static inline void
364GfOut(const char *fmt, ...)
365{
366}
367
368//#endif /* WIN32 */
369
370#else /* _DEBUG || DEBUG */
371
372#define GfOut printf
373
374#endif /* _DEBUG || DEBUG */
375
376/*******************
377 * Time Interface *
378 *******************/
379extern double GfTimeClock(void);
380
381/* Mean values */
382#define GF_MEAN_MAX_VAL 5
383
384typedef struct
385{
388} tMeanVal;
389
390extern tdble gfMean(tdble v, tMeanVal *pvt, int n, int w);
391extern void gfMeanReset(tdble v, tMeanVal *pvt);
392
393/* MISC */
394extern char *GetLocalDir(void);
395extern void SetLocalDir(char *buf);
396extern char *GetLibDir(void);
397extern void SetLibDir(char *buf);
398extern char *GetDataDir(void);
399extern void SetDataDir(char *buf);
400extern int GetSingleTextureMode (void);
401extern void SetSingleTextureMode (void);
402extern int GfNearestPow2 (int x);
403extern int GfCreateDir(char *path);
404extern int GfCreateDirForFile(const char *filenameandpath);
405
406
407/*
408 * Copyright (c) 1991, 1993
409 * The Regents of the University of California. All rights reserved.
410 *
411 * Redistribution and use in source and binary forms, with or without
412 * modification, are permitted provided that the following conditions
413 * are met:
414 * 1. Redistributions of source code must retain the above copyright
415 * notice, this list of conditions and the following disclaimer.
416 * 2. Redistributions in binary form must reproduce the above copyright
417 * notice, this list of conditions and the following disclaimer in the
418 * documentation and/or other materials provided with the distribution.
419 * 3. All advertising materials mentioning features or use of this software
420 * must display the following acknowledgement:
421 * This product includes software developed by the University of
422 * California, Berkeley and its contributors.
423 * 4. Neither the name of the University nor the names of its contributors
424 * may be used to endorse or promote products derived from this software
425 * without specific prior written permission.
426 *
427 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
428 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
429 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
430 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
431 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
432 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
433 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
434 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
435 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
436 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
437 * SUCH DAMAGE.
438 *
439 * @(#)queue.h 8.5 (Berkeley) 8/20/94
440 */
441
442/*
443 * Tail queue definitions.
444 */
447#define GF_TAILQ_HEAD(name, type) \
448typedef struct name { \
449 type *tqh_first; /* first element */ \
450 type **tqh_last; /* addr of last next element */ \
451} t ## name
452
455#define GF_TAILQ_ENTRY(type) \
456struct { \
457 type *tqe_next; /* next element */ \
458 type **tqe_prev; /* address of previous next element */ \
459}
460
463#define GF_TAILQ_FIRST(head) ((head)->tqh_first)
466#define GF_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
469#define GF_TAILQ_END(head) NULL
472#define GF_TAILQ_LAST(head, headname) \
473 (*(((struct headname *)((head)->tqh_last))->tqh_last))
474
476#define GF_TAILQ_PREV(elm, headname, field) \
477 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
478
479/*
480 * Tail queue functions.
481 */
484#define GF_TAILQ_INIT(head) do { \
485 (head)->tqh_first = NULL; \
486 (head)->tqh_last = &(head)->tqh_first; \
487} while (0)
488
491#define GF_TAILQ_INIT_ENTRY(elm, field) do { \
492 (elm)->field.tqe_next = 0; \
493 (elm)->field.tqe_prev = 0; \
494} while (0)
495
498#define GF_TAILQ_INSERT_HEAD(head, elm, field) do { \
499 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
500 (head)->tqh_first->field.tqe_prev = \
501 &(elm)->field.tqe_next; \
502 else \
503 (head)->tqh_last = &(elm)->field.tqe_next; \
504 (head)->tqh_first = (elm); \
505 (elm)->field.tqe_prev = &(head)->tqh_first; \
506} while (0)
507
510#define GF_TAILQ_INSERT_TAIL(head, elm, field) do { \
511 (elm)->field.tqe_next = NULL; \
512 (elm)->field.tqe_prev = (head)->tqh_last; \
513 *(head)->tqh_last = (elm); \
514 (head)->tqh_last = &(elm)->field.tqe_next; \
515} while (0)
516
519#define GF_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
520 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
521 (elm)->field.tqe_next->field.tqe_prev = \
522 &(elm)->field.tqe_next; \
523 else \
524 (head)->tqh_last = &(elm)->field.tqe_next; \
525 (listelm)->field.tqe_next = (elm); \
526 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
527} while (0)
528
531#define GF_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
532 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
533 (elm)->field.tqe_next = (listelm); \
534 *(listelm)->field.tqe_prev = (elm); \
535 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
536} while (0)
537
540#define GF_TAILQ_REMOVE(head, elm, field) do { \
541 if (((elm)->field.tqe_next) != NULL) \
542 (elm)->field.tqe_next->field.tqe_prev = \
543 (elm)->field.tqe_prev; \
544 else \
545 (head)->tqh_last = (elm)->field.tqe_prev; \
546 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
547} while (0)
548
549
550/* author : Henrik Enqvist IB (henqvist@abo.fi) */
551#ifdef PROFILER
552
553#include <vector>
554#include <map>
555
556#define START_PROFILE(name) Profiler::getInstance()->startProfile(name)
557#define STOP_PROFILE(name) Profiler::getInstance()->stopProfile()
558#define STOP_ACTIVE_PROFILES() Profiler::getInstance()->stopActiveProfiles()
559#define PRINT_PROFILE() Profiler::getInstance()->printProfile()
560
561class ProfileInstance {
562 public:
563 ProfileInstance(const char * pname);
564 ~ProfileInstance();
565 char name[256];
566 int calls;
567 int openCalls;
568 double totalTime;
569 double addTime;
570 double subTime;
571 double tmpStart;
572 std::map<ProfileInstance *, void *> mapChildren;
573};
574
576class Profiler {
577 protected:
578 Profiler();
579 public:
580 ~Profiler();
581 static Profiler * getInstance();
582 void startProfile(const char * pname);
583 void stopProfile();
584 void stopActiveProfiles();
585 void printProfile();
586 private:
587 static Profiler * profiler;
588 ProfileInstance * curProfile;
589 double fStartTime;
590 std::vector<ProfileInstance *> vecProfiles;
591 std::vector<ProfileInstance *> stkProfiles;
592 std::map<ProfileInstance *, void *> mapWarning;
593};
594
595#else /* PROFILER */
596#define START_PROFILE(a)
597#define STOP_PROFILE(a)
598#define STOP_ACTIVE_PROFILES()
599#define PRINT_PROFILE()
600#endif
601
602/*******************/
603/* Hash Tables */
604/*******************/
605#define GF_HASH_TYPE_STR 0
606#define GF_HASH_TYPE_BUF 1
607
608typedef void (*tfHashFree)(const void*);
609
610void *GfHashCreate(int type);
611int GfHashAddStr(void *hash, const char *key, const void *data);
612const void *GfHashRemStr(void *hash, char *key);
613const void *GfHashGetStr(void *hash, const char *key);
614void GfHashAddBuf(void *hash, char *key, size_t sz, void *data);
615const void *GfHashRemBuf(void *hash, char *key, size_t sz);
616const void *GfHashGetBuf(void *hash, char *key, size_t sz);
617void GfHashRelease(void *hash, tfHashFree hashFree);
618const void *GfHashGetFirst(void *hash);
619const void *GfHashGetNext(void *hash);
620
621#define GF_DIR_CREATION_FAILED 0
622#define GF_DIR_CREATED 1
623
624#endif /* __TGF__H__ */
Scalar min(Scalar x, Scalar y)
Definition Basic.h:49
Scalar max(Scalar x, Scalar y)
Definition Basic.h:50
static const double PI
#define dllname
float tdble
Floating point type used in TORCS.
Definition tgf.h:47
tFList * GfDirGetListFiltered(const char *dir, const char *suffix)
Get the list of files with matching suffix of a given directory.
Definition directory.cpp:59
void GfDirFreeList(tFList *list, tfDirfreeUserData freeUserDatabool, bool freename=false, bool freedispname=false)
Free a directory list.
Definition directory.cpp:75
tFList * GfDirGetList(const char *dir)
Get the list of files of a given directory.
Definition directory.cpp:43
const void * GfHashRemStr(void *hash, char *key)
Remove an element with a string key from a hash table.
Definition hash.cpp:219
const void * GfHashGetFirst(void *hash)
Get the first user data of a hash table, this is used for table scans.
Definition hash.cpp:379
void GfHashAddBuf(void *hash, char *key, size_t sz, void *data)
Add an element with a memory buffer key to a hash table.
Definition hash.cpp:271
void GfHashRelease(void *hash, tfHashFree hashFree)
Release a hash table.
Definition hash.cpp:353
int GfHashAddStr(void *hash, const char *key, const void *data)
Add an element with a string key to a hash table.
Definition hash.cpp:170
const void * GfHashGetStr(void *hash, const char *key)
Get the user data associated with a string key.
Definition hash.cpp:245
const void * GfHashRemBuf(void *hash, char *key, size_t sz)
Remove an element with a memory buffer key from a hash table.
Definition hash.cpp:303
const void * GfHashGetBuf(void *hash, char *key, size_t sz)
Get the user data associated with a memory buffer key.
Definition hash.cpp:330
void * GfHashCreate(int type)
Create a new hash table.
Definition hash.cpp:98
const void * GfHashGetNext(void *hash)
Get the next user data of a hash table, this is used for table scans.
Definition hash.cpp:396
int GfModUnloadList(tModList **modlist)
Unload the DLLs of a list.
Definition module.cpp:91
int GfModLoad(unsigned int gfid, char *dllname, tModList **modlist)
Load the specified DLLs.
Definition module.cpp:57
int GfModInfo(unsigned int gfid, char *filename, tModList **modlist)
Get the generic information of the specified DLL.
Definition module.cpp:110
int GfModFreeInfoList(tModList **modlist)
Free the info contained in the specified list.
Definition module.cpp:145
int GfModInfoDir(unsigned int gfid, char *dir, int level, tModList **modlist)
Get the generic module information of the DLLs of the specified directory.
Definition module.cpp:129
int GfModLoadDir(unsigned int gfid, char *dir, tModList **modlist)
Load the DLLs in the specified directory.
Definition module.cpp:75
int GfParmSetNumEx(void *handle, const char *path, const char *key, const char *unit, tdble val, tdble min, tdble max)
Set a numerical parameter and its bounds, creating it if necessary.
Definition params.cpp:2783
const char * GfParmGetStr(void *handle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle.
Definition params.cpp:2453
int GfParmSetStr(void *handle, const char *path, const char *key, const char *val)
Set a string parameter in the parameter set handle.
Definition params.cpp:2623
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
tdble GfParmUnit2SI(const char *unit, tdble val)
Convert a value given in unit to SI.
Definition params.cpp:2079
char * GfParmGetName(void *handle)
Get the name property of the parameter set handle.
Definition params.cpp:2192
tdble GfParmSI2Unit(const char *unit, tdble val)
Convert a value from SI to given unit.
Definition params.cpp:2133
int GfParmGetNumBoundaries(void *handle, const char *path, const char *key, tdble *min, tdble *max)
Get the min and max of a numerical parameter from the parameter set handle.
Definition params.cpp:3268
int GfParmSetNum(void *handle, const char *path, const char *key, const char *unit, tdble val)
Set a numerical parameter in the parameter set handle.
Definition params.cpp:2737
void GfParmReleaseHandle(void *handle)
Release given parameter set handle parmHandle.
Definition params.cpp:1963
int GfParmCreateDirectory(const char *file, void *parmHandle)
Create directory for parameter set handle if it does not yet exist.
Definition params.cpp:1793
char * GfParmGetFileName(void *handle)
Get the filename property of the parameter set handle.
Definition params.cpp:2218
void GfParmClean(void *handle)
Clean all the parameters of a parameter set.
Definition params.cpp:1870
int GfParmWriteFile(const char *file, void *handle, const char *name)
Write parameter set into file.
Definition params.cpp:1732
int GfParmCheckHandle(void *ref, void *tgt)
Check the values in the parameter set tgt against the min/max/within definitions in the ref parameter...
Definition params.cpp:2885
void * GfParmMergeHandles(void *ref, void *tgt, int mode)
Merge two parameter sets into a new private set.
Definition params.cpp:3129
void GfParmSetDTD(void *parmHandle, char *dtd, char *header)
Set the dtd path and header.
Definition params.cpp:1704
void * GfParmReadFile(const char *file, int mode)
Read parameter set from file and return handle to parameter set.
Definition params.cpp:1173
char * GfParmListGetCurEltName(void *handle, const char *path)
Get current subsection name of the parameter set handle during subsection iteration.
Definition params.cpp:2410
int GfParmListSeekNext(void *handle, const char *path)
Advance to the next immediate subsection.
Definition params.cpp:2323
int GfParmListClean(void *handle, const char *path)
Remove all the subsections in a section in the parameter set handle.
Definition params.cpp:2362
int GfParmListSeekFirst(void *handle, const char *path)
Select the first immediate subsection of a section.
Definition params.cpp:2286
int GfParmGetEltNb(void *handle, const char *path)
Count the number of subsections in a section in the parameter set handle.
Definition params.cpp:2243
int GfParmSetCurNum(void *handle, const char *path, const char *key, const char *unit, tdble val)
Set a numerical parameter in the parameter set handle based on subsection iteration.
Definition params.cpp:2834
int GfParmSetCurStr(void *handle, const char *path, const char *key, const char *val)
Set a string parameter in the parameter set handle based on subsection iteration.
Definition params.cpp:2682
tdble GfParmGetCurNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle based on subsection iteration.
Definition params.cpp:2578
const char * GfParmGetCurStr(void *handle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle based on subsection iteration.
Definition params.cpp:2496
List of (DLL) files for a Directory.
Definition tgf.h:229
struct FList * next
Next entry.
Definition tgf.h:230
struct FList * prev
Previous entry.
Definition tgf.h:231
char * name
File name.
Definition tgf.h:232
char * dispName
Name to display on screen.
Definition tgf.h:233
void * userData
User data.
Definition tgf.h:234
Module information structure.
Definition tgf.h:187
char * desc
description of the module (can be long)
Definition tgf.h:189
int index
index if multiple interface in one dll
Definition tgf.h:192
int prio
priority if needed
Definition tgf.h:193
unsigned int gfId
supported framework version
Definition tgf.h:191
@ INVALID_INDEX
Definition tgf.h:195
char * name
name of the module (short) (NULL if no module)
Definition tgf.h:188
tfModPrivInit fctInit
init function
Definition tgf.h:190
int magic
magic number for integrity check
Definition tgf.h:194
list of module interfaces
Definition tgf.h:202
tModInfo modInfo[MAX_MOD_ITF]
module info list for this dll
Definition tgf.h:203
char * sopath
path name of file
Definition tgf.h:209
void * handle
handle of loaded module
Definition tgf.h:207
struct ModList * next
next module in list
Definition tgf.h:210
Parameter set handle structure, multiple handles can reference the same parameter set.
Definition params.cpp:125
3D point.
Definition tgf.h:114
tdble y
y coordinate
Definition tgf.h:116
tdble z
z coordinate
Definition tgf.h:117
tdble x
x coordinate
Definition tgf.h:115
Definition tgf.h:105
float x
Definition tgf.h:106
float y
Definition tgf.h:107
float z
Definition tgf.h:108
Definition tgf.h:120
int x
Definition tgf.h:121
int y
Definition tgf.h:122
int z
Definition tgf.h:123
Dynamic point structure.
Definition tgf.h:142
tPosd acc
acceleration
Definition tgf.h:145
tPosd vel
velocity
Definition tgf.h:144
tPosd pos
position
Definition tgf.h:143
Forces and moments.
Definition tgf.h:150
t3Dd F
Forces.
Definition tgf.h:151
t3Dd M
Moments.
Definition tgf.h:152
tdble val[GF_MEAN_MAX_VAL+1]
Definition tgf.h:387
int curNum
Definition tgf.h:386
6 DOF position.
Definition tgf.h:129
tdble y
y coordinate
Definition tgf.h:131
tdble x
x coordinate
Definition tgf.h:130
tdble z
z coordinate
Definition tgf.h:132
tdble ay
angle along y axis
Definition tgf.h:134
tdble ax
angle along x axis
Definition tgf.h:133
tdble az
angle along z axis
Definition tgf.h:135
#define GfOut
Definition tgf.h:372
void(* tfDirfreeUserData)(void *)
Function to call for releasing the user data associated with file entry.
Definition tgf.h:239
void SetDataDir(char *buf)
Definition tgf.cpp:262
void SetSingleTextureMode(void)
Definition tgf.cpp:278
int GfNearestPow2(int x)
Definition tgf.cpp:284
void gfMeanReset(tdble v, tMeanVal *pvt)
Definition tgf.cpp:147
void SetLocalDir(char *buf)
Definition tgf.cpp:236
const tdble G
m/s/s
Definition tgf.h:69
int GfCreateDir(char *path)
Create directory for given path recursively, so all missing parent directories are created as well.
Definition tgf.cpp:308
#define MAX_MOD_ITF
Maximum number of interface in one DLL.
Definition tgf.h:184
void(* tfHashFree)(const void *)
Function to call for releasing the user data associated with hash table.
Definition tgf.h:608
struct ModList tModList
list of module interfaces
char * GetDataDir(void)
Definition tgf.cpp:256
static void GfFatal(const char *fmt,...)
Definition tgf.h:338
void GfInit(void)
Definition tgf.cpp:138
int GfCreateDirForFile(const char *filenameandpath)
Create directory for given file path recursively, so all missing parent directories are created as we...
Definition tgf.cpp:368
int GetSingleTextureMode(void)
Definition tgf.cpp:272
double GfTimeClock(void)
Get the time in seconds.
Definition os.cpp:50
#define GF_MEAN_MAX_VAL
Definition tgf.h:382
int(* tfModPrivInit)(int index, void *)
initialisation of the function table
Definition tgf.h:179
char * GetLibDir(void)
Definition tgf.cpp:243
struct FList tFList
List of (DLL) files for a Directory.
tdble gfMean(tdble v, tMeanVal *pvt, int n, int w)
Definition tgf.cpp:157
int(* tfModInfo)(tModInfo *)
Definition tgf.h:199
char * GetLocalDir(void)
Definition tgf.cpp:230
void SetLibDir(char *buf)
Definition tgf.cpp:249
struct ModInfo tModInfo
Module information structure.