Commit graph

1404 commits

Author SHA1 Message Date
Yamagi Burmeister
86fd714788 Allow to choose the fullscreen mode through the menu.
There're 3 possible values:
* no -> vid_fullsceen == 0
* keep resolution -> vid_fullscreen == 1
* switch_resolution -> vid_fullscreen == 2
2017-08-01 18:32:44 +02:00
Yamagi Burmeister
911d225496 Pass an integer to SetMode_impl() instead of a qboolean.
The functions signature was changed several commits ago.
2017-08-01 18:20:30 +02:00
Yamagi Burmeister
3f8be88e84 Fix fullscreen switch through alt-enter. 2017-08-01 18:16:24 +02:00
Daniel Gibson
6d39da37ca Print system SDL version on startup 2017-08-01 18:14:31 +02:00
Yamagi Burmeister
5e61c23fd8 Only set SDL 1.2 fullscreen if it's requested. 2017-08-01 18:11:46 +02:00
Yamagi Burmeister
908fd30148 Switch from SDL_WINDOW_FULLSCREEN to SDL_WINDOW_FULLSCREEN_DESKTOP.
SDL_WINDOW_FULLSCREEN changes the display resolution if the requested
resolution is different to the actual resultion. SDL_WINDOW_FULLSCREEN_
DESKTOP doesn't do that, it places a smaller or bigger render area
somewhere inside the fullscreen area. This is somewhat nicer with modern
high resolution flatscreens.

This commit changes vid_fullscreen 1 from SDL_WINDOW_FULLSCREEN to
SDL_WINDOW_FULLSCREEN_DESKTOP. Additional vid_fullscreen 2 is
implemented, it uses SDL_WINDOW_FULLSCREEN to create the fullscreen
area.

TL;DR: Use vid_fullscreen 1 to keep the current resolution or use
vid_fullscreen 2 to switch the resolution.

Implementation details: The whole fullscreen stuff is a horrible mess.
Like generations of hackers before me I'm not desperated enough to clean
it up. GLimp_InitGraphics() is modified to take the fullscreen mode as
an integer and not as a boolean. That's a change to the renderer API.
In GLimp_InitGraphics() the needed SDL fullscreen mode flag is
determined once at the top and just used further down below. That saves
dome SDL1 <-> SDL2 compatibility cruft. IsFullscreen() was modified to
return the actual fullscreen mode and not just if fullscreen is enabled.
2017-08-01 10:08:24 +02:00
Yamagi Burmeister
4f803aedd2 Correct some missindentions pointed out by recent GCC versions. 2017-06-30 13:52:09 +02:00
Yamagi Burmeister
e134ae578f Reset vod_renderer to gl1 if the requested lib couldn't be loaded.
This was reported in issue #209.
2017-06-30 13:43:37 +02:00
Yamagi Burmeister
815bc34646 Bump version to 7.02pre. 2017-06-24 08:49:11 +02:00
Yamagi Burmeister
e1aadc5796 Bump version to 7.01. 2017-06-23 15:46:41 +02:00
Yamagi Burmeister
dd41ff3601 Tell Windows that we're HighDPI aware.
This prevents Windows from scaling our (fullscreen) window to crap if
the whole desktop is scaled and we're rendering more than 1080p. This is
believed to fix #208.
2017-06-21 10:17:16 +02:00
Daniel Gibson
23ea2ea034 GL3: Square particles with cvar gl3_particle_square
if that cvar is set to 1, particles aren't rendered as nice circles, but
as squares, like in the software renderer or in Quake1.

Also documented it in cvarlist.md and fixed some typos there
2017-06-20 18:31:32 +02:00
Daniel Gibson
1da7ff5594 Fix Jennell Jaquays' name in credits and quit screen
the latter is done by identifying the baseq2 pics/quit.pcx in LoadPCX()
and changing some pixels
2017-06-12 18:32:56 +02:00
Daniel Gibson
36c880e105 GL3: Update HandMadeMath.h to include my non-SSE patch
from https://github.com/StrangeZak/Handmade-Math/pull/60

