The old Window build was tightly bound to Nuwens MinGW distro. Since
Nuwen decided to take the 64 bit way and dropped 32 bit support, we'll
change over to a more generic MinGW build. Use this chance to clean up
things.
PLEASE NOTE: There's no such thing as a "standard MinGW install".
Therefor our buildsystem cann not and will not be generic. It's still
desinged along the pathes of our build environment. We'll upload it
to the projects FTP server.
Things do consider:
- Dependencies (jpeg, libogg, libvorbis, OpenAL, SDL2, zlib) should be
installed under /custom/.
- We're now relying on sdl2-config, to be found at /custom/bin. It's
just a simple shell script, depending on your compiler unsupported
CFLAGS or LDFLAGS must be removed from it.
- Windows binaries are now stripped. There's no need to supply debug
symbols on Windows. This reduces quake.exe from ~8.3MB to ~1.6MB.
- The Binaries are still hard linked.
Without this define newer versions of jpeg define a type "bool" as char,
while the MinGW headers define it as "unsigned short". Automake should
have detected that, but...
The code used build fine on my workstation, since Mesa3D has the
required macros since ever. But on Windows gl.h is still limited
to OpenGL 1 (really?).
MSAA was a long wanted and often requested feature. Just set set the
desired number of samples with gl_msaa_samples and do a vid_restart.
This code is based upon work done in Hecatomb.
On some systems SDL_SetRelativeMouseMode() can fail under several
circumstances. For example:
- Security software is blocking acces to raw input.
- XInput 2 is unavailable.
- SDL2s configure script has messed up.
Detect those situations and reposition the mouse manually to the
window center after having read it's current state. This fixes
issue #34 an #35.
Input devices should send key events and nothing more. The ability to
add commands into the input buffer was used by the joystick code
(removed long time ago) and as a dirty hack to work around limitations
of DirectInput.
- Remove the keyq. This linked list was used to work around limitations
of the good, old DirectInput API. It's not necessary with SDL.
- Inline some functions to others where apropriate and remove unused
or unnecessary functions.
- Reorder functions into groups.
- Update comments.
This commits still misses necessary changes to the frontend. They'll be
done in subsequential commits.
This automagically sets an rpath to WITH_SYSTEMDIR/lib, when
WITH_SYSTEMWIDE is specified. If no WITH_SYSTEMDIR is given,
the default path /usr/share/games/quake2/lib is used. As for
the normal rpath, for now only FreeBSD and Linux are supported.
This was requested by caedes.
We had dual precision since ever on 64 bit unixoid systems and it "just
worked". So there should be no reason to still force Windows down to
single precision. The performance impact should be negligible.
This function is only used in cl_view.c, so no need for external
declaration. Reimplement it in a sane and on all platform 64 bit
clean way. This allows us to finally remove the horible INT macro.
Pressing two mouse buttons at the same time didn't work properly, only
one had effect, e.g. when pressing LMB to walk forward and RMB to shoot
(when bound like that...)
Not sure why that was, but the old mouse button handling (inherited from
the super-old win32 backend where it was supposed to work around bugs in
WinAPI or whatever, where sometimes there were two mouse button presses
in one event or something) was unnecessarily complicated anyway so I
replaced it with something simpler.
Make non global functions static, give some better names to variables,
remove unneccessary special cases and remove some superflous functions.
Form most - if not all - users this changes should be a no-op.
This should ease the overwriting of systemwide installed libs with
specialized versions. Also distributors may use this facility to supply
libraries next to the binaries. Maybe the same should be added for the
other platforms, but I'm not sure if and how they support RPATHes.
I neither have a Mac nor the time to maintain this platform. SDL 2.0
requires some more complex changes than the usual "two lines to track
Unix and Windows" so suspend OS X support until someone steps up.
SDL2 can and should be statically linked. This is much more easier than
linking it dynamically and more comfortable for the user. One libs less
to care about.
Without this change the width of the render windows was required to be a
multiple of 8, making it unable to use strange resolutions like 1366x768.
This change is based upon an idea submitted by "tmcp" in pull request
27.
The quake2 binary now gets -DSDL2 in the CFLAGS, so Win32/OSX can
use different #include paths accordingly.
This is also (ab)used to print which SDL version is used on startup.
Don't use this for anything else, use
#if SDL_VERSION_ATLEAST(2, 0, 0)
instead.
I haven't tested building on/for Win32 or OSX, there may be more
work to do.
Furthermore I added Copyright-Info about CalculateGammaRamp()
in refresh.c (it's from SDL2)
* Fix input issues (mouse-wheel and mouse input)
* SDL2 is not default anymore in the Makefile (use WITH_SDL2=yes)
* If SDL2 is enabled, CD audio is disabled (SDL2 doesn't support
that - use OGG/Vorbis instead)
* Small fix to make it compile with SDL1.2 again