Skip to content

Commit

Permalink
Fixed some preprocessor macros that got renamed, minor fixes, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonickidnextgen authored and Sonickidnextgen committed May 3, 2015
1 parent c4ac76a commit b556a35
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion IOSync/Info.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<IOSync_Version>1.0.3</IOSync_Version>
<IOSync_Version>1.0.4</IOSync_Version>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
Expand Down
23 changes: 18 additions & 5 deletions IOSync/src/iosync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ namespace iosync

void connectedDevices::updateGamepads(iosync_application* program)
{
#if defined(XINPUT_DEVICE_GAMEPAD) && defined(XINPUT_DEVICE_GAMEPAD_AUTODETECT)
#if defined(IOSYNC_DEVICE_GAMEPAD) && defined(IOSYNC_DEVICE_GAMEPAD_AUTODETECT)
// Check if we're detecting gamepads:
if (program->allowDeviceDetection())
{
Expand Down Expand Up @@ -2220,11 +2220,24 @@ namespace iosync
// Apply device configurations:
devices.max_gamepads = configuration.max_gamepads;

devices.keyboardEnabled = configuration.keyboardEnabled;
devices.gamepadsEnabled = configuration.gamepadsEnabled;
#ifdef IOSYNC_DEVICE_KEYBOARD
devices.keyboardEnabled = configuration.keyboardEnabled;
#else
devices.keyboardEnabled = false;
#endif

#ifdef GAMEPAD_VJOY_ENABLED
devices.vJoyEnabled = configuration.vJoyEnabled;
#ifdef IOSYNC_DEVICE_GAMEPAD
devices.gamepadsEnabled = configuration.gamepadsEnabled;

#ifdef GAMEPAD_VJOY_ENABLED
devices.vJoyEnabled = configuration.vJoyEnabled;
#endif
#else
devices.gamepadsEnabled = false;

#ifdef GAMEPAD_VJOY_ENABLED
devices.vJoyEnabled = false;
#endif
#endif

switch (configuration.mode)
Expand Down
12 changes: 6 additions & 6 deletions IOSync/src/iosync.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@

// This is just so endless keyboard loops don't occur:
#ifndef IOSYNC_FAST_TESTMODE
#define XINPUT_DEVICE_KEYBOARD
#define IOSYNC_DEVICE_KEYBOARD
#endif

#define XINPUT_DEVICE_GAMEPAD
#define IOSYNC_DEVICE_GAMEPAD

#ifdef XINPUT_DEVICE_GAMEPAD
#ifdef IOSYNC_DEVICE_GAMEPAD
// Gamepads are currently auto-detected by default.
#define XINPUT_DEVICE_GAMEPAD_AUTODETECT
#define IOSYNC_DEVICE_GAMEPAD_AUTODETECT
#endif

//#define IOSYNC_LIVE_COMMANDS
Expand Down Expand Up @@ -598,15 +598,15 @@ namespace iosync
// The socket we'll use to send messages.
auto& socket = engine.socket;

#if defined(XINPUT_DEVICE_KEYBOARD)
#if defined(IOSYNC_DEVICE_KEYBOARD)
if (keyboardEnabled)
{
// Request for remote-keyboard access.
sendConnectMessage(engine, socket, DEVICE_TYPE_KEYBOARD, destination);
}
#endif

#if defined(XINPUT_DEVICE_GAMEPAD) && !defined(XINPUT_DEVICE_GAMEPAD_AUTODETECT)
#if defined(IOSYNC_DEVICE_GAMEPAD) && !defined(IOSYNC_DEVICE_GAMEPAD_AUTODETECT)
if (gamepadsEnabled)
{
// Attempt to reserve a remote gamepad-identifier,
Expand Down

0 comments on commit b556a35

Please sign in to comment.