Commit Graph

294 Commits

Author SHA1 Message Date
Yamagi Burmeister 0e8b58952a Rename the gl/ directory to gl1/.
This is not strictly necessary but since we're calling it GL1 let's
stay consistent between the name and the directory structure.
2018-01-11 10:58:32 +01:00
Yamagi Burmeister d21fbeb932 Rename all GL1 files from r_* to gl1_*. 2018-01-11 10:49:08 +01:00
Yamagi Burmeister 17f289c761 There's no need for the softrenderer to be build conditionally.
We want to build the softrenderer each time and on all platforms.
Building it only at user request will lead to code rot.
2018-01-10 10:33:24 +01:00
Yamagi Burmeister 11ad28b711 Unify gl_mode and sw_mode in r_mode. 2018-01-09 14:03:45 +01:00
Yamagi Burmeister cc5e154511 Disable the softrenderer by default.
Before we can ship the softrenderer in the default install we'll need to
clean up the cvars. Currently the softrenderer is using the gl_* cvars
which is confusing.
2017-12-19 21:39:54 +01:00
Yamagi Burmeister 339c9da8a8 Enable the softrenderer by default. 2017-12-17 10:00:43 +01:00
Denis Pauk c43e944a3d Rebase soft render from https://icculus.org/quake2/
* deleted asm code
* added support 2k+ resolutions
* SDL2 support
2017-12-11 23:33:19 +02:00
Thomas Green daa0c2c1bf Add improvements to Makefile for OSX. 2017-10-22 17:54:55 +02:00
Yamagi Burmeister e5c39eeb7f Set -ffloat-store when building with gcc for i386.
This helps the old and crappy x87 FPU to produce correct values. And
finally implement compiler detection in the Makefile.
2017-09-21 18:40:12 +02:00
Yamagi Burmeister 6ab2b3227a Rename common/misc.c to common/frame.c.
Now that we moved the CRC stuff to crc.c only the frame handling is
left in this files.
2017-09-07 13:31:52 +02:00
Yamagi Burmeister 7ca4e2ea5d Revert "Pass -Wno-misleading-indentation to silence spurious warnings."
Clang 4.0 doesn't like this and I'm too lazy to implement per compiler
CFLAGS.
2017-08-01 18:39:42 +02:00
mulander 60bef10748 Don't use -Wl,--no-undefined on OpenBSD
Breaks the build since version 7.00
2017-07-20 17:47:56 +02:00
Yamagi Burmeister 6da4a31740 Pass -Wno-misleading-indentation to silence spurious warnings.
Recent GCC versions print a lot of missleading indentation" warnings
in third party code, making the build log more or less unreadable.
2017-06-30 14:12:57 +02:00
Simon McVittie 992f453016 Only use /usr/local/opt/openal-soft on Darwin
Commit 883781c selected these paths for all OSs, but when linking to
a system copy of OpenAL for Linux distribution binaries we want the
normal OpenAL in /usr.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-06-18 15:33:51 +01:00
Daniel Gibson 1da7ff5594 Fix Jennell Jaquays' name in credits and quit screen
the latter is done by identifying the baseq2 pics/quit.pcx in LoadPCX()
and changing some pixels
2017-06-12 18:32:56 +02:00
Yamagi Burmeister 4c8d504cf7 Enforce static linking of libgcc on Windows.
This is part of issue #205.
2017-06-10 10:01:05 +02:00
Yamagi Burmeister c5f10dd879 Switch to a new, MSYS2 based build environment for Windows.
Highlights are:
- Since MSYS2 is much more unixlike than our old build environment we
  can remove most Windows specific hacks from the Makefile.
- MSYS2 has an package manager, the build environment can be updated
  by "pacman -Syu" just like an ordenary Arch Linux installation.
- Parallel builds are now working.
- git is integrated into the build envirment.
- zlib is now linked as a dynamic lib.