Hopefully fixes #204 (broken build on ARM)
2017-06-09 12:30:44 +02:00
Yamagi Burmeister
8fa861d8e9 Bump version to 7.01pre.
While here remove missleading comment.
2017-06-08 18:12:55 +02:00
Yamagi Burmeister
95b0c6a38b Bump the version number to 7.00. 2017-06-08 17:29:51 +02:00
Yamagi Burmeister
f6e3f1f4bc Hide OpenALs doppler effect behind s_doppler.
This allows it to disable the doppler effect by setting s_doppler to 0.
The default value 1 == enabled.
2017-05-25 09:11:47 +02:00
xorw
ff54b3ac1f use correct velocity scaling for openal audio sources 2017-05-20 07:23:24 +02:00
Daniel Gibson
865e97514d GL3: Render Model shadows last, reduce global variables in gl3_mesh.c
The model shadows are rendered after all entities are rendered.
This fixes them making entity brushes below them translucent (#194)

The model rendering code used lots of global variables, many of them
totally superfluous (esp. currententity, currentmodel).
I refactored the code to use less global variables (this was at least
partly needed to render the shadows later).
So this looks like lots of changes, but many of them are just using
"entity" instead of "currententity" or "model" instead of "currentmodel"
2017-05-15 12:34:38 +02:00
Yamagi Burmeister
6119591c6a Fix build with WITH_OPENAL disabled.
This closes issue #192.
2017-05-13 16:53:20 +02:00
xorw
29d109f8ef Finished doppler shift support (added listener's velocity update) 2017-05-10 12:21:56 +02:00
Yamagi
e6d46eb452 Merge pull request #193 from xorw/master
Add partial doppler shift support for 3D audio sources.
2017-05-09 21:38:30 +02:00
xorw
da5aea4929 Add partial doppler shift support for 3D audio sources.
In game noticeable when dodging blaster projectiles or missiles :)

See: https://en.wikipedia.org/wiki/Doppler_shift
2017-05-07 06:14:10 +02:00
Daniel Gibson
9751caac85 GL3: Optimize shadow rendering
now DrawAliasShadow() only uses one draw call per model, pretty much
like DrawAliasFrameLerp()
2017-05-02 06:25:04 +02:00
Daniel Gibson
b45a6d8ef9 GL3: Simple Stencil-Shadows
Like GL1 gl_shadows + gl_stencilshadows: no shadow volumes, but looks
ok apart from standing over edges

The gl_stencilshadows cvar isn't used in GL3, it always uses the stencil
buffer if available (and if gl_shadows != 0)

This still needs performance optimizations: Like the GL1 impl it takes
lots of draw calls per model, it could be done with one per model like
when rendering the actual model.
2017-05-02 06:25:04 +02:00
Yamagi Burmeister
a31c309f68 Scale entity alpha values by 0.666f.
This makes the black hole generator (the rotating circles) in command
looking great again. :)
2017-04-27 17:33:40 +02:00
Daniel Gibson
79e9c8c3d0 GL3: gl3_intensity_2D cvar for HUD, menu, console, video intensity
there have been complaints that those things look too bright, so let
people configure their intensity independently of the general intensity
used for levels, monsters etc.

fixes #189
2017-04-25 15:02:22 +02:00
Daniel Gibson
ff6e7ede26 GL3: Apply scroll offset to x also for transparent scroll surfs
no idea where this is used, but it should be correct this way
2017-04-24 15:22:02 +02:00
Yamagi Burmeister
dd007f340a Apply scroll offset the x coordinate and not to y.
When applied to y SURF_FLOWING textures are scrolled into the wrong
direction. I guess that in GL1 the offset is also applied to x.

This fixes issue #186.
2017-04-24 14:50:00 +02:00
Yamagi Burmeister
df85228ba4 Unqueue raw samples if Vorbis playback is paused.
Without this some samples will loop forever.
2017-04-23 21:55:27 +02:00
Yamagi Burmeister
98276aeb91 Empty SDLs event queue when starting cinematic playback.
Sometimes cinematics are skipped after the first frame even if the
player didn't press any key. I'm unable to reliable reproduce that,
so my educated guess is that one or more events are still waiting in
SDLs event queue.

For example, during intermission IN_Update() is not called for 5
seconds, key presses by impatient players are just added to the queue
and not processed. The first event is used to skip leave the
intermission, the second event skips the cinematic...

