Skip to content

Commit

Permalink
Merge branch 'a1batross-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelTroch committed Oct 16, 2024
2 parents 9552a3c + 3463b7f commit 453e1f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Link Linux binaries with `-Wl` and `--no-undefined` flags to avoid situations where something was referenced but wasn't added in the build (Thanks a1batross)
* Prevented game_zone_player from transitioning across levels to fix Mod_NumForName: not found issue [#241](https://github.com/twhl-community/halflife-updated/pull/241) (Thanks FreeSlave)
* Fixed null dereference in game_score [#246](https://github.com/twhl-community/halflife-updated/pull/246) (Thanks FreeSlave)
* Fixed null dereference of m_rawinput and mouse issues on Linux [#251](https://github.com/twhl-community/halflife-updated/pull/251) (Thanks a1batross)

### Features

Expand Down
1 change: 1 addition & 0 deletions FULL_UPDATED_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ Fixes for bugs introduced in beta builds are not included in this list.
* Added missing client side event for `func_vehicle` sounds
* Prevented game_zone_player from transitioning across levels to fix Mod_NumForName: not found issue [#241](https://github.com/twhl-community/halflife-updated/pull/241) (Thanks FreeSlave)
* Fixed null dereference in game_score [#246](https://github.com/twhl-community/halflife-updated/pull/246) (Thanks FreeSlave)
* Fixed null dereference of m_rawinput and mouse issues on Linux [#251](https://github.com/twhl-community/halflife-updated/pull/251) (Thanks a1batross)

## Code cleanup

Expand Down
12 changes: 4 additions & 8 deletions cl_dll/inputw32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ static cvar_t* m_rawinput = nullptr;

static bool IN_UseRawInput()
{
return m_rawinput->value != 0;
// a1ba: m_rawinput 1 is SDL input on Windows
// Linux only has SDL input, so return true here
return m_rawinput ? m_rawinput->value != 0 : true;
}

static SDL_bool mouseRelative = SDL_TRUE;
Expand Down Expand Up @@ -268,11 +270,7 @@ void DLLEXPORT IN_ActivateMouse()
mouseactive = true;
}

if (g_iVisibleMouse
#ifdef WIN32
|| !IN_UseRawInput()
#endif
)
if (g_iVisibleMouse || !IN_UseRawInput())
{
IN_SetMouseRelative(false);
}
Expand Down Expand Up @@ -635,7 +633,6 @@ void IN_MouseMove(float frametime, usercmd_t* cmd)

gEngfuncs.SetViewAngles((float*)viewangles);

#ifdef WIN32
if ((!IN_UseRawInput() && SDL_FALSE != mouseRelative) || g_iVisibleMouse)
{
IN_SetMouseRelative(false);
Expand All @@ -644,7 +641,6 @@ void IN_MouseMove(float frametime, usercmd_t* cmd)
{
IN_SetMouseRelative(true);
}
#endif

/*
//#define TRACE_TEST
Expand Down

0 comments on commit 453e1f5

Please sign in to comment.