/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
XboxClient/ControllerBuffer.h
39 строк
1 KB
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
#pragma once #include "rbx/rbxTime.h" #include <boost/unordered_map.hpp> #include "v8datamodel/InputObject.h" using namespace Windows::Xbox::Input; class XboxGameController; class ControllerBuffer { public: typedef std::pair<RBX::InputObject::UserInputType, RBX::KeyCode> GamepadValue; typedef std::pair<RBX::Vector3, RBX::InputObject::UserInputState> GamepadValueState; typedef std::vector<GamepadValueState> GamepadValueStateHistoryVector; typedef boost::unordered_map<GamepadValue, GamepadValueStateHistoryVector> GamepadValueBufferMap; private: GamepadValueBufferMap bufferedInput; boost::mutex changeInputBufferMutex; XboxGameController* xboxGameController; void bufferGamepadButtons(const int controllerIndex, IGamepadReading^& gamepadReading); void bufferGamepadAxis(const int controllerIndex, IGamepadReading^& gamepadReading); void processButton(RBX::InputObject::UserInputType userInputType, const RBX::KeyCode buttonCode, const int buttonState); void processAxis(RBX::InputObject::UserInputType userInputType, const RBX::KeyCode axisCode, const RBX::Vector3 axisValue); public: ControllerBuffer(); void setXboxGameController(XboxGameController* newController) {xboxGameController = newController;} void updateBuffer(); float getPollingMsec(); GamepadValueBufferMap getBufferedInput(); };