Update to VS2013 and a slew of build-related updates. Notes:

* Currently there is no DEBUGFAST configuration. Defining DEBUGFAST as a preprocessor definition in Base.props (or a global header) enables it for now, pending a better method. This was done to make managing the build harder to screw up. However it may not even be an issue anymore with the new .props usage.
* D3DX11SaveTextureToFile usage is dropped and not replaced.
* If you have $(DXSDK_DIR) in your global property sheets (Microsoft.Cpp.$(PlatformName).user), you need to remove it. The build will error out with a message if it's configured incorrectly.
* If you are on Windows 8 or above, you no longer need the June 2010 DirectX SDK installed to build dolphin. If you are in this situation, it is still required if you want your built binaries to be able to use XAudio2 and XInput on previous Windows versions.
* GLew updated to 1.10.0
* compiler switches added: /volatile:iso, /d2Zi+
* LTCG available via msbuild property: DolphinRelease
* SDL updated to 2.0.0
* All Externals (excl. OpenAL and SDL) are built from source.
* Now uses STL version of std::{mutex,condition_variable,thread}
* Now uses Build as root directory for *all* intermediate files
* Binary directory is populated as post-build msbuild action
* .gitignore is simplified
* UnitTests project is no longer compiled
This commit is contained in:
Shawn Hoffman
2013-10-19 02:27:57 -07:00
parent 1eba4da21a
commit ccd30024b3
390 changed files with 104570 additions and 35686 deletions

View File

@ -99,7 +99,7 @@ void ControllerInterface::Shutdown()
m_devices.clear();
#ifdef CIFACE_USE_XINPUT
// nothing needed
ciface::XInput::DeInit();
#endif
#ifdef CIFACE_USE_DINPUT
// nothing needed

View File

