Fixed joystick POV values on Windows (PovX and PovY were inverted)

This reverts commit f1c30f106a, which contained the wrong file, and adds the right modification.
This commit is contained in:
Laurent Gomila 2013-11-26 22:30:51 +01:00
parent f1c30f106a
commit ef1d29bf73
2 changed files with 2 additions and 6 deletions

View File

@ -167,8 +167,8 @@ JoystickState JoystickImpl::update()
if (pos.dwPOV != 0xFFFF)
{
float angle = pos.dwPOV / 18000.f * 3.141592654f;
state.axes[Joystick::PovX] = std::cos(angle) * 100;
state.axes[Joystick::PovY] = std::sin(angle) * 100;
state.axes[Joystick::PovX] = std::sin(angle) * 100;
state.axes[Joystick::PovY] = std::cos(angle) * 100;
}
else
{

View File

@ -40,8 +40,6 @@
#include <SFML/System/Utf.hpp>
#include <vector>
#include <iostream>
// MinGW lacks the definition of some Win32 constants
#ifndef XBUTTON1
#define XBUTTON1 0x0001
@ -771,8 +769,6 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
////////////////////////////////////////////////////////////
Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
{
std::cout << "VM = " << std::hex << key << std::endl;
switch (key)
{
// Check the scancode to distinguish between left and right shift