Commit graph

2530 commits

Author SHA1 Message Date
Denis Pauk
a7199f95db Always flush whole texture to render 2019-07-05 22:28:48 +03:00
Denis Pauk
ceb7fd03b1 fix issue with back_max in RE_BufferDifferenceStart 2019-07-05 22:28:48 +03:00
Yamagi Burmeister
6db1203f22 Evil hack to work around SDL bug 4700.
Check if we're in the requested mode after the fullscreen window was
created. If not: Try to switch again in the requested mode by calling
SDL_SetWindowDisplayMode(). If that's successfull set the new window
size with SDL_SetWindowSize(). That shouldn't be necessary, at least to
SDLs crappy doku, but without the subsequent SDL_GetWindowDisplayMode()
call fails with 'Invalid Window'. Use that call to check if we're now
in the requested mode. If yes, process. If not abort and trigger the
fallback magic. It'll set `r_mode 4` and `vid_fullscreen 0`.

Caveat: In the worst case this will switch the display mode 3 times.
To create the window, to work around the bug and to set a refresh rate.
No problem for flat panels, but my unforgotten Trinitron CRT would
have cried in pain.
2019-07-05 14:12:27 +02:00
Yamagi Burmeister
890d708085 Add a new cvar vid_rate and make sure that we're at the requested mode.
* Normaly SDL chooses a sane refresh rate for fullscreen windows. Users
  may want to override that, so provide a new cvar `vid_rate`. If it's
  set to a value greater than 0, we're trying to get a mode close to the
  requested resolution and refresh rate and switch to that.
* A bug in SDL may leave us in the wrong mode, detect that condition and
  abort. See https://bugzilla.libsdl.org/show_bug.cgi?id=4700 for details.

This is part of issue #302.
2019-07-02 19:04:13 +02:00
Yamagi Burmeister
aeca570a96 Fix code style after latest changes.
Since it's apperently too hard to stay within the style and I'm sick of
discussing it, I fix it by myself.
2019-07-02 17:52:17 +02:00
Yamagi Burmeister
b5f3a79f5d Print SDL display modes.
Print a list of all available modes as soon as SDLs video backend
initializes and the real display mode after the window was created
or altered.

