Commit graph

74 commits

Author SHA1 Message Date
mazmazz 6b9fe87b60 Properly handle unstable device indexes for hotplug 2018-12-14 01:45:18 -05:00
mazmazz 44d6a1d236 Attempt to handle unstable device IDs 2018-12-14 00:22:25 -05:00
mazmazz 14cde2d227 Change joystick log messages to DBG_GAMELOGIC 2018-12-13 23:26:07 -05:00
mazmazz bcd747c1cd Adjust SDL_JOYDEVICEREMOVED handler by checking the player's joy device explicitly 2018-12-13 22:26:13 -05:00
mazmazz 6694b7d679 Controller hotplugging by always keeping joy subsystem on (thanks WOLFS)
(with log messages)
2018-12-06 10:54:58 -05:00
Monster Iestyn ce4e63a366 Miserable half-attempt to support hats in I_GetEvent, I've disabled it for now since I couldn't really figure out how to pull this off ...yet 2018-12-02 17:12:05 +00:00
Monster Iestyn 51df32dd3d Merge branch 'gcc-compiling-cleanup' into 'master'
Compiling cleanup and fixes

See merge request STJr/SRB2!311
2018-11-10 13:56:17 -05:00
Monster Iestyn 0bdbdd1b1e Remove FUNCMATH from functions with a void return value or args, or examine variables other than their args (which could be modified) 2018-11-08 16:26:55 +00:00
Steel Titanium 5a0cfc10f4 Update copyright info on some files 2018-11-01 14:47:19 -04:00
mazmazz 4b1bc53db1 Compile fixes 2018-09-14 10:58:41 -04:00
Alam Ed Arias 3479310546 SDL: update IMG_xpm.c 2018-08-10 17:09:11 -04:00
Monster Iestyn 41e9c20c04 Ignore mouse button events if the mouse's focus is not actually on the window at the moment.
This should hopefully kill the F12 getting stuck issue once and for all.
2018-05-28 21:29:46 +01:00
Sryder f3d63b82ce Revert "Fix screenshot functionality in fullscreen in SDL2"
This reverts commit 121fcd8369.

