Commit graph

319 commits

Author SHA1 Message Date
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
Yamagi Burmeister
565f7f6e67 Let the Makefile generate a game.dynlib on OS X
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.
2015-08-12 18:55:35 +02:00
Daniel Gibson
41ea8879e7 Fix bug with high velocities in vents in 32bit builds, fix #71
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.
2015-05-17 18:52:18 +02:00
Daniel Gibson
544a464eea Implement gamedata loading from binary path
even if $PWD is not the same path as the executable is in, the game
will look for game data in directories next to the executable.
2015-04-11 20:11:42 +02:00
jarvik7
5eeef2edcc Autodetect architecture in makefile
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
2015-03-29 12:19:16 +09:00
jarvik7
e85b6999a7 Re-add OS X support
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
2015-03-21 16:39:55 +09:00
Yamagi Burmeister
177b424ba1 Remove Mac OS X support
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.
2015-03-20 17:33:46 +01:00
Daniel Gibson
47cde06e27 Use stb_image for retexturing support, also support png, no more libjpeg
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()
2015-03-20 17:33:37 +01:00
Yamagi Burmeister
ffd7f5991e Some small formatting changes 2014-02-26 20:41:03 +01:00
Alejandro Ricoveri
192f4c986d Optional configuration file
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
2014-02-19 20:46:16 -04:30
Yamagi Burmeister
66f6ce154b Remove one last call to mkdir.exe 2014-02-08 10:08:20 +01:00
Yamagi Burmeister
47fa53c292 Refactor the Windows build system
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.
2014-01-27 17:32:12 +01:00
Yamagi Burmeister
ab220c10d6 Wrap too long line 2014-01-01 10:35:53 +01:00
Yamagi Burmeister
ca5b0183e2 Set an rpath entry to WITH_SYSTEMDIR/lib
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.
2014-01-01 10:32:27 +01:00
Yamagi Burmeister
909729b2fd Rename CDA_ENABLED to CDA_DISABLED. Some minor wording fixes while here. 2013-12-31 10:02:58 +01:00
Yamagi Burmeister
1e2e1021af Make ARCH overrideable on Windows 2013-12-31 09:57:07 +01:00
Yamagi Burmeister
dca3db9426 Add $ORIGIN/lib the RPATH on FreeBSD and Linux
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.
2013-11-09 13:47:04 +01:00
Yamagi Burmeister
78cfbb5197 Mention SDL 2.0 in the Makefile header 2013-10-12 12:32:32 +02:00
Yamagi Burmeister
5b10bdc2b2 Enable SDL2 by default 2013-10-12 11:55:04 +02:00
Yamagi Burmeister
ad27563ef6 Correct SDL2 statement for Windows
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.
2013-10-12 11:52:49 +02:00
Daniel Gibson
d1ca122955 Add -DSDL2 for Win32/OSX support (untested), print SDL2 usage on startup
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)
2013-09-01 14:19:33 +02:00
Daniel Gibson
9af707c7a0 use xrandr for x11gamma (still hacky) 2013-08-27 21:54:48 +02:00
Yamagi Burmeister
191513945f Fix printing of the "CDA is disabled" warning 2013-08-27 21:04:55 +02:00
Daniel Gibson
997be0dcd1 Fixes for 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
2013-08-26 23:55:34 +02:00
Daniel Gibson
51b7607548 SDL2 support (mostly)
Makefile is adjusted, it compiles and works mostly, but
* For some reason (bug in SDL_GetRelativeMouseState() ?)
  mouse input doesn't work properly.. it seems to be bound
  to window borders, even if input is grabbed
* some keys can't be used anymore because there's no SDLK_*
  for them anymore (gotta find out if this is important)
