Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
802 stars 62 forks source link

Mouse and dll problems with Windows 0.8.0 pre-release #333

Closed donnierussellii closed 4 years ago

donnierussellii commented 4 years ago

The dlls included in systemshock-x64.zip seem to be for the 32-bit version, with dwarf exception handling. I placed these files alongside the .exe to get 64-bit working: libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll I'm not sure what build version to use, and if it should be win32 or posix threads.

Both 32 and 64 bit versions do not handle the mouse properly. On game startup the SDL mouse cursor is not drawn inside the window; only the windows pointer appears over the window. But the splash screens do respond to a left mouse button press. At the main menu, the menu buttons don't respond to mouse clicks. I can start the game using the keyboard, but the mouse control is missing.

I am not sure if these two issues are related, so I'm filing them as one issue.

donnierussellii commented 4 years ago

They're not the same issue.

Going back to v0.7.0 fixes the mouse issue. I get a crash to desktop with v0.7.5. Following versions don't crash but have same mouse issue. Maybe that creeped in between those versions I mentioned.

donnierussellii commented 4 years ago

Continuing with the mouse issue:

Between v0.7.0 and v0.7.6...

In the files: event.c cursors.c curdrw.c sdl_events.c mouse.h mouse.c olh.c the mouse_event type name has been changed to ss_mouse_event, to avoid collision with win32 function.

Also, in: input.c hkeyfunc.c ShowCursor function name has been changed to SS_ShowCursor, also to avoid collision with win32.

This seems to be getting to the heart of the problem. Maybe some names were missed? I'll check it out.

donnierussellii commented 4 years ago

Edit None of the below are causing the issue.

There's a missed mouse_event rename in joystick_emulate_mouse() in input.c

SS_ShowCursor() function is not defined anywhere, and is only called in PlayVMail() in MoviePlay.c, which I think is dead code. That one call can be removed I think.

donnierussellii commented 4 years ago

This seems to be odd mouse focus behavior on my machine. Depending on how I launch the game or the phase of the moon the window gets focus and the following line in sdl_events.c works as it should: bool focus = (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS);