OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4ConfigGamepad Class Reference

#include <C4Config.h>

Public Member Functions

void CompileFunc (StdCompiler *pComp, bool fButtonsOnly=false)
 
void ResetButtons ()
 
void Reset ()
 

Public Attributes

int32_t Button [C4MaxKey]
 
uint32_t AxisMin [6]
 
uint32_t AxisMax [6]
 
bool AxisCalibrated [6]
 

Detailed Description

Definition at line 216 of file C4Config.h.

Member Function Documentation

void C4ConfigGamepad::CompileFunc ( StdCompiler pComp,
bool  fButtonsOnly = false 
)

Definition at line 224 of file C4Config.cpp.

References AxisCalibrated, AxisMax, AxisMin, Button, FormatString(), mkNamingAdapt(), and StdCompiler::Value().

225 {
226  /* The defaults here are for a Logitech Dual Action under Linux-SDL. Better than nothing, I guess. */
227  if (!fButtonsOnly)
228  {
229  for (int i=0; i<6; ++i)
230  {
231  pComp->Value(mkNamingAdapt(AxisMin[i], FormatString("Axis%dMin", i).getData(), 0u));
232  pComp->Value(mkNamingAdapt(AxisMax[i], FormatString("Axis%dMax", i).getData(), 0u));
233  pComp->Value(mkNamingAdapt(AxisCalibrated[i], FormatString("Axis%dCalibrated", i).getData(), false));
234  }
235  }
236  pComp->Value(mkNamingAdapt(Button[0], "Button1", -1 ));
237  pComp->Value(mkNamingAdapt(Button[1], "Button2", -1 ));
238  pComp->Value(mkNamingAdapt(Button[2], "Button3", -1 ));
239  pComp->Value(mkNamingAdapt(Button[3], "Button4", -1 ));
240  pComp->Value(mkNamingAdapt(Button[4], "Button5", -1 ));
241  pComp->Value(mkNamingAdapt(Button[5], "Button6", -1 ));
242  pComp->Value(mkNamingAdapt(Button[6], "Button7", -1 ));
243  pComp->Value(mkNamingAdapt(Button[7], "Button8", -1 ));
244  pComp->Value(mkNamingAdapt(Button[8], "Button9", -1 ));
245  pComp->Value(mkNamingAdapt(Button[9], "Button10", -1 ));
246  pComp->Value(mkNamingAdapt(Button[10], "Button11", -1 ));
247  pComp->Value(mkNamingAdapt(Button[11], "Button12", -1 ));
248 }
int32_t Button[C4MaxKey]
Definition: C4Config.h:219
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
uint32_t AxisMin[6]
Definition: C4Config.h:220
void Value(const T &rStruct)
Definition: StdCompiler.h:171
bool AxisCalibrated[6]
Definition: C4Config.h:221
uint32_t AxisMax[6]
Definition: C4Config.h:220
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

void C4ConfigGamepad::Reset ( )

Definition at line 256 of file C4Config.cpp.

References StdCompiler::Compile(), and mkParAdapt().

257 {
258  // loads an empty config for the gamepad config
259  StdCompilerNull Comp; Comp.Compile(mkParAdapt(*this, false));
260 }
void Compile(T &&rStruct)
Definition: StdCompiler.h:183
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:459

Here is the call graph for this function:

void C4ConfigGamepad::ResetButtons ( )

Definition at line 250 of file C4Config.cpp.

References StdCompiler::Compile(), and mkParAdapt().

251 {
252  // loads an empty config for the buttons
253  StdCompilerNull Comp; Comp.Compile(mkParAdapt(*this, true));
254 }
void Compile(T &&rStruct)
Definition: StdCompiler.h:183
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:459

Here is the call graph for this function:

Member Data Documentation

bool C4ConfigGamepad::AxisCalibrated[6]

Definition at line 221 of file C4Config.h.

Referenced by CompileFunc().

uint32_t C4ConfigGamepad::AxisMax[6]

Definition at line 220 of file C4Config.h.

Referenced by CompileFunc().

uint32_t C4ConfigGamepad::AxisMin[6]

Definition at line 220 of file C4Config.h.

Referenced by CompileFunc().

int32_t C4ConfigGamepad::Button[C4MaxKey]

Definition at line 219 of file C4Config.h.

Referenced by CompileFunc().


The documentation for this class was generated from the following files: