Commit graph

2159 commits

Author SHA1 Message Date
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
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
Yamagi Burmeister
3d9674f3b8 Remove last remnants of SDL 1.2 support troughout the code. 2018-07-31 14:32:13 +02:00
Yamagi Burmeister
ba4706c608 Remove SDL 1.2 from the software renderer. 2018-07-31 14:31:17 +02:00
Yamagi Burmeister
b9c8a8533e Remove SDL 1.2 support from the menu. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
2099626b7b Remove SDL 1.2 support from the client side render backend. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
f03e95901f Remove SDL 1.2 support from the GL3 SDL backend.
Do some minor cleanup, while here.
2018-07-31 14:24:28 +02:00
Yamagi Burmeister
0e512a8f5d Some cleanup to the GL1 SDL backend now that's SDL 1.2 is gone. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
5ec3bcdb49 Let SDL calculate the gamma ramp now that X11GAMMA and SDL 1.2 are gone. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
1b68da9a0f Remove SDL 1.2 from the GL1 SDL backend. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
cc15f0c10c Remove SDL 1.2 support from the SDL sound backend.
While at it do some minor cleanup.
2018-07-31 14:24:28 +02:00
Yamagi Burmeister
3f65f7254b Some general cleanup to the input backup.
* Some globals could be made static.
* Add comments were appropriate.
* And format the file to one coding stile. What is so hard with
  keeping to one style?! MY IDE is even able to interfere the
  style from existing code...
2018-07-31 14:24:28 +02:00
Yamagi Burmeister
4fb271c2df Remove SDL 1.2 from the input backend.
SdL 1.2 had it's time and is becoming a burden. This is the first
in a series of commits that'll remove it from Quake II.
2018-07-31 14:24:28 +02:00
Yamagi Burmeister
15898a2330 Remove CDA support from code. 2018-07-31 14:24:28 +02:00
Yamagi Burmeister
759bc1be18 Remove X11GAMMA support from code.
This just deletes the X11GAMMA code. It doesn't make use of some
refactoring opportunities that're now possible. That will be done
at a later time.
2018-07-31 14:24:28 +02:00
Yamagi Burmeister
307d5eecf7 Remove CDA and X11GAMMA build system support.
* CDA was only supported of the client was build with SDL 1.2. Our
  Windows binaries had no CDA support for years, I'm pretty sure that
  it never worked on Linux and no computer build after 2005 has even
  the necessary hardware. So let's just remove it.
* X11GAMMA was a hack to work around SDL 1.2s inability to set the
  gamma on newer xorg-server versions. It has been broken for some
  time now an is rather ugly. Remove it.

This is the first step in removing SDL 1.2 support.
2018-07-31 14:24:28 +02:00
Yamagi
38a499c335
Merge pull request #313 from 0lvin/edges_limits
Scale edge/surfaces/verts on outof....
2018-07-30 18:46:54 +02:00
Denis Pauk
cf4887c4ba fix issue introduced in e5ef665e:Use more short code in *EdgeSearch 2018-07-30 15:47:00 +03:00
Yamagi
84bb61cea9
Merge pull request #310 from smcv/information
Fix spelling of "information", and re-word a comment with multiple typos
2018-07-30 12:31:42 +02:00
Denis Pauk
27cbd0d4e7 reorder copy vid_buffer to texture. 2018-07-29 15:29:00 +03:00
Denis Pauk
ea27c460f2 move trenslate palette based image to full color texture to separate function 2018-07-29 00:04:10 +03:00
Denis Pauk
a4b011c5fd palette check 2018-07-28 13:57:08 +03:00
Denis Pauk
bec4c4accc change code style 2018-07-25 21:33:10 +03:00
Denis Pauk
2b9b039139 make r_drawsurf local 2018-07-25 17:49:00 +03:00
Denis Pauk
aec8f3fc8b make r_dlightframecount and surfrowbytes local 2018-07-25 17:06:23 +03:00
Denis Pauk
fcae2fcbcd change messages 2018-07-25 15:16:32 +03:00
Denis Pauk
125d6db8b6 code clean up 2018-07-24 23:38:31 +03:00
Denis Pauk
e1a9e7e4e2 add auto reallocate 2018-07-24 17:49:14 +03:00