Commit graph

3649 commits

Author SHA1 Message Date
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
Daniel Gibson
89b0ed9f18 Fix build with newer Visual Studio versions
in the __STDC_VERSION__ >= 201112L + _MSC_VER case YQ2_ATTR_INLINE
wasn't defined

and fixed some indenting in the surrounding code
2022-11-24 15:38:34 +01: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
Yamagi
8b12b017f7 Handle SIGBUS. Or at least try it.
I was reported a strange problem were GL3 is crashing with SIGBUS while
enumerating the GL extensions. To me it looks like a problem in Nvidias
FreeBSD driver, which for some reason doesn't reproduce on my machine.
However it' hard to tell what exactly happens without a full backtrace
and the user is unable to provide one... For the future try to handle
SIGBUS to catch those problems.
2022-11-14 21:37:47 +01: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
Daniel Gibson
17728f12c3 Workaround for #910 (explosions sometimes not drawn when in water)
Sometimes, when half-submerged in opaque water (head/camera still
above water), explosions and similar weren't drawn, because
1. The check whether a client gets a message to draw an explosion (etc)
   uses the clients origin, not the camera position
2. Apparently the map compiler was buggy and (only in some places!)
   didn't correctly mark areas in the PVS/PHS (PHS is for hearing) as
   connected even though they should be (when underwater you should be
   able to hear things in the region above the water, even if the water
   is opaque and you can't see it).

This is an experimental(!) workaround that does a second check with a
higher origin if the first check fails and the client is currently
(considered) under water.
It's totally possible that this breaks other things, I don't know..
By the way, a good place to test this is the first water area in jail1
2022-11-06 17:56:44 +01:00
David Carlier
575ea06b9d gl1 and gl3 having their own menu data 2022-11-06 16:18:53 +00:00
Yamagi
96aafef55a
Merge pull request #928 from devnexen/va_fn_sig_chang
va little signature change
2022-11-05 09:58:10 +01:00
Yamagi
5d6b56b103
Merge pull request #927 from protocultor/rumble
Controller rumble support
2022-11-05 09:56:03 +01:00
Yamagi
d58116d717
Merge pull request #916 from 0lvin/color_console
Unix: Add color output for console
2022-11-05 09:49:00 +01: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
David CARLIER
0bc3ac6079 va little signature change 2022-10-23 22:27:39 +01:00
Denis Pauk
c890e59aaa Reset to default font settings instead white on black 2022-10-23 22:44:30 +03:00
Denis Pauk
66d0751caf Linux: Add color output for console
Usecase: show map name on level load.

Add colorterminal cvar for disable.

xfce4-terminal has:
 * TERM=xterm-256color
 * COLORTERM=truecolor
2022-10-23 22:44:30 +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
Yamagi
898b87f0f4
Merge pull request #908 from 0lvin/shared_model_load
Shared model load
2022-10-19 18:58:29 +02:00
Yamagi
bd97725a3d Fix savegame backward compatibility after cfb86ac.
The steps when loading a savegame are:

1. The server loads the map.
2. Loading the map spawns all entities, i.e. their spawn func is called.
   This loads the models, precaches the sounds, etc.
3. The savegame is loaded and all the entities in the edict are replaced
   by the entities read from game.ssv.

When the monster footstep sound were added in cfb86ac, new sounds were
added to the spawn functions of most monster entities. This alters the
sound indices of all sounds precached at a later time. When a savegame
from an older version is loaded, the entities read from game.svv still
reference the old sound indices. This leads to the wrong sound getting
played.

Work around this by lazy loading the footstep sounds. Instead of loading
(precaching) them in the spawn function, load them at their first use.
This has the nice side effect of preventing the "missing sound" messages
when running without the footsteps.pkz file in baseq2/. It might lead to
short stuttering when the sound is played for the first time, though.

Closes #917.
2022-10-18 07:40:47 +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
Yamagi
0b41a83410
Merge pull request #919 from protocultor/playerskins
Fix for crash with long player skin name
2022-10-16 18:57:16 +02:00
Jaime Moreira
f0d985dfb9 Deleted unneeded string terminators
Redundant after the usage of Q_strlcpy
2022-10-15 10:41:38 -03:00