* Maybe some of the changes need cleanup
2013-08-26 00:55:31 +02:00
Yamagi Burmeister
ecc4302f94 Alter Makefile and header pathes following the refresh move
With this change the "refresh" make target doesn't any longer exists.
It was merged into the "client" target. One will need a "make clean"
before building yQ2 after this change.
2013-06-15 10:37:11 +02:00
Yamagi Burmeister
9af9f54f36 Remove QGL pointers
This is a manual merge of Hecatomb Q2 ref b8952d5. Manual since git
couldn't do an automerge for some reasons... Notable changes are:
- QGL function pointers are removed, libGL is linked directly
- The OpenGL log framework is removed. It was disfunctional
- The gl_driver cvar is finaly gone
This change is currently untested on Windows and OS. There should
be no problems but a better Makefile integration of libGL is needed.
2013-06-15 10:37:11 +02:00
Alejandro Ricoveri
d2304ebcab Makefile fix for Windows
Refresher sources were not included for the Windows client build
2013-06-15 10:37:11 +02:00
Alejandro Ricoveri
99dffc3efe Makefile refactoring
WITH_RETEXTURING for OSX and Win32 (should work)
2013-06-15 10:27:30 +02:00
Alejandro Ricoveri
a7f02a5b0e The refresher is linked statically into the client, no more 'ref_gl.so'. 2013-06-15 10:27:30 +02:00
Yamagi Burmeister
3ac88e1bda Rename snd_wav.c to wave.c to get in line with other files 2013-04-21 11:32:20 +02:00
Yamagi Burmeister
84020e4d8e Rename snd_vorbis.c to ogg.c. This name is more appropriate 2013-04-21 11:30:07 +02:00
Yamagi Burmeister
78ce1e491c Rename snd_al.c to openal.c 2013-04-21 11:19:01 +02:00
Yamagi Burmeister
e5505f90d7 Rename snd_dma.c to sound.c. yq2 never used DMA. 2013-04-20 15:09:57 +02:00
Yamagi Burmeister
cbecc5b2dc Retire snd_mem.c and integrate it into snd_dma.c and the backends 2013-04-20 09:19:59 +02:00
Yamagi Burmeister
3989ff73b2 Retire snd_mix.c and incorporate it into the SDL backend 2013-04-20 09:03:47 +02:00
Yamagi Burmeister
3e294e5288 Pass -rdynamic to the linker on Linux
This fixes the backtrace output in the signal handler.
2013-04-19 18:53:12 +02:00
Joshua Scoggins
24d8f2c0ff Added ia64 to the Makefile under the arch check 2012-11-30 20:22:38 -08:00
Yamagi Burmeister
2246ba80a3 Switch App bundle build on by default and remove unneccesary statement 2012-11-18 10:50:55 +01:00
svdijk
823753dec9 Some minor restructuring and cleanup. 2012-11-07 21:15:18 +01:00
svdijk
63e7855ab7 Makefile whitespace fixes. 2012-11-05 21:33:39 +01:00
Yamagi Burmeister
ba10009aa5 Add support for Mac OS X
These are the code changes and Makefile changes necessary to build and
run Yamagi Quake II on Max OS X. OS X 10.6 or higher is required, older
version may work but we cannot guarantee it. The documentation will be
added in another commit. This patch was contributed by W. Beser, I made
only some small cosmetical changes.
2012-09-14 11:21:02 +02:00
Yamagi Burmeister
67fb773a78 Mention OpenBSD in the Makefile, clarify why we reject 64 bit builds on Windows 2012-08-22 17:58:00 +02:00
Jonathan Gray
1f9d6084b6 OpenBSD port 2012-08-18 09:53:03 +02:00
Yamagi Burmeister
8d0dfd2c30 Merge vid.c into 1 generic file 2012-08-01 16:54:09 +02:00
Yamagi Burmeister
f89bb3265e Combine qgl.c glwindow.h into one generic file 2012-08-01 15:51:39 +02:00
Yamagi Burmeister
e5f70fcf40 Merge qal.c into one generic file for all platforms
To archive this, 3 new functions Sys_GetProcAddress(), Sys_LoadLibrary()
and Sys_FreeLibrary() were added to abstract the library loading code
into a platform independend API.
2012-08-01 14:54:18 +02:00
Yamagi Burmeister
399c581f06 Move src/windows to src/backends/windows 2012-08-01 14:12:05 +02:00
Yamagi Burmeister
3fb8492398 Move src/unix to src/backends/unix 2012-08-01 13:58:10 +02:00
Yamagi Burmeister
c5bf1e8c93 Move src/sdl to src/backends/sdl 2012-08-01 13:47:32 +02:00
Yamagi Burmeister
b1ddebf552 Update "unzip" to version 1.01h
This update brings some minor bugfixes, especially for big endian
platforms and LLP64 systems like 64 bit Windows. The support for
encrypted ZIP archives was removed. This is a no-op change, since
there was no way to pass the password to uncrypt. Without the
uncrypt code Yamagi Quake II can be distributed in some countries
with special laws for cryptographic software. The LICENSE was
updated to the most recent version of the INFO-ZIP license.
2012-07-21 12:02:39 +02:00
Yamagi Burmeister
7ac71db523 Merge branch 'cleanup'
Conflicts:
	src/common/header/common.h
	src/common/header/shared.h
	src/common/misc.c
	src/unix/main.c
	src/unix/system.c
