still no 3D rendering, but in theory it should be able to load models,
bsps etc, just not render them yet.
also moved/copied md2.c and sp2.c to gl/ and gl3/ because they use
renderer-specific types
the arguments were not used anyway, and returning true/false is clearer
than returning -1 (for error) or sth else (which has no deeper meaning
anyway).
Also:
* PrepareForWindow() can now return -1 if there's an error
* suppress some warnings in Makefile
* fix error for building ref_gl.dylib on OSX
the problem is that sdl2-config --libs apparently includes shit that's only
useful for the executable, but not dlls, like linking against SDL2main and
libmingw32 and setting -mwindows
Furthermore I forgot to add -lopengl32 and -shared to the ref_gl Windows
LDFLAGS.
If someone really want's overwrite OSTYPE on Windows it's much easier to
just alter one line in the Makefile than supporting setting it through
the command line.
The old implementation had two problems:
* OSTYPE and ARCH are systemwide defines, overriding them may break
the global libc headers. This is a theoretical problem, I've never
seen it in praxis.
* Not all system set ARCH correctly when building in a chroot env.
For example on Linux ARCH is set to x86_64 when building in an
i386 chroot. Now the user can do something like "make YQ2ARCH=i386"
to get things right.
In Linux distributions, having the executable depend on the right
libraries and arrange for them to be installed is straightforward,
and there's a lot of infrastructure for tracking which library
version a particular executable needs, including making sure we have
a version that contains all of the symbols that were used. Loading
libopenal at runtime defeats that infrastructure.
The ability to substitute a different-but-compatible libopenal,
or operate with reduced functionality without libopenal, might
still be desirable for generic/portable binary releases.
The CMake build system already linked the executable to
${OPENAL_LIBRARY} anyway, so it is already a hard dependency in that
build system.
For deterministic/reproducible builds (where the same source and
toolchain can be verified to produce the same binary, allowing
maliciously substituted binaries to be detected) it is desirable to
take the software's idea of the build date from the build system;
otherwise, the real-time clock at the time of building affects the
result, making it non-reproducible.
SOURCE_DATE_EPOCH is a distribution-neutral specification for how
to do that. It is meant to be set by meta-build systems such as
dpkg or RPM, using a date/time that is already part of the source code,
for example the date of the latest git commit, the date in
the package's debian/changelog, or the date in the RPM spec file.
See https://reproducible-builds.org/specs/source-date-epoch/ for the
specification of SOURCE_DATE_EPOCH, or https://reproducible-builds.org/
for more information on reproducible builds in general.
The old whitelist was a leftover from the early days of YQ2. It should
run on most / all architectures, as long SDL supports them. As suggested
by smcv in issue #138 generate the OSTYPE and ARCH defines by the build
system instead of hardcoding it.
Savegame compatibility is provided by bumping the savegame version. Old
savegames are compared against the old OSTYPE and ARCH defined, new ones
against the new defines. This compatibility code should be removed
somewhere in the distant future.
This should have been done years ago, .dynlib is the canocial extension
for libraries on OS X. In a broader sense this simplifies the CMake
build system a little bit, since CMake enforces .dynlib for OS X
libraries.
See https://github.com/yquake2/yquake2/issues/71
and https://github.com/yquake2/xatrix/issues/4
In ClientThink(), the float value ent->velocity[i]*8 is saved into
a short and if the value is too big for a short, in 32bit gcc builds
the short is set to SHRT_MIN, resulting in the player being pressed
down instead of up.
Now we put the result in a 32bit int first (which should be big enough)
and assign the int to the short. This still overflows, but with -fwrapv
at least in a defined way (most probably the same way the original
binaries did).
And while I was at it, when the game lib is loaded, it prints the date
it was built, this is especially interesting for our Win32 binaries.
Can now build a 32bit version.
Note that all your dependencies will also need to support 32-bit.
Install SDL2, libel, libvorbis, openal-soft in Homebrew using
‘--universal’ flag
No changes to source were needed, just to makefile.
The build process is now also different.
Frameworks are no longer needed, but you will need to get some packages
from Homebrew to compile.
Install homebrew, then get the following packages before compiling.
openal-soft
libogg
libvorbis
sdl2
No, this is not a rage quit but the result of a long discussion. There
are several reasons for us to drop OS X support:
- OS X support was always more or less hacky. For example is was never
really integrated into the build system and some features like the
OpenAL sound backend never worked well.
- The OS X support never grew into the new world based upon SDL2.
- It was broken since at least Lion which was released 4 years ago.
- None of the developers has a Mac or plans to buy one. Supporting
a software for a platform not used by the developers is more or
less impossible.
- And despite several appeals no one from the OS X community ever
stept up and send patches.
Removed are:
- Makefile support
- The OpenAL quirks
- The Cocoa bindings
- The framworks
Not removed is:
- Savegame support
- Memory management support
- Platform detection
- OpenGL and SDL includes
So, if someone steps up and does a modern, fully integrated port based
upon SDL2 we're happy to merge it back. The requirements are:
- It must be a clean port, without any hacks
- Full build system integration must be provided
- The port must be maintained even after it was merged. At every release
binaries must be build, API / ABI changes with new OS X versions must
be tracked.
Retexturing support is now always on (you can still switch it off with
the gl_retexturing CVAR), as we don't have the additional libjpeg
dependency anymore.
stb_image is used for tga, jpg and the newly supported png, so the
old tga and jpeg loading code has been removed.
I furthermore cleaned up the somehow messy and possibly slightly broken
retexturing selection code in R_FindImage()
Ability to read an optional configuration file
which is read if exists, we can even decide
which configuration file (default is config.mk) to use at
the command line like this:
$ make # it will read config.mk if exists
$ make CONFIG_FILE=my-badass-conf.mk
$ make CONFIG_FILE=no-retexturing.mk
As always, build variables still can be set as well by command line.
$ make WITH_SYSTEMWIDE=/media/cdrom/quake2-data CONFIG_FILE=my-badass-conf.mk
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.
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.
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.
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.