Commit graph

2335 commits

Author SHA1 Message Date
Yamagi Burmeister
f7e80c1428 General cleanup to the Makefile. 2018-08-14 15:01:45 +02:00
Yamagi Burmeister
93aa8270ad No need to print that the renderer as retexturing support.
Retexturing support has been non-optional for years.
2018-08-14 11:53:35 +02:00
Yamagi Burmeister
cf09fb2a99 Remove support for static linked OpenAL.
We haven't used that for years and it just complicates things.
2018-08-14 11:51:55 +02:00
Yamagi Burmeister
daf3dc6f41 Remove ZIP compile time option.
Having ZIP optional only complicates things and is unnecessary now that
the dependency to zlib is gone.
2018-08-14 11:12:38 +02:00
Yamagi Burmeister
0264c6d946 Remove DOGG compile time option.
Having OGG optional only complicates things and is unnecessary now that
the dependencies to libvorbis and libogg are gone.
2018-08-14 10:40:50 +02:00
Denis Pauk
49af62477a rename gl_anisotropic to r_anisotropic 2018-08-10 23:33:46 +03:00
Denis Pauk
ba38bf4f88 Small cleanups
* Use window width as maximum value for spancount
* Reuse GLimp_Shutdown
2018-08-10 23:04:19 +03:00
Denis Pauk
6e8170e187 Check possible span scan step by zindex 2018-08-10 22:59:29 +03:00
Denis Pauk
59133c77aa use zvalue_t for z values 2018-08-10 22:59:29 +03:00
Denis Pauk
48f67501fc Fix pitch compare vid.width 2018-08-10 22:59:29 +03:00
Denis Pauk
6affc10ceb use only one increment in loop 2018-08-10 22:59:29 +03:00
Denis Pauk
0d69454b54 revert nack a little 2018-08-10 22:59:29 +03:00
Denis Pauk
a3406b38a3 use memset for copy pixel to pixel range 2018-08-10 22:59:29 +03:00
Denis Pauk
51e09331e2 get rid extern aliastriangleparms 2018-08-10 22:59:28 +03:00
Denis Pauk
61d7b187c0 make more varibles local 2018-08-10 22:59:28 +03:00
Denis Pauk
3c89fec026 fix comments 2018-08-10 22:59:28 +03:00
Denis Pauk
861e47c26e use short names for D_DrawTurbulentSpan 2018-08-10 22:59:28 +03:00
Denis Pauk
3ed798ae70 use func params instead static variables 2018-08-10 22:59:28 +03:00
Denis Pauk
f1b8571369 Use common step for span scanning 2018-08-10 22:59:28 +03:00
Denis Pauk
8905763c01 show * mark for used models/images in modellist/imagelist 2018-08-10 22:59:28 +03:00
Denis Pauk
1e3e853bc7 Optimize D_DrawSpans16 for horisontal/vertical spans 2018-08-10 22:59:28 +03:00
Denis Pauk
b46a615eb8 use more simple loop for vertical/horisontal spans 2018-08-10 22:59:28 +03:00
Denis Pauk
4093a49f0f use const for ro parameters 2018-08-10 22:59:28 +03:00
Denis Pauk
e748ed1af8 move code for instert new span to list top to separate function 2018-08-10 22:59:28 +03:00
Denis Pauk
d9eb925b33 move Mod_RadiusFromBounds to shared code 2018-08-10 22:59:28 +03:00
Denis Pauk
78383add97 move varibales to scope 2018-08-10 22:59:28 +03:00
Yamagi Burmeister
be9942d516 Fix window handling when switch from gl to soft renderer.
Make sure that the window is destroyed at gl renderer shutdown and
recreated by the soft renderer. Don't deinitialize SDL in the
softrenderer, that's done by vid.c. And make sure that we start the soft
renderer with a clean GL state.
2018-08-10 12:19:15 +02:00
Yamagi Burmeister
c4bdea4321 Add miniz to the LICENSE file. 2018-08-10 10:28:02 +02:00
Yamagi Burmeister
e7fa5518a9 Replace zlib dependency by miniz single header library.
I've chosen the minimal invasive way for this:

  * Import miniz and remove -lz linker flags.
  * Create a short header minizconf.h roviding everything we need
    originally defined by zconf.h and not provided by miniz.
  * Replace zlib.h with miniz.h and minizconf.h.