2012-07-09 14:35:37 +02:00
Yamagi Burmeister
c80954a65e Remove support for qhost
qhost was a proprietery management application for Quake II dedicated
servers. Since we don't know if the code is still working and most
likely no one uses it anymore, remove it. This war requested by Daniel.
2012-06-22 09:06:27 +02:00
Yamagi Burmeister
060235e7dd Merge branch 'windows' into cleanup
Conflicts:
	src/common/filesystem.c
	src/sdl/input.c
	src/sdl/refresh.c
	src/unix/system.c
2012-06-11 11:21:16 +02:00
Yamagi Burmeister
1f6d0282ee Add an application icon for Windows
The Windows icon is embedded into the executable. It's the same as under
Unix platforms, just converted into .ico.
2012-06-11 11:13:10 +02:00
Yamagi Burmeister
ac6748e7d2 Merge the collision model back into one file 2012-06-07 15:04:45 +02:00
Yamagi Burmeister
d12f0c642f Recombine the message handling back into one file 2012-06-07 14:33:09 +02:00
Yamagi Burmeister
e0faf784a6 Move stuff from common/common/ to common/ 2012-06-07 13:54:08 +02:00
Yamagi Burmeister
56aff1dc89 Recombine the command parser in one file
Spliting it into several files seemed logical but in retrospect it was
a bad idea, unnecessary complicating the code.
2012-06-07 13:35:33 +02:00
Yamagi Burmeister
3de98e3b7b Add a comment for WITH_SYSTEMWIDE under Windows 2012-06-05 11:12:23 +02:00
Yamagi Burmeister
e5bc9d08ec No console window for the client 2012-06-05 11:02:48 +02:00
Yamagi Burmeister
bf590cbba5 Clean up the Makefile 2012-06-05 10:37:34 +02:00
Yamagi Burmeister
67a147014a Reenable retexturing 2012-06-05 10:06:13 +02:00
Yamagi Burmeister
d1008a564d Port OpenAL to Windows and enable it by default 2012-06-05 09:57:30 +02:00
Yamagi Burmeister
7b01ac3452 Fix build under !Windows 2012-06-04 14:07:32 +02:00
Yamagi Burmeister
7c41b66821 Merge branch 'windows' of github.com:yquake2/yquake2 into windows
Conflicts:
	Makefile
	TODO
	src/windows/header/winquake.h
	src/windows/system.c
2012-06-04 14:04:11 +02:00
Yamagi Burmeister
a8b9183664 Build all targets on Windows 2012-06-04 12:47:28 +02:00
Yamagi Burmeister
51869fbc9d Add qgl.c for Windows
This file was taken from ioQuake2 and altered for inclusion in Yamagi
Quake II.
2012-06-04 12:42:55 +02:00
Yamagi Burmeister
6f9b75f89f More changes to the Makefile for the refresher 2012-06-04 12:02:05 +02:00
Yamagi Burmeister
e652f32a64 Makefile support for the refresher under Windows 2012-06-04 11:49:11 +02:00
Yamagi Burmeister
2672495c3f Build the client by default under Windows 2012-06-04 11:15:53 +02:00
Yamagi Burmeister
86f89fce22 Implement vid.c for Windows
This file was taken from ioQuake2 and modified to work with Yamagi Quake
II. It may not be perfect yet, but should be good enough to the client
up and running.
2012-06-04 11:09:43 +02:00
Yamagi Burmeister
a4609fc42b Use correct include pathes to SDL under Windows 2012-06-04 10:02:01 +02:00
Yamagi Burmeister
93f518e7b5 Initial Makefile suppport for the client under Windows 2012-06-04 09:51:17 +02:00
Yamagi Burmeister
65a7ac596d Port the game.so to Windows
The game.so hasn't any platform depended code, therefore this
rudimentary port can be done with Makefile magic. There are
some TODOs left, they'll be resolved later on.
2012-06-04 09:32:35 +02:00
Yamagi Burmeister
1a3b54b27e Move glob.c and glob.h to common
We need glob_match() for Windows
2012-06-04 09:13:30 +02:00