TORCS  1.3.9
The Open Racing Car Simulator
simuitf.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  file : simuitf.cpp
4  created : Sun Mar 19 00:08:04 CET 2000
5  copyright : (C) 2000-2017 by Eric Espie, Bernhard Wymann
6  email : torcs@free.fr
7  version : $Id$
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #include <stdlib.h>
21 
22 #include <tgf.h>
23 
24 #include "sim.h"
25 
26 #ifdef _WIN32
27 BOOL WINAPI DllEntryPoint (HINSTANCE hDLL, DWORD dwReason, LPVOID Reserved)
28 {
29  return TRUE;
30 }
31 #endif
32 
33 /*
34  * Function
35  * simuInit
36  *
37  * Description
38  * init the simu functions
39  *
40  * Parameters
41  *
42  *
43  * Return
44  *
45  *
46  * Remarks
47  *
48  */
49 static int
50 simuInit(int /* index */, void *pt)
51 {
52  tSimItf *sim = (tSimItf*)pt;
53 
54  sim->init = SimInit;
55  sim->config = SimConfig;
56  sim->reconfig = SimReConfig;
57  sim->update = SimUpdate;
58  sim->shutdown = SimShutdown;
59 
60  return 0;
61 }
62 
63 
64 /*
65  * Function
66  * simuv1
67  *
68  * Description
69  * DLL entry point
70  *
71  * Parameters
72  *
73  *
74  * Return
75  *
76  *
77  * Remarks
78  *
79  */
80 extern "C" int
81 simuv2(tModInfo *modInfo)
82 {
83  modInfo->name = strdup("simu"); /* name of the module (short) */
84  modInfo->desc = strdup("Simulation Engine V2.0"); /* description of the module (can be long) */
85  modInfo->fctInit = simuInit; /* init function */
86  modInfo->gfId = SIM_IDENT; /* ident */
87  modInfo->index = 0;
88  return 0;
89 }
90 
91 
92 
unsigned int gfId
supported framework version
Definition: tgf.h:192
static int simuInit(int, void *pt)
Definition: simuitf.cpp:50
int simuv2(tModInfo *modInfo)
Definition: simuitf.cpp:81
tfModPrivInit fctInit
init function
Definition: tgf.h:191
The Gaming Framework API.
tfSimInit init
Definition: simu.h:86
void SimReConfig(tCarElt *carElt)
Definition: simu.cpp:139
tfSimReConfig reconfig
Definition: simu.h:88
tfSimShutdown shutdown
Definition: simu.h:90
void SimInit(int nbcars, tTrack *track, tdble fuelFactor, tdble damageFactor, tdble tireFactor)
Definition: simu.cpp:463
char * name
name of the module (short) (NULL if no module)
Definition: tgf.h:189
int index
index if multiple interface in one dll
Definition: tgf.h:193
Interface Structure for Simulation.
Definition: simu.h:84
void SimConfig(tCarElt *carElt, RmInfo *)
Definition: simu.cpp:119
tfSimUpdate update
Definition: simu.h:89
#define SIM_IDENT
Definition: simu.h:40
char * desc
description of the module (can be long)
Definition: tgf.h:190
void SimUpdate(tSituation *, double deltaTime, int telemetry)
Definition: simu.cpp:323
tfSimConfig config
Definition: simu.h:87
Module information structure.
Definition: tgf.h:188
void SimShutdown(void)
Definition: simu.cpp:474