Fix this by implementing a new function IN_FlushQueue() to flush SDLs
event queue and calling it when starting cinematic playback. Yes, this
is just another layer violation. :(
2017-04-22 10:29:25 +02:00
Yamagi Burmeister
c0b768278f Fix build with SDL 1.2 2017-04-22 10:24:12 +02:00
Yamagi Burmeister
eb2a11f0b2 Unqueue raw samples when the menu is entered during cinematic playback
When the client is paused (either explicit or by entering the menu or
console) the cinematic is paused, too. Therefor no more sound samples
are generated and added to the playback queue, the existing samples are
played over and over again. Until now these samples weren't hearable,
because OpenAL marked them as processed and AL_StreamUpdate() removed
them from OpenALs playback queues. This changed in the previous commit,
now the stay in OpenALs queue and are hearable.

Fix this by calling AL_UnqueueRawSamples() when the menu or console is
entered during cinematic playback.
2017-04-22 09:50:52 +02:00
Yamagi Burmeister
12fba237c2 Fix raw samples playback with newer openal-soft versions.
Newer openal-soft versions changed the way how the processed buffers are
counted when in AL_STOPPED state. Previously only processed buffers were
counted, now all buffers are. Change our unqueue logic to match this new
behavior.

This was debugged and fixed @xorw, I'm just committing the patch. This
closes issue #185.
2017-04-22 09:42:56 +02:00
Yamagi Burmeister
9bc980811f Remove s_openal_maxgain. It's unused since the previous commit. 2017-04-21 17:14:19 +02:00
Daniel Gibson
fafc4d385e Don't set AL_MAX_GAIN for OpenAL listener
it's only for sources
2017-04-21 15:43:16 +02:00
Yamagi Burmeister
9359d6d51d Some more debug / log output at refresher startup
- Print which library is loaded.
- Print the client version against which the library was build.
2017-04-20 19:57:42 +02:00
Yamagi Burmeister
a47a9daf67 Fix crash if the requested gl_msaa_samples are unavailable.
For some reasons setting the MSAA fails at window creation and not at
GL context creation. And of course SDL is unable to detect before, that
the requested number of MSAA samples is invalid... Implement a work
around: Fall back to gl_msaa_samples == 0 if the window cannot be
created.
2017-04-18 20:56:54 +02:00
Yamagi
78ca79c602 Merge pull request #181 from DanielGibson/render_dll
Resurrect support for render / refresher loadable libraries and use them to implement  an experimental OpenGL 3.2 renderer. Please note that the new renderer interface is somewhat different from the original one, old render libraries will NOT work!
2017-04-18 17:12:40 +02:00
Daniel Gibson
6e7dc59622 GL3: Deactivate STUB_ONCE() messages 2017-04-18 17:08:42 +02:00
Daniel Gibson
7d53e6ebf2 Quirk map bug in waste3 (secret not counted)
there's a target_secret (with targetname "t117"), but no one triggers
it - that's why the help computer shows four secrets, but you can only
get three of them.
Now when you open the door in front of the hidden secret armor
(by shooting it), it'll trigger the target_secret and you can get all
four secrets.

fixes #182
2017-04-15 18:38:09 +02:00
Yamagi Burmeister
0608eed7c3 Fix order of the video menu items.
The internal order of the items is determined by Menu_AddItem() and
not the y position. Without this change the cursor didn't jump from
item to item, but from the mode list box to the aspect list box,
skipping the brightness slider.
2017-04-11 14:54:22 +02:00
Yamagi Burmeister
b48108cf37 Add the renderer selection back to the video menu.
Remove the 'viewsize' slider to free one row. Use this row for the new
renderer selection. While at it reorder the items.
2017-04-10 23:15:36 +02:00
Yamagi Burmeister
df86c46e57 Several adjustments to the visual impression.
- Bump vid_gamma to 1.2 in both GL1 and GL3. A default value of 1.0 is
  too dark.
- Lower gl3_overbrightbits to 1.3, the previous value of 1.5 was too
  bright. This can be seen in later units, for example on mine1 some
  textures blended into white.
- Lower gl3_particle_size to 40. A value of 60 may be okay, but with
  gl3_particle_fade_factor 1.2 the particles take up too much screen
  estate in close range combat.

With this changes GL3 looks (at least for me) nearly the same as GL1
rendered through the removed multitexturing path.
2017-04-10 19:28:46 +02:00
Yamagi Burmeister
8316dfe3d9 Change the dynamic light cuttoff from 64 to 52.
64 was the cutoff used by GL1. Testing showed that 52 is better suited
for GL3. Good levels to test this can be found in the Mines unit.
2017-04-10 19:28:46 +02:00
Yamagi Burmeister
0314eafdaa Cap dynamic light intensity / brightness to 3.
Without capping the brightness entity models may fade into pure white
which looks ugly. This can be seen when several flyer fire blaster
bolds onto the player or when multiple barrels are exploding. This
change was suggest by @DanielGibson, I'm just the messenger.
2017-04-10 19:28:46 +02:00
Yamagi Burmeister
8c665b826c Do not enforce the Vrect to have even width and heights.
I really don't see why this constraint was ever necessary. It leads to
one line of pixels not rendered either at the bottom or the right edge
of the screen. In GL1 for whatever reasons this line is just black, in
GL3 garbage is drawn.
2017-04-10 19:22:23 +02:00
Daniel Gibson
b916d11662 GL3: gl3_particle_fade_factor cvar to configure particle softness
the higher it is, the less soft (more like in GL1) the particles look

While at it, I removed lmOffset from uni3D, as it's not used.
2017-04-10 19:04:59 +02:00
Yamagi Burmeister
e510bfc281 Fix render artifacts around health points when the HUD is scaled.
In SCR_DrawFieldScaled() the HUD scale factor wasn't taken into account
when calculating the screen area affected by the change. Therefor wrong
coordinates were passed to SCR_AddDirtyPoint() and a part of the changed
area wasn't marked dirty, leading to render artifacts.

This bug was present since HUD scaling was first introduced.
2017-04-10 15:50:48 +02:00
Yamagi Burmeister
4bd263c4d4 Some cleanup to the Makefile.
- Rename REFGL to REFGL1 for consistency with REFGL3.
- Fix some comments.
- There's no need to link flash.c and rand.c into both renderer libs.
2017-04-10 15:50:25 +02:00