The reason I am reverting this is because the last commit actually fixes the *old* screenshot functionality, as the screen is being drawn back onto the buffer after they're swapped in the "real" size. Meaning the old function actually works perfectly fine now.
2018-03-18 18:33:53 +00:00
Sryder 121fcd8369 Fix screenshot functionality in fullscreen in SDL2 2018-03-08 22:28:38 +00:00
Sryder 77af3a8f95 Optimise the screen texture setup for SDL2, Post-processor, and wipes.
Only use glCopyTexImage2D when first creating the screen texture, use glCopyTexSubImage2D anytime after that as it does not define a new texture each time.
Flushing of the screen textures has been implemented for when the screen size changes (so that the screen textures don't stay at a wrong size) and the game is closed, I believe they would leave a memory leak before.
2018-03-07 22:55:21 +00:00
Steel Titanium 799a819ee9 Merge remote-tracking branch 'upstream/master' into window_center_fix 2017-10-29 00:00:11 -04:00
Monster Iestyn c90ddbca36 Merge branch 'makefile-ports-tweaks-cleanup-etc' into 'master'
Makefile ports tweaks cleanup etc

See merge request !211
2017-09-28 17:31:33 -04:00
Alam Ed Arias 2ccd397d11 Build: kill GCC 7's implicit-fallthrough warning 2017-09-28 09:39:47 -04:00
Monster Iestyn a33bb70a0c Removed all support for Dreamcast, XBox, PSP, PS3, GP2X, Wii, and WinCE from files in the sdl/ folder. If you wanted these ports, use the SDL 1.2 code in sdl12
Also removed GP2X setup from sdl/MakeNIX.cfg, use sdl12 for that too
2017-09-16 20:26:04 +01:00
Steel Titanium cf41a11770 Fix for window being offcenter 2017-09-11 16:36:30 -04:00
Monster Iestyn 36977a5eda SDL_SetRelativeMouseMode(SDL_TRUE) already does what HalfWarpMouse does
Also, don't post an ev_mouse event_t if not in relative mouse mode, so the camera doesn't jerk when the mouse enters the window
2017-08-22 22:53:18 +01:00
Monster Iestyn 821a1810f7 Moved lrounding of mouse motion events to the actual point an event is made
Also did some cleanup and moving around, as well as adding comments
2017-08-21 21:38:29 +01:00
Monster Iestyn 10cbe2c82b Turns out the issue was with fullscreen! All I have to do is factor in the resolution/real window size ratio apparently (which was already done before)
Also changed movemousex/y to INT32
2017-08-19 22:54:30 +01:00
Monster Iestyn 758e9c4558 Merge all (relative) mouse motion events into one mouse event
This fixes SDL2_RelMouse's weaker sensitivity for me on Windows (but apparently not for others??)
2017-08-19 21:39:04 +01:00
Monster Iestyn 2d661fef18 Turns out we don't need to use SDL_SetWindowTitle on its own, since SDL_CreateWindow already deals with the window title anyway. So I've disabled everything related to Impl_SetWindowName for now
Also what were you thinking Fury?!? window shouldn't be NULL for SDL_SetWindowTitle, you backwards person you
2017-08-07 16:44:29 -04:00
Alam Ed Arias 35404be1e0 SDL: y input is flipped 2017-08-07 16:37:03 -04:00
Alam Ed Arias c25b2eb37f Merge remote-tracking branch 'origin/master' into SDL2_RelMouse 2017-08-07 16:33:39 -04:00
Monster Iestyn 87085f2475 SDLSetMode: merge wasfullscreen/windowed mode code into one block 2017-05-15 16:35:32 +01:00
Monster Iestyn a340f2c8ed Impl_CreateWindow: re-use "flags" for SDL_RENDERER_* flags, remove unnecessary curly braces 2017-05-15 16:19:28 +01:00
Monster Iestyn 4979ab6b8e Not really important or anything, but checking render_soft == rendermode rather than rendermode == render_soft always bugged me. And it's not consistent with the rest of the source code (or at least most of it) anyway. 2017-05-15 15:43:31 +01:00
Monster Iestyn d1bbd1261e VID_SetMode: SDLSetMode should use vid.width/vid.height, not windowedModes[modeNum].
If modenum was < 0 or >= MAXWINMODES, that would make windowedModes[modeNum] be out of bounds and possibly crash the game.
2017-05-15 15:36:51 +01:00
Monster Iestyn 093800cb06 I_FinishUpdate: OglSdlFinishUpdate should never run for render_soft, even if screens[0] somehow is NULL 2017-05-15 15:24:40 +01:00
Monster Iestyn ae3e11369e Revert "(Messiness warning) attempt to start using SDL_SetRelativeMouseMode instead of the old hacks of making the mouse do movement without leaving the window and be hidden"
This reverts commit 347b531881.

(Too experimental, may end up adding new bugs; let's just keep it to clean up for now)
2016-11-30 17:21:28 +00:00
Monster Iestyn 347b531881 (Messiness warning) attempt to start using SDL_SetRelativeMouseMode instead of the old hacks of making the mouse do movement without leaving the window and be hidden
Seems to work so far though
2016-11-25 21:13:39 +00:00
Monster Iestyn 8bbbeff2a9 Make Impl_SDL_Scancode_To_Keycode look a bit neater
This way it's easier by eye to see from the list which SDL scancode maps to which SRB2 key code
2016-11-23 17:08:37 +00:00
Monster Iestyn 5cf4767aed Clearing away lots of disabled code (some of it would no longer work on SDL2 anyway) 2016-11-23 16:51:37 +00:00
Monster Iestyn 153ba39f19 Remove remnants of SDLK_ stuff, we use scancodes now not keycodes
(Apparently SDLK_LMETA/SDLK_RMETA don't exist anymore in SDL2 anyway?)
2016-11-22 22:41:02 +00:00
Monster Iestyn 1606a45b18 Some cleanup/reorganisation in SDLSetMode and Impl_CreateWindow 2016-11-21 22:07:05 +00:00
Monster Iestyn 208546165b Comment out SDL2STUB from Impl_SetWindowIcon 2016-11-21 20:59:44 +00:00
Monster Iestyn 168f8d5c5e Un-stub Surfaceinfo and just print the parts that still work in SDL2
This means the console command vid_info also works properly too now (well, it does nothing in OpenGL mind)
2016-11-21 20:40:02 +00:00
Monster Iestyn f4705b01f4 Don't call SDLESSet
Turns out sdl12's version of this function only did stuff for DC/GP2X ports; support for them have been cut out for SDL2, so for now let's just not use the function at all
2016-11-21 19:42:39 +00:00
Alam Ed Arias 7126d57fd7 whitespace cleanup 2016-06-19 20:25:09 -04:00
Alam Ed Arias 4d6a3e3398 FUNCMATH fun 2016-06-12 16:08:48 -04:00
Alam Ed Arias 366e870b0e SDL2: check Rel Mouse Mode directly 2016-06-07 17:16:11 -04:00
Alam Ed Arias 246e0c21be SDL2: do not use silly math in rel mode 2016-06-07 16:59:32 -04:00
Alam Ed Arias 70ce9421e4 SDL2: fixup ambiguous else in I_StartupMouse() 2016-06-07 16:21:15 -04:00
Alam Ed Arias e4d57ad72c SDL2: try out relative mouse mode 2016-06-07 15:57:37 -04:00
Alam Ed Arias 57091261d9 MSVC: fixed up MSVC project 2016-05-21 23:53:04 -04:00
Alam Ed Arias a529dca69f SDL: in the SDL 2.0 interface code, we use a fake surface as our vidsurface, so we should be freeing it 2016-05-10 18:20:14 -04:00
Inuyasha a9be5ba867 fixed memory issues Alam running valgrind found 2016-05-08 20:34:43 -07:00