TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
joystickconfig.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <tgfclient.h>
#include <track.h>
#include <robot.h>
#include "driverconfig.h"
#include <playerpref.h>
#include <portability.h>
#include <plib/js.h>
#include "controlconfig.h"
#include "joystickconfig.h"
Include dependency graph for joystickconfig.cpp:

Go to the source code of this file.

Macros

#define NB_STEPS   6
#define OFFSET_CMD   6

Functions

static void advanceStep (void)
static void JoyCalAutomaton (void)
static void Idle2 (void)
static void onActivate (void)
void * JoyCalMenuInit (void *prevMenu, tCmdInfo *cmd, int maxcmd, void *parmhandle, const char *driversection)

Variables

static void * scrHandle2 = NULL
static tCmdInfo * Cmd
static int maxCmd
static void * parmHandle
static const char * driverSection
static jsJoystick * js [NUM_JOY] = {NULL}
static float ax [_JS_MAX_AXES *NUM_JOY] = {0}
static int rawb [NUM_JOY] = {0}
static double axisPressedTime = 0.0
static const char * Instructions []
static int CalState
static int InstId
static const char * LabName [] = { "Steer", "Throttle", "Brake", "Clutch" }
static int LabAxisId [4]
static int LabMinId [4]
static int LabMaxId [4]
static float axCenter [_JS_MAX_AXES *NUM_JOY]

Macro Definition Documentation

◆ NB_STEPS

#define NB_STEPS   6

Definition at line 49 of file joystickconfig.cpp.

◆ OFFSET_CMD

#define OFFSET_CMD   6

Definition at line 52 of file joystickconfig.cpp.

Function Documentation

◆ advanceStep()

void advanceStep ( void )
static

Definition at line 76 of file joystickconfig.cpp.

◆ Idle2()

void Idle2 ( void )
static

Definition at line 133 of file joystickconfig.cpp.

Here is the call graph for this function:

◆ JoyCalAutomaton()

void JoyCalAutomaton ( void )
static

Definition at line 84 of file joystickconfig.cpp.

Here is the call graph for this function:

◆ JoyCalMenuInit()

void * JoyCalMenuInit ( void * prevMenu,
tCmdInfo * cmd,
int maxcmd,
void * parmhandle,
const char * driversection )

Definition at line 211 of file joystickconfig.cpp.

Here is the call graph for this function:

◆ onActivate()

void onActivate ( void )
static

Definition at line 176 of file joystickconfig.cpp.

Here is the call graph for this function:

Variable Documentation

◆ ax

float ax[_JS_MAX_AXES *NUM_JOY] = {0}
static

Definition at line 42 of file joystickconfig.cpp.

◆ axCenter

float axCenter[_JS_MAX_AXES *NUM_JOY]
static

Definition at line 74 of file joystickconfig.cpp.

◆ axisPressedTime

double axisPressedTime = 0.0
static

Definition at line 47 of file joystickconfig.cpp.

◆ CalState

int CalState
static

Definition at line 65 of file joystickconfig.cpp.

◆ Cmd

tCmdInfo* Cmd
static

Definition at line 35 of file joystickconfig.cpp.

◆ driverSection

const char* driverSection
static

Definition at line 38 of file joystickconfig.cpp.

◆ InstId

int InstId
static

Definition at line 66 of file joystickconfig.cpp.

◆ Instructions

const char* Instructions[]
static
Initial value:
= {
"Center the joystick then press a button for more than 0.2s",
"Steer left then press a button for more than 0.2s",
"Steer right then press a button for more than 0.2s",
"Apply full throttle then press a button for more than 0.2s",
"Apply full brake then press a button for more than 0.2s",
"Apply full clutch then press a button for more than 0.2s",
"Calibration successfully done",
"Calibration failed"
}

Definition at line 54 of file joystickconfig.cpp.

◆ js

jsJoystick* js[NUM_JOY] = {NULL}
static

Definition at line 40 of file joystickconfig.cpp.

◆ LabAxisId

int LabAxisId[4]
static

Definition at line 69 of file joystickconfig.cpp.

◆ LabMaxId

int LabMaxId[4]
static

Definition at line 71 of file joystickconfig.cpp.

◆ LabMinId

int LabMinId[4]
static

Definition at line 70 of file joystickconfig.cpp.

◆ LabName

const char* LabName[] = { "Steer", "Throttle", "Brake", "Clutch" }
static

Definition at line 68 of file joystickconfig.cpp.

◆ maxCmd

int maxCmd
static

Definition at line 36 of file joystickconfig.cpp.

◆ parmHandle

void* parmHandle
static

Definition at line 37 of file joystickconfig.cpp.

◆ rawb

int rawb[NUM_JOY] = {0}
static

Definition at line 43 of file joystickconfig.cpp.

◆ scrHandle2

void* scrHandle2 = NULL
static

Definition at line 33 of file joystickconfig.cpp.