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 215 of file C4Config.h.

Member Function Documentation

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

Definition at line 220 of file C4Config.cpp.

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

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

Here is the call graph for this function:

void C4ConfigGamepad::Reset ( )

Definition at line 252 of file C4Config.cpp.

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

253 {
254  // loads an empty config for the gamepad config
255  StdCompilerNull Comp; Comp.Compile(mkParAdapt(*this, false));
256 }
void Compile(T &&rStruct)
Definition: StdCompiler.h:173
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:458

Here is the call graph for this function:

void C4ConfigGamepad::ResetButtons ( )

Definition at line 246 of file C4Config.cpp.

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

247 {
248  // loads an empty config for the buttons
249  StdCompilerNull Comp; Comp.Compile(mkParAdapt(*this, true));
250 }
void Compile(T &&rStruct)
Definition: StdCompiler.h:173
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:458

Here is the call graph for this function:

Member Data Documentation

bool C4ConfigGamepad::AxisCalibrated[6]

Definition at line 220 of file C4Config.h.

Referenced by CompileFunc().

uint32_t C4ConfigGamepad::AxisMax[6]

Definition at line 219 of file C4Config.h.

Referenced by CompileFunc().

uint32_t C4ConfigGamepad::AxisMin[6]

Definition at line 219 of file C4Config.h.

Referenced by CompileFunc().

int32_t C4ConfigGamepad::Button[C4MaxKey]

Definition at line 218 of file C4Config.h.

Referenced by CompileFunc().


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