Epoxy automatically fetches the extension functions on demand, including
the GLX context creation functions. This means that you can't test the
function pointers for NULL anymore, because they're always set to a
resolver function until the first call. Instead, you have to check for the
availability of an extension by the extension's name. Thanks to Isilkor for
catching these.
On windows, epoxy invalidates all extension function pointers when the
GL context changes. This means we need to have an active context at all
times we call an extension function (like wglGetPixelFormatAttribivARB)
or else the code will jump to an invalid pointer. On the other hand, we do
not need to make it reinitialize the pointers ourselves.
Epoxy automatically uses an alias for a function if the requested name is
not available, like glDebugMessageCallbackARB instead of
glDebugMessageCallback. It also does not have the problem with varying
parameter types for that function. So switch to it while removing
GLDEBUGPROCARB_USERPARAM_IS_CONST.
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
The only use of C4RTF in its final moments was parsing out plain text
from RTF files anyway, so why even go to all the trouble instead of just
storing plain text in the beginning?
Instead of conditionally adding src/C4Include.cpp, simply add it always. It
doesn't do anything with other compilers, but the tiny speedup from not
compiling it isn't worth the additional complexity.
This was used to name snapshot releases of the Network2 branch, and has
seen almost no use since.
C4ENGINEINFO(LONG) was a duplicate of C4ENGINENAME and C4ENGINECAPTION.
This employs a rather ugly hack to make CMake do what we want. CMake
doesn't allow us to add items directly to the solution (as opposed to
one of the projects inside it), and thus requires us to abuse its lack
of parameter validation to manually add the file.
This only didn't break earlier because this code was located before
find_package(GLEW). The add_definitions(${GLEW_DEFINITIONS}) call that
actually adds the macro is a bit broad, but the macro doesn't harm the
targets that do not use GLEW.
Since there's already a getopt library in thirdparty/, there's no need to
guess about ways to make it work with a system header without support in
the C library itself.
Keep the check for C++0x/C++11 for now. Remove that flag instead of not
adding it, because it most likely still is in the CMAKE_CXX_FLAGS, which
are cached.
Video recording and playback only worked on Windows, and recording only
handled video, not game audio. As such, it was of fairly limited use,
and there's lots of software available these days that handle both.
Moving the flags from CMAKE_CXX_FLAGS to OC_CXX_FLAGS, adding flags and
removing duplicates keeps CMAKS_CXX_FLAGS from growing. Unfortunately,
-std=gnu++0x needs to be in CMAKE_CXX_FLAGS before compiler features get
tested, but CMAKE_CXX_FLAGS is filled from OC_CXX_FLAGS further down.
Fortunately, all tests for compiler flags are quite simple, so they can be
done at the beginning, and the feature tests after that. Reorder the code
accordingly.
In order to be able to remove duplicates from the list, each flags needs to
be a separate list item. Otherwise, the flags from the previous run in
CMAKE_CXX_FLAGS, which are now separate list items due to
separate_arguments(), will not be recognized as duplicates of the freshly
added flags. Fortunately, in the next round the two sets of flags in
CMAKE_CXX_FLAGS will be reduced to one set, so there were never more than
two copies of the warning flags.
Hardly anyone ever tests the headless build, because it requires you to
run CMake a second time with -DUSE_CONSOLE=On. So now it's an included
project which you'll get whether you want it or not.
I'm well aware that this could be solved more nicely, and that we could
be splitting unchanged files out into a separate support library, but
that's left for a later date.
Another piece of code that hasn't been tested in ages, gone. The default
puncher address was still pointing to clonk.de, which I'm very certain
isn't providing UDP hole punching services anymore.
Instead of a bespoke hole punching implementation we should use a STUN
lib.
libmisc is the support library that references thread code and timing.
So the dependencies on pthread and rt should be attached to libmisc
instead of every single binary.
libc4script uses C4Group, so it has a dependency on libmisc. Make this
dependency explicit so all targets that use libc4script also
automatically pull in libmisc.