@ -7,11 +7,7 @@
#include <algorithm>
#ifdef _WIN32
#if SDL_VERSION_ATLEAST(1, 3, 0)
#pragma comment(lib, "SDL.1.3.lib")
#else
#pragma comment(lib, "SDL.lib")
#endif
#pragma comment(lib, "SDL2.lib")
#endif
namespace ciface
@ -201,7 +197,7 @@ std::string Joystick::TriangleEffect::GetName() const
return "Triangle";
}
void Joystick::ConstantEffect::SetState(const ControlState state)
void Joystick::ConstantEffect::SetState(ControlState state)
{
if (state)
{
@ -219,7 +215,7 @@ void Joystick::ConstantEffect::SetState(const ControlState state)
m_effect.changed = true;
}
void Joystick::RampEffect::SetState(const ControlState state)
void Joystick::RampEffect::SetState(ControlState state)
{
if (state)
{
@ -237,7 +233,7 @@ void Joystick::RampEffect::SetState(const ControlState state)
m_effect.changed = true;
}
void Joystick::SineEffect::SetState(const ControlState state)
void Joystick::SineEffect::SetState(ControlState state)
{
if (state)
{
@ -260,7 +256,7 @@ void Joystick::SineEffect::SetState(const ControlState state)
}
#ifdef SDL_HAPTIC_SQUARE
void Joystick::SquareEffect::SetState(const ControlState state)
void Joystick::SquareEffect::SetState(ControlState state)
{
if (state)
{
@ -283,7 +279,7 @@ void Joystick::SquareEffect::SetState(const ControlState state)
}
#endif // defined(SDL_HAPTIC_SQUARE)
void Joystick::TriangleEffect::SetState(const ControlState state)
void Joystick::TriangleEffect::SetState(ControlState state)
{
if (state)
{

View File

@ -81,7 +81,7 @@ private:
public:
std::string GetName() const;
ConstantEffect(EffectIDState& effect) : m_effect(effect) {}
void SetState(const ControlState state);
void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@ -91,7 +91,7 @@ private:
public:
std::string GetName() const;
RampEffect(EffectIDState& effect) : m_effect(effect) {}
void SetState(const ControlState state);
void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@ -101,7 +101,7 @@ private:
public:
std::string GetName() const;
SineEffect(EffectIDState& effect) : m_effect(effect) {}
void SetState(const ControlState state);
void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@ -112,7 +112,7 @@ private:
public:
std::string GetName() const;
SquareEffect(EffectIDState& effect) : m_effect(effect) {}
void SetState(const ControlState state);
void SetState(ControlState state);
private:
EffectIDState& m_effect;
};
@ -123,7 +123,7 @@ private:
public:
std::string GetName() const;
TriangleEffect(EffectIDState& effect) : m_effect(effect) {}
void SetState(const ControlState state);
void SetState(ControlState state);
private:
EffectIDState& m_effect;
};

View File

@ -48,14 +48,60 @@ static const char* const named_motors[] =
"Motor R"
};
static HMODULE hXInput = nullptr;
typedef decltype(&XInputGetCapabilities) XInputGetCapabilities_t;
typedef decltype(&XInputSetState) XInputSetState_t;
typedef decltype(&XInputGetState) XInputGetState_t;
static XInputGetCapabilities_t PXInputGetCapabilities = nullptr;
static XInputSetState_t PXInputSetState = nullptr;
static XInputGetState_t PXInputGetState = nullptr;
void Init(std::vector<Core::Device*>& devices)
{
if (!hXInput)
{
// Try for the most recent version we were compiled against (will only work if running on Win8+)
hXInput = ::LoadLibrary(XINPUT_DLL);
if (!hXInput)
{
// Drop back to DXSDK June 2010 version. Requires DX June 2010 redist.
hXInput = ::LoadLibrary(TEXT("xinput1_3.dll"));
if (!hXInput)
{
return;
}
}
PXInputGetCapabilities = (XInputGetCapabilities_t)::GetProcAddress(hXInput, "XInputGetCapabilities");
PXInputSetState = (XInputSetState_t)::GetProcAddress(hXInput, "XInputSetState");
PXInputGetState = (XInputGetState_t)::GetProcAddress(hXInput, "XInputGetState");
if (!PXInputGetCapabilities ||
!PXInputSetState ||
!PXInputGetState)
{
::FreeLibrary(hXInput);
hXInput = nullptr;
return;
}
}
XINPUT_CAPABILITIES caps;
for (int i = 0; i != 4; ++i)
if (ERROR_SUCCESS == XInputGetCapabilities(i, 0, &caps))
if (ERROR_SUCCESS == PXInputGetCapabilities(i, 0, &caps))
devices.push_back(new Device(caps, i));
}
void DeInit()
{
if (hXInput)
{
::FreeLibrary(hXInput);
hXInput = nullptr;
}
}
Device::Device(const XINPUT_CAPABILITIES& caps, u8 index)
: m_index(index), m_subtype(caps.SubType)
{
@ -112,20 +158,16 @@ void Device::ClearInputState()
std::string Device::GetName() const
{
// why aren't these defined
// subtype doesn't seem to work, I tested with 2 different arcade sticks, both were shown as gamepad
// I'll leave it in anyway, maybe m$ will fix it
switch (m_subtype)
{
case XINPUT_DEVSUBTYPE_GAMEPAD : return "Gamepad"; break;
case 0x02 /*XINPUT_DEVSUBTYPE_WHEEL*/ : return "Wheel"; break;
case 0x03 /*XINPUT_DEVSUBTYPE_ARCADE_STICK*/ : return "Arcade Stick"; break;
case 0x04 /*XINPUT_DEVSUBTYPE_FLIGHT_STICK*/ : return "Flight Stick"; break;
case 0x05 /*XINPUT_DEVSUBTYPE_DANCE_PAD*/ : return "Dance Pad"; break;
case 0x06 /*XINPUT_DEVSUBTYPE_GUITAR*/ : return "Guitar"; break;
case 0x08 /*XINPUT_DEVSUBTYPE_DRUM_KIT*/ : return "Drum Kit"; break;
default : return "Device"; break;
case XINPUT_DEVSUBTYPE_GAMEPAD: return "Gamepad"; break;
case XINPUT_DEVSUBTYPE_WHEEL: return "Wheel"; break;
case XINPUT_DEVSUBTYPE_ARCADE_STICK: return "Arcade Stick"; break;
case XINPUT_DEVSUBTYPE_FLIGHT_STICK: return "Flight Stick"; break;
case XINPUT_DEVSUBTYPE_DANCE_PAD: return "Dance Pad"; break;
case XINPUT_DEVSUBTYPE_GUITAR: return "Guitar"; break;
case XINPUT_DEVSUBTYPE_DRUM_KIT: return "Drum Kit"; break;
default: return "Device"; break;
}
}
@ -143,7 +185,7 @@ std::string Device::GetSource() const
bool Device::UpdateInput()
{
return (ERROR_SUCCESS == XInputGetState(m_index, &m_state_in));
return (ERROR_SUCCESS == PXInputGetState(m_index, &m_state_in));
}
bool Device::UpdateOutput()
@ -153,7 +195,7 @@ bool Device::UpdateOutput()
if (memcmp(&m_state_out, &m_current_state_out, sizeof(m_state_out)))
{
m_current_state_out = m_state_out;
return (ERROR_SUCCESS == XInputSetState(m_index, &m_state_out));
return (ERROR_SUCCESS == PXInputSetState(m_index, &m_state_out));
}
else
{

View File

@ -1,3 +1,8 @@
// XInput suffers a similar issue as XAudio2. Since Win8, it is part of the OS.
// However, unlike XAudio2 they have not made the API incompatible - so we just
// compile against the latest version and fall back to dynamically loading the
// old DLL.
#ifndef _CIFACE_XINPUT_H_
#define _CIFACE_XINPUT_H_
@ -7,12 +12,17 @@
#include <Windows.h>
#include <XInput.h>
#ifndef XINPUT_DEVSUBTYPE_FLIGHT_STICK
#error You are building this module against the wrong version of DirectX. You probably need to remove DXSDK_DIR from your include path and/or _WIN32_WINNT is wrong.
#endif
namespace ciface
{
namespace XInput
{
void Init(std::vector<Core::Device*>& devices);
void DeInit();
class Device : public Core::Device
{