Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduState.cc

Go to the documentation of this file.
00001 #include <iostream>
00002 
00003 #include "KoduState.h"
00004 
00005 namespace Kodu {
00006 
00007   void KoduState::update(int generatoregid, int sourceid, float magnitude) {
00008     // std::cout << "Gamepad event: source=" << sourceid << " magnitude=" << magnitude << std::endl;
00009     if (generatoregid == EventBase::buttonEGID &&
00010         IS_GAMEPAD_SID(sourceid)) {
00011       switch(sourceid) {
00012       case GamepadSrcID::gamepadLeftJoyXSrcID:
00013         joystickx = -1*magnitude;
00014         // std::cout << "joystickx updated to " << joystickx << '\n';
00015         break;
00016       case GamepadSrcID::gamepadLeftJoyYSrcID:
00017         joysticky = -1*magnitude;
00018         // std::cout << "joysticky updated to " << joysticky << '\n';
00019         break;
00020       case GamepadSrcID::gamepadAButtonSrcID:
00021         abutton = magnitude;
00022         break;
00023       case GamepadSrcID::gamepadBButtonSrcID:
00024         bbutton = magnitude;
00025         break;
00026       case GamepadSrcID::gamepadXButtonSrcID:
00027         xbutton = magnitude;
00028         break;
00029       case GamepadSrcID::gamepadYButtonSrcID:
00030         ybutton = magnitude;
00031         break;
00032       case GamepadSrcID::gamepadRightBumperSrcID:
00033         rightbumper = magnitude;
00034         break;
00035       case GamepadSrcID::gamepadLeftBumperSrcID:
00036         leftbumper = magnitude;
00037         break;
00038       default:
00039         break;
00040       }
00041     }
00042   }
00043 
00044 }

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:43 2016 by Doxygen 1.6.3