This hopefully helps debbuging problem with display mode selection, see
issue #302 for an example.
2019-06-29 21:11:44 +02:00
Yamagi
40b5fbe87a
Merge pull request #412 from Spirrwell/master
Multi-Monitor Management
2019-06-29 21:06:37 +02:00
Spirrwell
4f5de01d8e (Code Formatting)Fix Indentation 2019-06-29 13:54:59 -04:00
Yamagi
75c0450508
Merge pull request #415 from 0lvin/for_review
Soft render speed up
2019-06-25 15:21:50 +02:00
Denis Pauk
f8c73ca731 Flush only frame difference. 2019-06-24 21:47:42 +03:00
Denis Pauk
60f9af27f5 Dynamicly allocate lights 2019-06-24 21:47:42 +03:00
Denis Pauk
9783e7955f correctly check limits in RE_Draw 2019-06-24 21:47:42 +03:00
Denis Pauk
65888e6b9b fix distance selection for mip level 2019-06-24 21:47:42 +03:00
Denis Pauk
a2af07c9fc make d_ziorigin, d_zistepu, d_zistepv local 2019-06-24 21:47:42 +03:00
Denis Pauk
25a2aff688 render code cleanup and allocate spans at once 2019-06-24 21:47:41 +03:00
Denis Pauk
5f2293bf0d limit surfaces amount to unsigned short 2019-06-24 21:47:41 +03:00
Yamagi
a4c958ac96
Merge pull request #413 from sdfdfhgh/patch-3
Update README.md
2019-06-23 19:19:00 +02:00
sdfdfhgh
40cf95977e
Update README.md
minor fixes
2019-06-17 08:39:31 +04:30
Spirrwell
39728eb5d4 (Multi-Monitor)Hide "display index" Option If Single Display
-The "display index" option will now no longer show up in the "VIDEO" menu if user only has a single display
2019-06-16 17:35:55 -04:00
Spirrwell
fc78aefee3 (Multi-Monitor)Better Handling
-Add back use of last_position_x and last_position_y
-last_position_x and last_position_y will be set to undefined when the window is shutdown IF the current display used is not the desired display
-last_display will be set to desired display at window shutdown if not the same
-vid_displayindex clamped using ClampDisplayIndexCvar() at startup and window shutdown
2019-06-16 17:34:00 -04:00
Spirrwell
0da8099de8 (Multi-Monitor)Code Cleanup
-We only need to init the display indices once in GLimp_Init
-We only need to clear the display indices once in GLimp_Shutdown
-Remove extra 'displayindex' variable
2019-06-16 01:11:20 -04:00
Spirrwell
03e3c6bf71 Move 'num_displays' Initialization
-SDL_GetNumVideoDisplays() will always remain the same after the call to SDL_Init(SDL_INIT_VIDEO), so it makes sense to set in GLimp_Init where we do this.
2019-06-16 01:02:53 -04:00
Spirrwell
f6a9690a36 (Multi-Monitor)Can Choose Which Monitor to Use
-Adds option in the "VIDEO" menu for "display index" that lets you specify which monitor you would like to use.
2019-06-16 00:50:15 -04:00
Yamagi Burmeister
1f1a45a562 Push entitie slightly away from non horizontal surfaces.
Otherwise the entities origin might be in the surface, which causes it
to be rendered in full black. This fix is a port from KMQuake2, reported
by @m-x-d. Closes #407.
2019-06-15 17:39:51 +02:00
Yamagi
025a956197
Merge pull request #406 from maxcrofts/mouse-console-scrollback
Allow scrolling with mouse in console
2019-06-07 14:43:05 +02:00
Max Crofts
bc565030a5 Allow scrolling with mouse in console
Mouse keycodes have been added to consolekeys. Unbound key warnings now only print when in-game.
2019-06-04 19:36:37 +10:00
Daniel Gibson
ebb6b9fce6 Fix link to cvar documentation in --help
also add a link to the new location in the old location, for existing
releases
2019-06-02 19:28:49 +02:00
Yamagi Burmeister
1668f5950e Fix missleading console message.
Reported by @m-x-d, closes #402.
2019-05-30 11:14:23 +02:00
Yamagi Burmeister
8e779bfb87 Remove superfluous statements.
`while (*s != '\\' && *s)` already checks for `s` being valid. This was
reported by @m-x-d, closes #401.
2019-05-30 11:14:11 +02:00
Yamagi Burmeister
c0d45ece57 Add missing word. 2019-05-26 15:57:59 +02:00
Yamagi Burmeister
4573e9639e Bump version number to 7.42pre. 2019-05-26 09:14:30 +02:00
Yamagi Burmeister
8bcb8f849c Bump version number to 7.41. 2019-05-26 08:43:11 +02:00
Yamagi Burmeister
40667b133f Some fixes and clarifications to the CHANGELOG. 2019-05-25 10:21:11 +02:00
Yamagi Burmeister
12084193c4 Add cURL to the LICENSE file. 2019-05-13 18:02:50 +02:00
Yamagi Burmeister
83a5d3c905 Mention the preview builds for Windows. 2019-05-13 17:48:46 +02:00
Yamagi Burmeister
298cb05d61 Update the CHANGELOG for the upcoming 7.41 release. 2019-05-13 17:28:04 +02:00
Yamagi
33bfd28ebc
Merge pull request #400 from DanielGibson/wrapper-foreground
quake2.exe wrapper puts Q2 window in foreground
2019-05-09 18:12:31 +02:00
Yamagi
8863ea2346
Merge pull request #399 from maxcrofts/master
CMake fixes for Windows
2019-05-09 18:12:14 +02:00
Yamagi Burmeister
9b80745d5d Fix cursor position in the 'name' field in the player setup menu.
This closes #396.
2019-05-09 18:01:36 +02:00
Daniel Gibson
7db5c71f3a quake2.exe wrapper puts Q2 window in foreground
because it sucks when you start quake2.exe and the game starts in the
background
2019-05-08 03:04:12 +02:00
Max Crofts
a43f3873a5 Link SDL with q2ded on Windows
This is in line with what the makefile does.
2019-05-07 19:16:02 +10:00
Max Crofts
332a322d8e Remove frame.c from CMakeLists.txt 2019-05-07 19:15:47 +10:00
Daniel Gibson
f5d9c49f20 Allow second layer of keybindings for controllers, refs #387
There's an "enable alt joy keys" command now. If a key is bound to that
command, all joystick buttons (incl. hat and triggers) are turned from
K_JOYx into K_JOYx_ALT, which allows two keybindings on the same key,
one with the altselector pressed and one without.
If there's no keybinding for K_JOYx_ALT, it will use the binding for
just K_JOYx as a fallback (if it exists).

This is especially handy to create direct bindings for all the weapons
on the (limited amount of) Joystick buttons.
2019-05-05 18:10:10 -01:00
Daniel Gibson
c57befe80d When opening file make sure it's actually a file, fixes #394
... and not a directory, which can cause crashes.
2019-05-04 19:55:38 +02:00
Daniel Gibson
d84bc47766
Merge pull request #395 from DanielGibson/faster-gl3
Make gl3 fast with AMDs Windows drivers, fix overbright models with SURF_DRAWSKY
2019-05-04 14:39:30 -01:00
Daniel Gibson
107d044da2 Make AMD performance workaround conditional per driver version 2019-05-04 17:37:16 +02:00
Daniel Gibson
cdf533f995 Fix overbright models in GL3, refs #393
also some dumb bug with using i in two nested loops
2019-05-04 17:37:16 +02:00
Daniel Gibson
26a461575b Try to make GL3_BufferAndDraw3D() faster on AMD/Windows
Seems like AMDs Windows driver doesn't like it when we call
glBufferData() *a lot* (other drivers, incl. Intels, don't seem to
care as much).
Even on an i7-4771 with a Radeon RX 580 I couldn't get stable 60fps
on Windows without this workaround (the open source Linux driver is ok).

This workaround can be enabled/disabled with the gl3_usebigvbo cvar;
by default it's -1 which means "enable if AMD driver is detected".

Enabling it when using a nvidia GPU with their proprietary drivers
reduces the performance to 1/3 of the fps we get without it, so it
indeed needs to be conditional...
2019-05-04 17:37:16 +02:00
Daniel Gibson
7b4dc000ad Unify buffering data and drawing with gl3state.v[ab]ao3D
use GL3_BufferAndDraw3D() instead of glBufferData() and glDrawArrays()
in each place it's needed.
This by itself doesn't make anything faster, but it will make trying out
different ways to upload data easier.
2019-05-04 17:37:16 +02:00
Yamagi Burmeister
44e8088f7d Document gl_fixsurfsky. 2019-05-04 17:35:19 +02:00