Commit graph

1668 commits

Author SHA1 Message Date
Denis Pauk
395641e1dc Image: Share GetTexImage 2022-12-11 12:11:46 +02:00
Denis Pauk
f6f6639a89 Image: Share loadSky textures
Add support of `r_palettedtextures` to all renders.
2022-12-11 12:11:46 +02:00
Denis Pauk
18bc788335 Image: Share LoadImage 2022-12-11 12:11:46 +02:00
Denis Pauk
43c690eab2 Image: Share Hicolor 2022-12-11 12:11:46 +02:00
Denis Pauk
5e2ecede93 Image: Add M32 support functions
https://github.com/TTimo/GtkRadiant/blob/master/plugins/imagem8/m32.h
2022-12-11 12:11:46 +02:00
Denis Pauk
f77e6940bd Image: Share M8 2022-12-11 12:11:46 +02:00
Denis Pauk
11f5b9e475 Image: Share code for load Wal 2022-12-11 12:11:46 +02:00
Denis Pauk
ec83adcba5 Image: Share code for add file extension 2022-12-11 12:11:46 +02:00
Denis Pauk
768139ad6a Image: Share Draw_GetPalette between renders 2022-12-11 12:11:46 +02:00
Yamagi
c764f3f142
Merge pull request #943 from devnexen/vulkan_menu_upd2
updating vulkan renderer sub menu to be a bit more on part with the r…
2022-12-03 16:48:39 +01:00
Yamagi
3617fa56be
Merge pull request #941 from protocultor/controller_refactor
Game Controller code refactor
2022-12-03 16:44:28 +01:00
David Carlier
91368f6f1b updating vulkan renderer sub menu to be a bit more on part with the rest. 2022-12-01 12:35:26 +00:00
Jaime Moreira
ad56a8bae5 Controller rumble support queried in SDL >= 2.0.9 2022-12-01 09:10:44 -03:00
Jaime Moreira
4d040f0878 Builds with SDL2 <= 2.0.9
Unneeded variable deleted
Regretted printing style choice after seeing logs in Windows Notepad
2022-11-24 21:05:34 -03:00
Jaime Moreira
618374f351 Game Controller code refactor
Patchwork from df399576 no longer needed, deleted
Joysticks open with error checking
Slight optimization for gyro aiming
Better console messages in game controller init
2022-11-23 01:12:38 -03:00
David Carlier
d93916d6ba also pause the game if for example we change desktop's workspace 2022-11-21 22:42:35 +00:00
Yamagi
15adee3b06
Merge pull request #936 from devnexen/mem_issues_fix_prop
OGG_LoadAsWav, release as long it had been allocated.
2022-11-20 17:15:33 +01:00
Yamagi
282f3a8e9c
Merge pull request #934 from devnexen/vk_menu_upd
adding new menu entry for the vulkan renderer
2022-11-20 17:08:29 +01:00
Yamagi
6f07cb2be0
Merge pull request #933 from protocultor/gamepad_menu
More options for Gamepad menu
2022-11-20 16:29:57 +01:00
Jaime Moreira
f8e86e9056 Removed unneeded info in controller init
Since now there's a menu to show and modify this info, we don't need it
printed on the console.
Also, controller can exit credits option now.
2022-11-19 23:14:43 -03:00
Yamagi
a1e0ce0732 Fix audio file length misscalculated due to overflow.
`s_info->samples' is very big, even for short wave files. Multiply it by
1000 has a very high chance of flowing over and it is a wonder that so
 far no one noticed it. Fix the overflow by working on 64 bit integers.

 Closes #931.
2022-11-19 16:54:52 +01:00
David Carlier
4568df7fb1 OGG_LoadAsWav, release as long it had been allocated. 2022-11-18 17:43:29 +00:00
Jaime Moreira
20a1db6cac Invert joystick's pitch in options menu 2022-11-10 16:46:17 -03:00
David Carlier
d9d7eef4ee adding new menu entry for the vulkan renderer 2022-11-09 20:53:26 +00:00
Jaime Moreira
85b9841785 Reordered elements in 'sticks config' menu
Repeated definitions put in a couple of loops
2022-11-09 09:00:32 -03:00
Jaime Moreira
672aef07e6 Hide the gamepad menu if one is not connected
SDL Controller opens with error checking
Deleted a duplicate structure on menu
Renamed the "gyro enabled" boolean
2022-11-08 12:38:24 -03:00
Jaime Moreira
b11937980b Gamepad Sticks submenu
Sticks layout and expo options moved there
Includes deadzone sliders
2022-11-08 08:13:13 -03:00
Yamagi
57db0df752 Force the GL1 overbrightbits slider to full integers.
The cvar is accepting full integers only.
2022-11-06 18:08:49 +01:00
Yamagi
dfd154b533 Merge remote-tracking branch 'devnexen/gl1_videomenuupd' 2022-11-06 18:05:25 +01:00
David Carlier
575ea06b9d gl1 and gl3 having their own menu data 2022-11-06 16:18:53 +00:00
Jaime Moreira
6998509a85 Fixed annoying rumble effect
A cool effect used in 'mine2' map ("train2"), ruined 'train' map; fixed
Player pain readjusted by type, resulting intensity is now almost equal for all
 instead of the "higher health" ones being bigger, which didn't make sense
2022-11-04 11:53:10 -03:00
Jaime Moreira
7b5f80cfc4 Rumble effects readjusted
Player pain slightly downplayed
Ambient effects can be felt from further distance
2022-11-03 15:39:00 -03:00
Jaime Moreira
1ec0a28369 Disconnecting controller hides haptic slider
CenterPrint messages must be 40 characters or lower
2022-10-24 23:46:39 -03:00
Jaime Moreira
303a627d10 Rumble workaround for SDL audio backend
Cache length is different from OpenAL, it must be greatly reduced for
a proper length to be used as the duration of the rumble effect.
2022-10-23 12:06:55 -03:00
Jaime Moreira
5a22720735 Controller Rumble / force feedback
Replaces classic "haptic" implementation, no longer available for
game controllers as of SDL 2.0.14.
2022-10-23 12:05:06 -03:00
Jaime Moreira
5c560039d8 Pause when controller is disconnected
Controller battery warnings added
2022-10-23 11:48:07 -03:00
Yamagi
1a450ef23d Add some more alignement to the video menu.
It looks better this way and is more in line with the other menus.
2022-10-23 14:56:04 +02:00
Yamagi
eab0f90289
Merge pull request #915 from devnexen/renderer_new_options
gl3/gl3es renderer display intensity/colorlight sub options.
2022-10-23 14:54:44 +02:00
Yamagi
871292934d Work around wrong palette after skiping cinematic whith developer 1.
Quake II has two palettes. One static palette used for the world and one
dynamic palette used by cinematics. Switching from the cinematic back to
the world palette is handled by putting up the loading plaque. Since a
cinematic always ends with loading somehting else this generally works.

Unfortunatly setting `developer 1` skips the loading plaque. The palette
never gets reset and the world looks like a bad LSD trip. ;) A correct
fix is complicated, because the loading plaque logic is messed up and
working by luck. Reworking the logic has a high propability breaking
corner cased exploited by mods.

Therefor take the easy route and uncoditionally switch to the world
palette when bringing up the loading plaque with `developer 1`.

Closes #925.
2022-10-23 14:50:47 +02:00
David Carlier
1a8f05b3ca gl3/gl3es renderer display intensity/colorlight sub options. 2022-10-22 21:19:28 +01:00
Daniel Gibson
690e46512e Restore stair step smoothing code for step sizes != 16
commit 93e9633382 "Port step smoothing code from r1q2." ported
r1q2 stair step smoothing for ranges that are equivalent to 8, 12 and 16
units/step.
Later in commit 7f996cc "Don't smooth half height steps" we removed
step sizes 8 and 12, because it appeared to make an elevator in hangar2
(over the water, after jump'n'run sequency) stutter.
However, in reality what made them stutter was the broken comparison
for velocity with an illegal cast, that we later fixed in
e30f82494 "Don't cast the array itself but it's content."

So now restore the smoothing for step sizes 8 and 12, which hopefully
fixes bug #923, and definitely does *not* break the elevater in hangar2.
2022-10-22 17:09:49 +02:00
Denis Pauk
b628fa9133 Share Mod_ReLoadSkins for reload images on model load 2022-10-17 22:43:40 +03:00
Denis Pauk
b2e8fbb086 Use quake style for types naming 2022-10-17 22:43:40 +03:00
Denis Pauk
f6e4f17c0a Mod_Load*: use pointer to image find 2022-10-17 22:43:40 +03:00
Denis Pauk
1dc617dee6 Mod_LoadMD2: Set max/min 2022-10-17 22:43:39 +03:00
Denis Pauk
e01e5273f8 {gl1,gl3,soft}_model.c fix const parameters 2022-10-17 22:43:39 +03:00
Denis Pauk
ae13c7e034 Share MD2/SP2 files 2022-10-17 22:43:39 +03:00
Yamagi
caab3864c6
Merge pull request #921 from BjossiAlfreds/ogg
Fixed ignoretrack0 and ogg menu option bugs
2022-10-16 18:57:35 +02:00
Jaime Moreira
f0d985dfb9 Deleted unneeded string terminators
Redundant after the usage of Q_strlcpy
2022-10-15 10:41:38 -03:00
Jaime Moreira
cc45e20bac Replaced strncpy with Q_strlcpy 2022-10-12 14:53:33 -03:00
BjossiAlfreds
e1efbecc82 Fixed ignoretrack0 and ogg menu option bugs 2022-10-12 13:42:48 +00:00
Jaime Moreira
7ca0ba4c11 Allows controller to select skin in menu 2022-10-11 17:13:26 -03:00
Jaime Moreira
b96734b9ee Skin names can have a length of 32 total
Fixes crash when entering "multiplayer" -> "player setup" menu with a skin name len > 16
Fixes "playermodels" cmd, which showed "(null)" as a final skin for every model
2022-10-11 16:58:44 -03:00
Jaime Moreira
5c7bf732df Player skins in menu sorted alphabetically
Mods in menu are now ordered: baseq2, xatrix, rogue, ctf, the rest
2022-10-08 17:21:50 -03:00
Yamagi
746f5ad21e
Merge pull request #913 from devnexen/sdl_windowmin_pause
pause the game when window is minimized.
2022-10-08 19:44:24 +02:00
David Carlier
9298c3abc8 pause the game when window is minimized.
closes #911
2022-10-08 18:03:03 +01:00
Yamagi
3222270df6
Merge pull request #900 from protocultor/delete_save
Quicksaves can be deleted from menu
2022-10-08 15:16:06 +02:00
Yamagi
294c4d1175
Merge pull request #896 from protocultor/gyro_invert
Options to invert gyro axes
2022-10-08 15:08:14 +02:00
David Carlier
f9d9577e9c fix some unitialized vars and clarify signedness on a handful of bitshift ops. 2022-10-08 15:07:02 +02:00
Jaime Moreira
654c145e29 Quicksaves can be deleted from menu
Also, avoids asking for deletion in "<empty>" savegames
2022-09-23 17:57:01 -03:00
Jaime Moreira
9de55c603d Classic cvar 'in_initjoy' resurrected
Added myself to credits
2022-09-19 11:36:23 -03:00
Jaime Moreira
da31490684 "Invert gyro" spincontrols 2022-09-19 11:27:47 -03:00
Jaime Moreira
54eb9e441d Sliders can ignore cvar value's sign, if needed
Gyro sensitivity sliders need this, since their values can be negative
to invert pitch and yaw.
2022-09-19 11:24:06 -03:00
Denis Pauk
61f4540617 Fix documentation for model preview.
All default players models have 84-94 frames for salute.
So value will be same for `cyborg`/`female`/`male`.
2022-09-18 12:39:50 +03:00
Denis Pauk
3b583a7143 Bumb game version value
New code has exported monster footsteps sounds function.

Fixes typos.
2022-09-18 12:39:50 +03:00
Denis Pauk
4946400260 sound: reverb logic cleanup 2022-09-18 12:39:50 +03:00
Denis Pauk
93c6c76b0e sound: cleanup reverb code 2022-09-18 12:39:50 +03:00
Denis Pauk
983f1db185 audio: Update autopick reverb magic 2022-09-18 12:39:50 +03:00
Denis Pauk
eb640a0033 sound: Little bit simplify reverb 2022-09-18 12:39:50 +03:00
SkacikPL
f0d6db5d4a Improved reverb behavior and presets
Adjusted presets and their ranges. Occluded sounds no longer have reverb.

Cherrypick of 66927bff72
2022-09-18 12:39:50 +03:00
SkacikPL
93812df488 Added reverb sound effect
Enabled by default, can be disabled via s_reverb 0. Also by default
picks preset automatically out of 7 presets based on surrounding
size, this function can be disabled via s_reverb_preset_autopick 0.
Presets can be set manually via s_reverb_preset (0-113).

Cherrypick of ac7be51e94
2022-09-18 12:39:50 +03:00
SkacikPL
66f1bc9a33 Add simple sound occusion based on YQ2 AL EFX code
Can be disabled via s_occlusion 0, strength is modified
via s_occlusion_strength (higher values are actually less occlusion).

Cherrypick of b557494e14
2022-09-18 12:39:50 +03:00
Denis Pauk
90b14fca24 game: make mframe static and export footstep functions 2022-09-18 12:39:50 +03:00
Yamagi
5a3163a7e4 Merge remote-tracking branch 'ui/ui' 2022-09-18 09:43:49 +02:00
Ted Thompson
7e7cda4487 Added brackets around mod names in menu 2022-09-17 17:30:17 +02:00
Yamagi
1053b5dfb1
Merge pull request #871 from 0lvin/new_commands
Add new cheats spawn commands
2022-09-17 17:17:02 +02:00
Yamagi
e705b48a8e
Merge pull request #883 from protocultor/thumbsticks_fs
Improved controller thumbsticks precision + Flick Stick
2022-09-17 16:13:57 +02:00
apartfromtime
f63b5914f6 Include guard pointers
Spincontrol checks for null itemnames, which could cause undefined behaviour (menu disappears or crashes) in some instances.
2022-09-10 09:05:36 +10:00
Denis Pauk
5cddd2110c client: add multiplayer model preview animation 2022-09-04 23:40:55 +03:00
Denis Pauk
cf110b5ea0 game: Add spawn on start point
It could be used for spawn weapon or opponnent for coop at spawn point.
2022-09-04 23:40:55 +03:00
Denis Pauk
2a8a2f390a game: add spawn entity by coordinates 2022-09-04 23:40:55 +03:00
Yamagi
ac9c09694a Don't try to draw particles if there aren't any.
This fixes a VLA getting allocated with length 0 which is undefined
behavior. Additionally it may yield a small performance gain in some
situations.
2022-09-04 18:45:07 +02:00
Yamagi
a4edbb979f
Merge pull request #866 from apartfromtime/ui
Make skin icon bitmap part of the player setup menu
2022-09-04 18:37:46 +02:00
Yamagi
a44de1596d Fix spin controls getting applied multiple times.
When a spin control is at min or max value, pressing the arrow key to
switch to the next nonexiting value executes the callback function. That
is confusing.

Example: 'freelook' is set to 'no'. The user presses left arrow,
switching to the nonexiting value before no. The code handles the
case and resets the current value drom -1 to 0. Nevertheless the
callback is executed and switches 'freelook' from no to yes...

Fix that by not executing the callback when we're at min or max value.

Closes #884.
2022-09-04 18:18:58 +02:00
Jaime Moreira
2ee5d7b479 IN_MapRange slight optimization 2022-08-25 21:07:53 -04:00
Jaime Moreira
c6dd713c89 Smooth rotation for Flick Stick
Added cvar to change maximum rotation angle that will be smoothed
2022-08-24 19:37:25 -04:00
Jaime Moreira
748909fd96 "Flick Stick" controller layout implementation
With southpaw version added to "sticks layout" menu
Cvar for length of stick to be considered a flick or rotation
Lacks rotation smoothing
2022-08-24 19:02:21 -04:00
Jaime Moreira
0417bc1023 Sloped axial deadzone added
2 cvars to change it, 1 per stick
Provides the "snap-to-axis" feeling of the previous axial deadzone
2022-08-24 17:48:33 -04:00
Jaime Moreira
f3fcf3fc24 Joystick handling refactored for precision
Changed 6 cvars for stick layout to 1; includes menu option
Axial deadzone replaced with radial one, 6 cvars to 2
Expo different for each thumbstick (1 cvar to 2); sliders included
Expo applied to full joystick vector magnitude, instead of per axis
Deleted "joystick_up" ("updown" function) and its sensitivity
2022-08-24 12:30:39 -04:00
Jaime Moreira
301a2ce735 Disable gyro when game is paused
Changed text on controller menu for lower resolutions
Appropiate data type for updates_countdown
2022-08-23 18:36:33 -04:00
apartfromtime
45f4e1860c Check for null and free correct number of directories
Potential errors.
2022-08-21 11:31:09 +10:00
apartfromtime
4c7ab467f8 Dangling pointer on free
Won't need the guard pointer.
2022-08-19 16:05:21 +10:00
apartfromtime
73427b77a2 Convert model info from AOS to SOA
Converted model info from AOS to SOA
All strings allocated dynamically at run-time
New command "playermodels" prints valid models to console
Fixes any bugs that may have existed in the directory search

The issue still exists of undefined behavior if a directory name for a
model exceeds the predefined limits.
2022-08-19 15:22:22 +10:00
apartfromtime
acea0c54d9 Remove player skin box bounds check introduced in #866
Failure produces black screen.
2022-08-13 10:09:05 +10:00
apartfromtime
e87f025d13 Merge branch 'master' into ui 2022-08-13 10:08:02 +10:00
apartfromtime
de051f248c Make skin icon bitmap part of the player setup menu
Adding menu bitmaps makes this possible.
Bounds check on skin box current value.
2022-08-06 13:20:21 +10:00
Jaime Moreira
5f59b752c0 Scope fixed for some cvars
Old sliders required some of their associated cvars to be "extern" so
their current value could be read. That's no longer needed, so they are
"static" now.
2022-07-30 14:29:38 -04:00
Jaime Moreira
6c4866995b Enhanced sliders for menus
"menuslider_s" types, used to create sliders in menus, now are directly
associated to a cvar. That makes possible for them to get their
currently selected value from the cvar, and express their min and max
values in terms of the real values of the cvar.
The rhythm at how they change can be overridden with s->slidestep.
The new sliders also present visually their current value to the user,
making them more useful than before.
2022-07-30 14:23:33 -04:00
Yamagi
90eb2f394d
Merge pull request #862 from devnexen/glrenderer_drawparticles_sig
R_DrawParticles2 signature slight change fixing build warning.
2022-07-22 10:14:37 +02:00
Yamagi
2cb98b7a1d
Merge pull request #857 from protocultor/gyro_bluetooth
Gyro aiming through Bluetooth for PS4 & PS5 controllers
2022-07-22 09:53:00 +02:00
David Carlier
136222d4d7 R_DrawParticles2 signature slight change fixing build warning. 2022-07-20 22:54:42 +01:00
Yamagi
aaffcf81b0
Merge pull request #861 from devnexen/client_pingserverfix
client ping server fix unitialized field.
2022-07-17 12:24:35 +02:00
Yamagi
91fd76ca5d
Merge pull request #860 from apartfromtime/ui
UI code maintenance
2022-07-17 12:24:20 +02:00
David Carlier
024d065f80 client ping server fix unitialized field. 2022-07-16 19:44:30 +01:00
apartfromtime
affea5aef3 Remove menu number of slots property
Remove unused and dead code.
2022-07-15 12:51:01 +10:00
apartfromtime
c0bad27f43 Pre-calculate x, y offsets
Make code easier to read.
2022-07-15 12:47:41 +10:00
Jaime Moreira
0bb2bf0cea Increased sensitivity range for controllers on menu 2022-07-07 23:43:02 -04:00
Jaime Moreira
1fa432f695 Gyro aiming through Bluetooth for PS4 & PS5 controllers 2022-07-05 19:15:10 -04:00
Yamagi
95eabefec9
Merge pull request #856 from apartfromtime/ui
Iterate once through menu item list
2022-06-25 17:28:40 +02:00
apartfromtime
c03f4fd094 Iterate once through menu item list
Avoids any infinite loop cases.
2022-06-25 14:17:58 +10:00
David Carlier
a635721c50 client download, sets a sane connection timeout, the default being way to high. 2022-06-24 20:49:23 +01:00
Yamagi
c6f6a17176
Merge pull request #849 from protocultor/gyro_aiming
Gyro aiming
2022-06-17 13:07:25 +02:00
Jaime Moreira
35495fb6f2 Readability improved for gyro calibration & controller hotplug code
"init_delay" was renamed to "updates_countdown", since it's now a "general
purpose" countdown, having also to count the inputs left for gyro calibration,
besides controller initialization.
Reason for the countdown is now explicit, not having to depend if
"gyro_calibration" was true or not to select what was the purpose of the
countdown.
Explanation comment added for gyro initialization on Linux & Mac.
REMINDER: see if SDL2 will keep the difference of gyro readings between Windows
and Linux/Mac for the Switch controllers.
2022-06-14 16:16:47 -04:00
Yamagi
ca70f8e679
Merge pull request #851 from devnexen/download_limits
client download, adding two new cvar to have the ability to set
2022-06-13 08:08:52 +02:00
Daniel Gibson
86811a4c24 Fix fallback when window couldn't be created because renderer is unsupported
For example, on Windows with AMDs drivers, GLES3 isn't supported,
so CreateSDLWindow() will fail. We should just try the regular GL3
renderer then instead of exiting with Com_Error()

Also make (Windows') Sys_Error() print to stdout (in addition to stderr),
so errors end up in stdout.txt as well (like all other messages).
2022-06-11 17:57:29 +02:00
Yamagi
a1dddaede3
Merge pull request #846 from devnexen/vla_0_fix
GL1 renderer fix VLA with no size cases,
2022-06-11 16:40:48 +02:00
Yamagi
a8ae79c6ab Remove twi unsused declarations. 2022-06-11 16:40:15 +02:00
David CARLIER
a01309235b client download, adding two new cvar to have the ability to set
a threshold to abort the download if a certain transfer rate is too low.
Disabled by default.
2022-06-11 13:41:24 +01:00
Jaime Moreira
df399576a2 Gyro normalization value in Windows improved
SDL2 provides different gyro readings between Windows and Linux/Mac for
the Switch Pro Controller. To keep the natural sensitivity scale intact
(in-game turn = controller turn), the normalization factor is handled
differently by platform, at least for now.
Also, now giving info when there's no gyro sensor available/detected.
And green light for the DualShock 4, because why not :)
2022-06-10 22:31:24 -04:00
apartfromtime
353295d0c7 Infinite loop in bind menu fix
Bug introduced in #841.
Added QMF_INACTIVE.
QMF_INACTIVE menu items are skipped.
2022-06-11 09:17:49 +10:00
Jaime Moreira
077d861a57 Gyro aiming menu options
"Gyro mode", "axis to turn" and "sensitivity" grouped with calibration.
2022-06-07 09:49:47 -04:00
Jaime Moreira
f12b759feb Gyro aiming configuration cvars
Cvar to choose between "yaw" (0) or "roll" (1) axis of the controller
to turn (change your yaw) in-game.
Cvars to change pitch and yaw gyro sensitivities.
Updated cvar documentation with new section "Game Controller".
2022-06-07 09:34:45 -04:00
Jaime Moreira
d3da95cfc8 Gyro aiming implementation
SDL 2.0.16 and a controller with a gyroscope required to make it work.
Manual calibration of the gyro sensor is needed to avoid "drifting"; a menu
option to do it is included.
New cvar 'gyro_mode' for mode of operation, and to assign action to the new
"+gyroaction" button: disable or enable the gyro.
2022-06-07 09:24:08 -04:00
Yamagi
a80f5b6cd7
Merge pull request #844 from protocultor/inventory
Inventory screen keys/buttons display fix
2022-06-07 14:22:23 +02:00
Yamagi
1cd347beb7
Merge pull request #843 from devnexen/fbsd_build_warnings
freebsd/clang and server only warnings build fix
2022-06-07 14:20:59 +02:00
Yamagi
82a280bc40
Merge pull request #841 from apartfromtime/ui
Add menu bitmap support
2022-06-07 14:19:26 +02:00
apartfromtime
42e85a207a Cache cursor frames
Bug fix. Missed bringing this over from my other failed pull request.
2022-06-05 13:28:58 +10:00
David Carlier
4a60ba634c GL1 renderer fix VLA with no size cases, 2022-05-29 14:43:28 +01:00
Yamagi
ba2fc77ee8 Enforce a minimal render (dsiplay) time for dlights of 32 milliseconds.
Several effects use dlights which are rendered for only one frame.
Muzzle flashes are an example. While this worked on 1997th computers,
todays hardware renders way too many frames for these dlights to be
visible at all. Work around that by enforcing a minimal display time
of 32 milliseconds for each dlight.

Fixes part of #815.
2022-05-28 16:44:29 +02:00
Jaime Moreira
0419cd7931 Inventory screen keys/buttons display fix
When a key/button name is too long, and its bound to an inventory element, its
display in the inventory screen misaligns the item it is bound to, even pushing
it out of the inventory frame.

This commit limits its display to the maximum of 6 characters the inventory
screen allows.
2022-05-21 22:59:02 -04:00
apartfromtime
7e1bc6911b Code style changes
Tabs to white-space.
BSD style.
2022-05-22 05:52:25 +10:00
David CARLIER
aaf6489d21 freebsd/clang and server only warnings build fix 2022-05-21 20:19:04 +01:00
apartfromtime
809588798e De-align apply action
Draw the "apply" action string from right to left, with no alignment.
2022-05-21 22:22:10 +10:00
apartfromtime
07fc65f9c5 Add menu bitmap support
Adds menu bitmap struct, drawing of a menu bitmap and highlighting if bitmap menu item is in focus.
Allows items that are gray (inactive) to be skipped when adjusting the menu cursor.
Removed switch case from Menu_SelectItem, all items either do or do not call their callback functions.
2022-05-21 22:21:29 +10:00
Yamagi
12c7fddfaa
Merge pull request #827 from protocultor/sdlcontroller
Full transition to SDL_GameController for gamepad usage
2022-05-17 19:42:19 +02:00
Daniel Gibson
7cf1392765 Qcommon_Frame(): Improve max framerate handling when vsync is enabled
When setting rfps based on GLimp_GetRefreshRate() and vid_maxfps,
take into account that GLimp_GetRefreshRate() might return a value
that's slightly too low (like 58 or 59 when it's 59.95 and should be 60)

The 20% tolerance that, in case of vsync enabled, used to be handled
with `packetdelta < 0.8 * 1000000/pfps` (and the same for rfps) is now
instead added to rfps (and thus implicitly pfps, if it's >= refreshrate)
2022-05-09 01:43:08 +02:00
Jaime Moreira
422715cee2 Hot plugging / hot swapping of game controller(s)
May be unreliable on some devices, e.g. Nintendo Switch Pro Controller.
Works great on others, e.g. DualShock 4.

Delay added to gamepad initialization on hotplug, gives time to the OS to
recognize the device.
2022-05-08 01:05:07 -04:00
Jaime Moreira
20542420ef New controller alt buttons menu option
Allows to bind buttons that only will work with "+joyaltselector" active.
The definition of another "scope" of keys was needed, to identify ALT bindings.
2022-05-08 00:24:52 -04:00
Jaime Moreira
0aa44afa13 New customize controller buttons menu option
Handles game controller button bindings exclusively.
Classic "customize controls" option now handles only keyboard / mouse bindings.
This separation is achieved with the new order of QKEYS in keyboard.h, and
binding functions in menus (especially "MenuKey" functions) now take into
account the "scope" where they operate: keyboard/mouse only, controller only,
or both.
2022-05-07 23:55:00 -04:00
Jaime Moreira
d4100f7113 Menu inputs standardised
Streamlined menu inputs by making most "*_MenuKey(key)" functions to use
Key_GetMenuKey(). "Backspace" is not a special case anymore, so any menus
that have a "delete" option can already handle any input expected, like the
backspace or delete keys, or the "Y" button of the controller, to run it.

Also, fixed a bug where changing the key for "team chat" also changes the one
for "chat" in the "multiplayer" -> "customize controls" menu.
2022-05-07 22:45:44 -04:00
Jaime Moreira
2bb1b33d7e Full transition to use only SDL_GameController for gamepad
This removes the usage of SDL_Joystick for joystick buttons and hat, and
relies exclusively on SDL_GameController for input. This allows to identify
buttons in a consistent manner across multiple types of controllers, which
in turn allows to assign specific tasks to them without worrying of breaking
usability, like having "A" to accept and "B" to cancel in menus.

Init and Shutdown logic of game controller have been separated from main SDL
Init and Shutdown functions.

Old style button names "JOYx" have been removed.

If your gamepad has paddles or other extra buttons, you'll need at least
SDL version 2.0.14 to use them.
2022-05-07 21:26:50 -04:00
Yamagi
e294fc94e5
Merge pull request #822 from DanielGibson/gles3-rb
OpenGL ES 3.0 support
2022-05-07 09:45:30 +02:00
David Carlier
c34071d05c curl client show progress only when there actually some 2022-05-07 07:03:40 +01:00
Daniel Gibson
56e1b9bc1e Add gles3 renderer to videomenu 2022-04-27 00:33:46 +02:00
Daniel Gibson
0881a63b1e GLES3: Explicitly don't handle gl_drawbuffer
GLES can't render to the front-buffer
2022-04-27 00:33:46 +02:00
Daniel Gibson
a195305592 GL3: Fix particles on RPi4
tested V3D 4.2; OpenGL ES 3.1 Mesa 20.3.5
2022-04-26 04:10:57 +02:00
Daniel Gibson
89f63915a3 GLES3: Make newer shaders work with OpenGL ES 2022-04-26 04:09:38 +02:00
Daniel Gibson
c936e43420 GL3: Use one projection-view matrix in shaders
instead of separate projection and view matrices - this way there is
one less mat4 multiplication in the 3D vertex shaders.
2022-04-26 04:09:38 +02:00
Daniel Gibson
1eabde6b55 GL3: Make GLES3 work on Raspberry Pi 4B
(older Raspberry Pi versions don't support OpenGL ES 3.0, only 2.0)
2022-04-26 04:09:38 +02:00
Daniel Gibson
8737ce64fc GL3: Support OpenGL ES3.0 (compile time option GL3_GLES=yes)
the option defaults to no, of course.
2022-04-26 04:09:38 +02:00