2018-08-10 10:24:25 +02:00
Yamagi Burmeister
9d4df05c22 Add stb_vorbis.h to LICENSE file. 2018-08-10 10:22:28 +02:00
Yamagi Burmeister
b802c4bc2e Some cleanup now that ogg is the only music backend.
* Rename all cd* functions to ogg*.
* Rename the cd_shuffle cvar to ogg_shuffle.
* Remove some unnessecary #ifdef.
2018-08-08 15:17:21 +02:00
Yamagi Burmeister
79e8c1377b Replace libvorbisfile with stb_vorbis single header lib.
This is (or at least should) work exactly the same a before but
saves us the dependencies to libogg, libvorbis and libvorbisfile.
2018-08-08 15:05:23 +02:00
Yamagi Burmeister
b97757e99f Some small make fixes. 2018-08-07 11:50:16 +02:00
Yamagi Burmeister
10bdaaec06 Move stb_image_write.h into vid. It's used there, only. 2018-08-07 11:45:26 +02:00
Yamagi Burmeister
af703e8cd9 Remove the old SDL 1.2 version of the icon. 2018-08-07 10:35:18 +02:00
Yamagi Burmeister
1fcd0324e0 Move the icon into the vid interface.
It's only used there.
2018-08-07 10:30:11 +02:00
Yamagi Burmeister
d328aa9a9e Move rev.h into the client. 2018-08-07 10:20:02 +02:00
Yamagi Burmeister
5bff7e1568 Move refresh.c into the client and rename to glimp_sdl.c.
The GL backends have been an integral part of the vid interface for
years.
2018-08-07 10:08:20 +02:00
Yamagi Burmeister
b805b4e044 Move vid.c and dependencies into the client.
The vid interface has been exclusive to the client for years, trace
that in the file hierarchy.
2018-08-07 10:00:21 +02:00
Yamagi Burmeister
61400d1ae8 Move input.c and input.h into the client and rename to sdl.c.
The input system backend was once used in the client and the renderers,
but for some years now it has been an integral part of the client only.
Move it there.
2018-08-07 09:43:34 +02:00
Yamagi Burmeister
956902538f Move sound.c into the sound system source and rename to sdl.c.
The OpenAL backend was already part of the sound system source. And
there's no need for the SDL backend to be part of the generic backends.
2018-08-07 09:31:08 +02:00
Yamagi Burmeister
5501c38736 Move qal.c and qal.h to the other sound system sources.
The OpenAL backends used only by the sound system, there no need to
have them in the generic part of the sources.
2018-08-07 09:23:07 +02:00
Yamagi Burmeister
98d315ff20 Tell cmake that we prefer GLVND.
Yamagi Quake II runs fine with GLVND, most modern distros are using it,
so tell cmake about it and prevent some warnings.
2018-08-07 09:04:46 +02:00
Yamagi Burmeister
63350c418e Clearify some FIXMEs and bump the renderer API.
The last commits did some bigger changes to the interaction between the
GL renderers and the client. The code is now SDL 2.0 conformant, window
and context creation are strictly distinct operations. SDL is only
initialized when necessary. Since this broke the client <-> renderer
API, bump it's version.

There a lot of things left to do for dark and cold winter evenings:

* The software renderer implements it's own window handling and
  reinitialized SDL whenever vid_restart is called. This is highly
  problematic.
* vid_fullscreen is abused to communicate changes to renderer config
  throughout the code. That's a very ugly, messy and potential very
  problematic hack. But not easy to remove.
* Some funtion calls between the client and the renderer are
  unnecessary.

The changes to the client <-> renderer interaction fixed issue #302.
2018-07-31 18:57:13 +02:00
Yamagi Burmeister
6855f97487 Reset SDLs GL state before reinitializing the renderer.
In the old world we deinitialized and reinitialized SDL each time we
restarted or changed the renderer. That would clear the whole GL state.
In the new world we let SDL running and just recreate the windows. In
some cases parts of the old renderers state would leak into the new
renderer, leading to strange problems.
2018-07-31 14:32:13 +02:00
Yamagi Burmeister
bef21c101e General cleanup of vid.c
* Reformat code and reorder functions.
* Remove unnecessary stuff.
* Move everything possible into headers.
* Implement a clean fallback logic, gl3 -> gl1 -> soft.
2018-07-31 14:32:13 +02:00
Yamagi Burmeister
9a53a681bb Apply the same cleanup to gl1_sdl.c as to gl3_sdl.c
* Sync both files as much as possible.
* Another round of general cleanup.
* Fix stencil tests.
* Simplify gamma handling, hardware gamma is now default.
* Support new client <-> renderer API.
2018-07-31 14:32:13 +02:00
Yamagi Burmeister
b8a062e36b Cleanup and refactor gl3_sdl.c.
* Another round of general cleanup.
* Introduce gl3_libgl cvar to force a libGL.
* Fix stencil buffer tests.
* Further untangle window <-> context stuff.

The window is now fully at client side, the context at renderer side.
This is another break of the renderer API. And at least GL1 needs to
track this, it's broken for now.
2018-07-31 14:32:13 +02:00
Yamagi Burmeister
5db73a795b General cleanup of refresh.c.
* Even more syntax and code style fixes.
* Rename functions to match their actual purpose.
* Fix comments.
* SDL initialization and shutdown is now client side only. With
  SDL 1.2 finally gone there's no need to involve the renderers
  in it.

This breaks the client <-> renderer API. I haven't bumped the API
version with this commit because there're likely more changes when
I'm going through the renderer side of things. The VID backend also
needs a lot of love...

It might be a good idea to move this SDL backend files into the client
and rename them. We'll decide that at a later time.
2018-07-31 14:32:13 +02:00
Yamagi Burmeister
333d19766f Remove SDL 1.2 support from the build systems. 2018-07-31 14:32:13 +02:00