Permalink
Browse files

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

This reverts commit f1c30f1, which contained the wrong file, and adds the right modification.
  • Loading branch information...
LaurentGomila committed Nov 26, 2013
1 parent f1c30f1 commit ef1d29bf73c76bfbf06155228de2e7abf1d13c00
Showing with 2 additions and 6 deletions.
  1. +2 −2 src/SFML/Window/Win32/JoystickImpl.cpp
  2. +0 −4 src/SFML/Window/Win32/WindowImplWin32.cpp
@@ -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
{
@@ -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

0 comments on commit ef1d29b

Please sign in to comment.