After this commit the old bild environment will no longer work! The
latest version must be downloaded and extracted to C:\MSYS2. Get it
here: https://deponie.yamagi.org/quake2/windows/build/
2017-05-25 11:21:52 +02:00
Yamagi Burmeister 38e60005cb Add back the GLAD_INCLUDE variable, lost in 4bd263c. 2017-04-10 19:22:23 +02:00
Yamagi Burmeister 4bd263c4d4 Some cleanup to the Makefile.
- Rename REFGL to REFGL1 for consistency with REFGL3.
- Fix some comments.
- There's no need to link flash.c and rand.c into both renderer libs.
2017-04-10 15:50:25 +02:00
Daniel Gibson 54b38176ef Fix Windows build (missing OSTYPE => YQ2_OSTYPE in Makefile) 2017-04-04 17:34:19 +02:00
Daniel Gibson 182948fecc Rename ref_gl.* to ref_gl1.* 2017-04-02 16:23:00 +02:00
Daniel Gibson fcae894c1e Makefile: OSTYPE => YQ2_OSYTPE, ARCH => YQ2_ARCH, -std=gnu99
Hopefully this fixes the build on SUSE Linux.
2017-04-02 15:58:35 +02:00
Daniel Gibson 0d81fd6080 Fix OSX build (with Makefile) 2017-02-19 06:03:08 +01:00
Daniel Gibson 0b35ceabdc GL3: added missing source files and stubs of most functions
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
2017-02-19 06:03:07 +01:00
Daniel Gibson 678410bfb4 Added super simple shaders, does render videos now 2017-02-19 06:03:07 +01:00
Daniel Gibson 56661fd43f GL3: Add remaining stubs, add HandMadeMath, update Copyrights 2017-02-19 06:03:07 +01:00
Daniel Gibson 64a456b867 Moved LoadWal() to r_image.c/gl3_image.c
It returns the renderer-specific image_t*; wal.c is now
renderer-agnostic and only contains GetWalInfo().
2017-02-19 06:03:07 +01:00
Daniel Gibson 9970dc43ad some further steps; ref_shared.h shared between ref libs
still nothing useful..
2017-02-19 06:03:07 +01:00
Daniel Gibson 324eaa8048 begin implementing ref_gl3
so far it can't even be loaded completely and has no code for
rendering yet
2017-02-19 06:03:07 +01:00
Daniel Gibson c901ad9bb6 Fix build on OSX 2017-02-19 06:03:07 +01:00
Daniel Gibson aaa73236ec refexport_t::Init() now returns bool and has no args; minor things
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
2017-02-19 06:03:07 +01:00
Daniel Gibson 4ede163794 Fix window build with Makefile
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.
2017-02-19 06:03:07 +01:00
Daniel Gibson 7f27c549a8 It works again, ref_gl doesn't use any client symbols anymore
So in theory this should even work on Windows now.
2017-02-19 06:03:07 +01:00
Daniel Gibson 2062b319e9 move qgl.[ch] to src/client/refresh/gl/ 2017-02-19 05:53:56 +01:00
Daniel Gibson f13e15e561 ref_gl.so builds and works (on Linux, with Makefile)
still dirty, seems to use some symbols from client directly, which will
not work on Windows.
2017-02-19 05:53:56 +01:00
Daniel Gibson 883781c6f0 Also fix OSX build with OpenAL when *not* using dlopen()
using dlopen() (DLOPEN_OPENAL) is default, though.
2016-12-18 00:00:47 +01:00
Daniel Gibson 10899195b4 Fix OSX build with OpenAL if it's dlopen()'ed 2016-12-17 23:51:17 +01:00
Yamagi Burmeister 20caca09e3 Force the normal Windows build to OSTYPE := Windows
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.
2016-12-03 09:17:21 +01:00
Yamagi Burmeister ae2b4744a1 MinGW defines a global OSTYPE. Just overwrite it. 2016-12-02 16:53:30 +01:00
Yamagi Burmeister e0b1f98f40 Make user overwriteable OSTYPE and ARCH somewhat more saner
In the Makefile we can use whatever variables we want. It's only
necessary that we don't leak them into the compiler context.
2016-10-31 10:22:17 +01:00
Yamagi Burmeister aa897e3965 Make OSTYPE and ARCH user defineable.
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.
2016-10-24 18:02:17 +02:00
Yamagi Burmeister 6d7d15af30 Fix Windows build. On Windows OpenAL32.dll must be opened at runtime. 2016-07-05 19:17:06 +02:00
Yamagi 5323873476 Merge pull request #143 from smcv/link-libopenal
Optionally link libopenal at compile time
2016-07-05 19:13:57 +02:00
Simon McVittie 5887a9e79e Optionally link libopenal at compile time
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.
2016-07-01 09:44:00 +01:00
Simon McVittie c00707d449 Override __DATE__ from SOURCE_DATE_EPOCH if set
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.
2016-07-01 09:41:23 +01:00
Yamagi Burmeister 5a384c79b1 Switch from an arch whitelist to an "all archs are supported" approach.
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.
2016-06-11 09:23:10 +02:00
Jarvik7 ca753d4f87 Fix broken OSX makefile
Makefile rewrite forgot to include OpenAL folders for Darwin
2016-03-17 11:26:39 +08:00
svdijk a7e0338c56 Makefile: The OSX library extension is "dylib", not "dynlib" 2015-11-06 18:52:45 +01:00
svdijk ec9657134f Windows: icon.rc is a source file, so move it to the source directory. 2015-11-04 21:05:30 +01:00
Yamagi Burmeister 9e4d26399e Switch Windows to dynamic binaries 2015-09-08 18:09:56 +02:00