Browse Source

Build fix

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 11 years ago
parent
commit
2da1903619
2 changed files with 16 additions and 10 deletions
  1. +2
    -2
      src/input/controller.cpp
  2. +14
    -8
      src/platform/sdl/sdlinput.cpp

+ 2
- 2
src/input/controller.cpp View File

@@ -114,14 +114,14 @@ void AxisBinding::BindKeys(const String& device_name, const String& min_key_name
int minkeyindex = device->GetKeyIndex(min_key_name.C()); int minkeyindex = device->GetKeyIndex(min_key_name.C());
if (minkeyindex < 0) if (minkeyindex < 0)
{ {
Log::Warn("Trying to bind controller to key %s.%s which doesn't exist", device_name, min_key_name.C()); Log::Warn("Trying to bind controller to key %s.%s which doesn't exist", device_name.C(), min_key_name.C());
return; return;
} }


int maxkeyindex = device->GetKeyIndex(max_key_name.C()); int maxkeyindex = device->GetKeyIndex(max_key_name.C());
if (maxkeyindex < 0) if (maxkeyindex < 0)
{ {
Log::Warn("Trying to bind controller to key %s.%s which doesn't exist", device_name, max_key_name.C()); Log::Warn("Trying to bind controller to key %s.%s which doesn't exist", device_name.C(), max_key_name.C());
return; return;
} }




+ 14
- 8
src/platform/sdl/sdlinput.cpp View File

@@ -85,7 +85,7 @@ SdlInput::SdlInput(int app_w, int app_h, int screen_w, int screen_h)
SDL_JoystickEventState(SDL_QUERY); SDL_JoystickEventState(SDL_QUERY);
# else # else
SDL_JoystickEventState(SDL_ENABLE); SDL_JoystickEventState(SDL_ENABLE);
# endif # endif //SDL_FORCE_POLL_JOYSTICK


m_data->m_keyboard = InputDeviceInternal::CreateStandardKeyboard(); m_data->m_keyboard = InputDeviceInternal::CreateStandardKeyboard();
m_data->m_mouse = InputDeviceInternal::CreateStandardMouse(); m_data->m_mouse = InputDeviceInternal::CreateStandardMouse();
@@ -104,7 +104,7 @@ SdlInput::SdlInput(int app_w, int app_h, int screen_w, int screen_h)
if (strstr(name, "HDAPS") if (strstr(name, "HDAPS")
# if USE_XINPUT # if USE_XINPUT
|| strstr(name, "XBOX 360 For Windows") || strstr(name, "XBOX 360 For Windows")
# endif # endif //USE_XINPUT
|| false) || false)
{ {
SDL_JoystickClose(sdlstick); SDL_JoystickClose(sdlstick);
@@ -119,8 +119,10 @@ SdlInput::SdlInput(int app_w, int app_h, int screen_w, int screen_h)


m_data->m_joysticks.Push(sdlstick, stick); m_data->m_joysticks.Push(sdlstick, stick);
} }
# endif # endif //EMSCRIPTEN
#endif #else
UNUSED(app_w, app_h, screen_w, screen_h);
#endif //USE_SDL


m_gamegroup = GAMEGROUP_BEFORE; m_gamegroup = GAMEGROUP_BEFORE;
} }
@@ -154,7 +156,7 @@ void SdlInput::TickDraw(float seconds)


#if _WIN32 #if _WIN32
m_data->Tick(seconds); m_data->Tick(seconds);
#endif #endif //_WIN32
} }


void SdlInputData::Tick(float seconds) void SdlInputData::Tick(float seconds)
@@ -257,7 +259,9 @@ void SdlInputData::Tick(float seconds)
# include "input/keys.h" # include "input/keys.h"
# undef KEY_FUNC # undef KEY_FUNC


#endif // USE_SDL #else
UNUSED(seconds);
#endif //USE_SDL
} }


// NOTE: these two functions are pointless now and could be inlined directly // NOTE: these two functions are pointless now and could be inlined directly
@@ -273,7 +277,7 @@ ivec2 SdlInputData::GetMousePos()
SDL_GetMouseState(&ret.x, &ret.y); SDL_GetMouseState(&ret.x, &ret.y);
ret.y = Video::GetSize().y - 1 - ret.y; ret.y = Video::GetSize().y - 1 - ret.y;
} }
#endif #endif //USE_SDL
return ret; return ret;
} }


@@ -281,7 +285,9 @@ void SdlInputData::SetMousePos(ivec2 position)
{ {
#if USE_SDL #if USE_SDL
SDL_WarpMouse((uint16_t)position.x, (uint16_t)position.y); SDL_WarpMouse((uint16_t)position.x, (uint16_t)position.y);
#endif #else
UNUSED(position);
#endif //USE_SDL
} }


} /* namespace lol */ } /* namespace lol */


||||||
x
 
000:0
Loading…
Cancel
Save