For one, people are unlikely to still have these variables in their
cache, and for another, if building fails, the proper solution is to
start from a clean slate anyway.
We already require support for std::unique_ptr, which itself requires
support for rvalue references. As such, we know we can use rvalue
references, and thus don't have to keep carrying dead code around.
On Windows, we need to know whether the library we're linking against is
a static library or a shared library import stub. If it's a shared lib
(and only then), we need to #define GLEW_STATIC.
Other OSes handle library imports differently and don't care.
Instead of doing the transformation when drawing a mesh. This allows making
the OpenGL normal matrix more consistent, since it does not include the
Ogre-To-Clonk transformation, and so that the transformation does not need
to be inverted in the shader.
As a side effect, all Attach transformations were updated, since before
they were specified in the OGRE reference frame, not the Clonk reference
frame.
* fix the if-conditional
* don't use pkgconfig (there is no .pc file upstream)
Signed-off-by: Julius Michaelis <caesar@hg.openclonk.org>
(Added license to FindTinyXML.cmake)
Unlike std::make_shared, std::make_unique was unfortunately missing from
C++11. It's a useful utility though.
Technically, declaring a new name in the std namespace is undefined, but
the other way to make make_unique available to all callers regardless of
C++ version, putting it into a distinct utility namespace and importing
the declaration from std if available, makes for more ugly code.
Depending on how current your headers are, the userParam parameter to
GLDEBUGPROCARB may be const, or it may not. The ARB has added the const
qualifier at some point after publishing the specs. Hooray for breaking
API changes.
thirdparty needs to be pristine code so we can update those libraries
without having to figure out whether we need to apply some more patches.
This means we can't easily fix warnings in there; telling GCC that these
are system headers means it won't emit any.
For some reason, even the most recent (as of this writing) CMake 3.1.0
doesn't know about Boost 1.57.0, which was released two months before
CMake. Add it to the known version list.
CMake 3.1's if() by default now interprets quoted variable names as
strings. This is a good idea from a strictness perspective, so make it
do this even if we're in 2.8.9 compatibility mode.
Printing pointers from the crash handler has been broken starting
with an update to MinGW at some point in the past, when they stopped
using printf from MSVCRT, instead replacing it with a private
implementation. Fix this by checking for inttypes.h availability, and
using it (and its format macro) when possible.
Auto-detecting UPnP might fail when CMake was invoked multiple times.
This would result in a broken build because the compiler would not find
<natupnp.h>.
Partially reverts cf474e99aa.
Cmake starting to whine about usage of a deprecated feature is no excuse
for regressions. The cmake warning even explained how to do this!
CMake remembers the variable in subsequent runs, so setting it to true
if the copy from thirdparty/natupnp needs to be used will prevent that copy
from being used after a rerun of cmake.
The idea here is that we compose shaders out of "slices", which can
come from the engine ("built-in"), from files or possibly even from
models. This should allow us to more easily share the code between
different rendering shaders (e.g. for lights / normals).
TODO: Workarounds not yet implemented, so this might degrade less
gracefully.
This introduces a new texture, an ambient light map, that is generated
automatically at the beginning of the round by the sky portion of the
landscape. This basically makes everything that is close to sky visible
by default.
The shaders have been adapted so that they deploy direction-independent
lighting for the ambient component, and the current (diffuse) behaviour
for the diffuse component. This makes the shaders use an additional
texture unit that represents the ambient light. We can think about merging
this information into the light texture, but the coordinate systems are
different at the moment, so this could be performed at the stage of light
texture generation.
For meshes, the ambient material is not actually used, but instead a
diffuse light from the front is used. This makes many meshes look more
interesting, maybe also because the ambient material setting of most
meshes are not set correctly at the moment.
* intermediate fade triangles are now calculated in C4FoWLight
* rendering takes also place in C4FoWLight, using different C4FoWDrawStrategies
* solved an old TODO from Peter (int -> int32_t)
* refactor and simplify portions of the light vertex calculation code
Add a new cmake option WITH_SYSTEM_TINYXML=ON that allows to use the system
tinyxml library and header instead of the bundled copy. Adjust the include
path in the single source file referencing the header and add the thirdparty
path to the include search path if the use system option is unset or off.
* added some class and method documentation, removed some superfluous comments like
void C4FoW::Update(C4Rect r)
{
// Update all lights
...
* added ASK comments that need clarification before proper documentation
Remove the two dependencies to ::Game from C4MapScript, so that ::Game
does not need to be linked into mape, which would basically drag the
whole rest of the engine after itself.
There's no point in splitting the audio library selection into multiple
CPP macros, since there can always only be one anyway. Merge all of them
into a single macro AUDIO_TK (for "toolkit") and have CMake select one
for the user, instead of making him choose (and potentially failing).
Recent MinGW releases ship a pthread implementation for Windows. So while
CMake is technically correct in finding pthread, we don't want it to, and
instead use the standard Win32 threading.
The -std=gnu++0x-Flag was removed from the compiler flags before
testing the <regex> header, and so just re-confirmed that <regex>
didn't work in previous C++ standards.
f897e95071 broke this by reusing the macro with the path to the binary
as the binary name, which doesn't work if the path contains directories.
Also, 0dcfe72148 moved the binaries, but the LOCATION property still
pointed to the old location. Luckily, CMake also has a non-broken option to
pass target file paths to custom commands.
The distinction between the "aul" and "non-aul" parts of
the script engine are mostly historical accident, and the
current organization of the source code does not use
sub-subdirectories. I'd like to keep it that way.
This reverts commit 69ba06b8d0.
This makes CMake use the dynamic library instead of the static library on
my system. The latter doesn't link on today's Debian unstable due to a
missing libmad.a.
Recent versions of MinGW do no longer declare vasprintf in <stdio.h>,
but they ship a compatible function called __mingw_vasprintf. Use this
function if vasprintf isn't available.
CheckFunctionExists only checks for the function to be linkable, it does
not require any declaration in a header. CheckSymbolExists requires a
declaration and also linking to succeed.
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.
For the updated source files, the timeline has been split into three
parts:
1. Pre-RWD code (before 2001)
2. RWD code (2001 through 2009)
3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
Telling Windows that we support Windows 7 means it will stop catching
unhandled exceptions that occur in a callback from kernel mode, and
allow our own crash handler to catch then.
Direct3D hasn't worked for more than a year now, and there don't seem to
be any efforts to revive it. Remove it and concentrate on better OpenGL
support.
A large number of g++ versions ship a <regex> that declares all of the
required functions, but don't actually implement them, making using them
result in a linker error.
Fallback to Boost.Regex if the host C++11 <regex> implementation is
broken; the interface is the same anyway, only differing in the
containing namespace.
Unfortunately, Boost.Regex is not a header-only library, but this is not
a big deal because all major Linux distributions ship it, and Visual
Studio implements <regex> since 2010 (the oldest version we still
support).
ResTable (the main system string table) was a home-grown hashmap that
did not cope with collisions at all. Since we already have a proper
dictionary in C4LangStringTable, use that instead.
Since FindFreetype.cmake already extracts the version of freetype
from its header files, I have no idea why they're not automatically
using that info to look for the proper library name in lieu of
hardcoding a single version.
Previously, MSVC builds did only allow static linking of libogg,
libvorbis and libvorbisfile. If there was a reason to do so, I have no
idea what it was, because it isn't documented in either VCS or a
comment. So I'll allow both dynamic and static linking.