FWGS / xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
https://xash.su
GNU General Public License v3.0
549 stars 107 forks source link

Mouse pointer issues on Mac #394

Closed noodlecollie closed 5 years ago

noodlecollie commented 5 years ago

I've been having a few issues with mouse input on Mac, and now that I've updated my fork to the latest master I can verify they're still present in the latest code.

  1. When playing maps, moving the mouse doesn't move the player camera. I can only navigate via WASD/arrow keys.
  2. When in a widescreen aspect ratio (e.g 1280x720), the main menu interaction with the mouse pointer does not correspond with how the menu is displayed. For example, menu items at the top of the menu begin to be hover-highlighted when the mouse pointer is at the bottom of the screen.
a1batross commented 5 years ago
  1. Looks like a DPI scaling problem. Try to find out how to disable DPI scaling on Mac.
a1batross commented 5 years ago

https://wiki.libsdl.org/SDL_HINT_VIDEO_HIGHDPI_DISABLED

I don't remember is this hint was set, if not, try it.

noodlecollie commented 5 years ago

I was experimenting with vid_highdpi yesterday and it didn't seem to help, but today it's fine no matter what value I use for that cvar?? Not quite sure what's going on, but if the issue comes back I'll try and reproduce it more consistently.

EDIT: OK, it turns out that setting +vid_highdpi 0 on the command line half-affects the engine (the window is made bigger but the DPI itself remains unchanged). To see the effect the value actually has to be saved into config, so it will only work on subsequent starts.

Problem 1 is still an issue though.

a1batross commented 5 years ago

First issue happens on client.dll with original input or extended unified input?

It's easy to check in engine log, if engine prints that IN_ClientLookEvent not found, it means that clientdll does not implement our extension.

noodlecollie commented 5 years ago

Yep, I do get the following when I start the engine:

[06:29:08] CL_LoadProgs: failed to get address of IN_ClientTouchEvent proc
[06:29:08] CL_LoadProgs: failed to get address of IN_ClientMoveEvent proc
[06:29:08] CL_LoadProgs: failed to get address of IN_ClientLookEvent proc

Does this mean it's an issue with the Half Life dylibs I'm using? They're just taken straight from the Mac version of the game.

a1batross commented 5 years ago

It's not an issue in libraries. Hm... yes, it's in libraries, but not because of interfaces. Maybe some incompability with Steam's SDL2, but SDL2 should be binary compatible in all 2.0.x releases.

noodlecollie commented 5 years ago

I might see if the same issue happens when I compile the binaries from scratch, because then hopefully they'll be using the same version of SDL.

noodlecollie commented 5 years ago

OK, I compiled the binaries myself and I still get these errors:

[17:51:15] CL_LoadProgs: failed to get address of HUD_ChatInputPosition proc
[17:51:15] CL_LoadProgs: failed to get address of HUD_GetRenderInterface proc
[17:51:15] CL_LoadProgs: failed to get address of HUD_GetPlayerTeam proc
[17:51:15] CL_LoadProgs: failed to get address of HUD_ClipMoveToEntity proc
[17:51:15] CL_LoadProgs: failed to get address of IN_ClientTouchEvent proc
[17:51:15] CL_LoadProgs: failed to get address of IN_ClientMoveEvent proc
[17:51:15] CL_LoadProgs: failed to get address of IN_ClientLookEvent proc
a1batross commented 5 years ago

GoldSource does have some hacks for SDL2 clients in code, but I don't want to keep this in engine. Nor in old, nor in new.

As alternative, you may set m_enginemouse 1 or compile client from hlsdk-xash3d repo.

noodlecollie commented 5 years ago

Both those options work on my machine, though the hlsdk-xash3d binaries still give the previous proc failures up to IN_ClientTouchEvent - not sure whether that's an issue or not.

Are there any other specific advantages to the Xash3d Half Life binaries over the official Valve ones? I might switch my game implementation over to use those if they'd be a better option.

In addition, there is one other minor issue I've noticed - when using the drop-down console in game on Mac, the console text will scroll when the mouse is moved up and down, regardless of where the mouse pointer is on-screen, or whether I'm using two-finger scroll. This occurs in both the Valve and Xash3D Half Life binaries, so I think it might be related to the engine itself. I can live with it for now, but thought I'd mention it.

a1batross commented 5 years ago

TouchEvent implementation is not so necessary. At this time no one actually implements it(however I may use it in CS16Client).

Are there any other specific advantages to the Xash3d Half Life binaries over the official Valve ones? I might switch my game implementation over to use those if they'd be a better option.

Nothing actually. It's the only "client to engine" extension.

Can you create a separate issue for console? Looks like it's caused by wrong SDL2 event dispatching. Console is scrolled only by press & motion event(i.e. swiping) and mouse wheel.

nekonomicon commented 5 years ago

Are there any other specific advantages to the Xash3d Half Life binaries over the official Valve ones? I might switch my game implementation over to use those if they'd be a better option.

Does not have vgui in dependencies. Seems NightFire 007 does not have vgui too.

noodlecollie commented 5 years ago

OK cool, I'll create another issue for the scrolling. Otherwise, I reckon that's my original issues solved.