C4Group::View is only used in the c4group command line tool, so the
right place for that code is inside the tool. Added two public constant
accessors to return the header data and entries.
Graphics are now pre-loaded and may then be accessed in random order. Reduces Objects.ocd load time from 20 seconds to 1 second for me.
Some ordering is still broken (e.g. material.ocg and player files).
Animations are now part of the skeleton, and skeletons are loaded before meshes. They are stored in a map in StdMeshSkeletonLoader. This is only the first part of changes for #1180.
This fixes a valgrind warning when creating a savegame, since in that case
the file name is filled with uninitialized junk. It is not used at other
places, since it is an in-memory file, and therefore was probably harmless.
Now we give a useful name to in-memory files based on the address of the
StdBuf object, which might actually be useful when debugging.
C4Group::Open would sometimes overwrite more specific error messages or
not mention the problematic path. DirectoryIterator::Read also now mentions
more detail. Two superfluous messages were removed to make space.
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.
libc4script requires the system string table, but doesn't require the
full-fledged C4Language. Move the table to C4LangStringTable to reduce
dependencies.
To make C4ComponentHost more reusable, move C4Language dependencies out
of the class.
LoadEx isn't really suited to reside in C4Language, but it's better to
have it there, since all C4Language consumers also use C4ComponentHost;
the reverse isn't true.
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.
Fixes a bug with loading the shader file from scenario local Graphics.ocg on network clients. I think I also heard a few more sounds after the fix, so maybe they used random access into child groups too.
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.
src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
The FILEVERSION and PRODUCTVERSION components of VERSIONINFO blocks are 32 bit
integers, specified as four 8-bit integers. Apparently MinGW's windres chokes
on the definition if not all values are given.
The CRC was basically only used to decide which files to include in update
groups, but calculated for every group and then stored in the file on disc.
And for some unknown reason, updates themself didn't produce the right
numbers in the file.
This means that c4groups with this change cannot reproduce groups written
by older c4groups and vice versa, but this isn't necessary for updates, and
reading is compatible both ways.
Except for the ways that C4Update fails to remove the CRCs.
This speeds up loading of packed files significantly. It's not optimal,
though, because the order in which textures are loaded by the engine
is not known by c4group (it depends on their occurence in the Scene.material
file). This could be fixed by specifying custom packing orders for every
object we have. But then again maybe switching to a different format which
allows for random access might be more worth it.
This time, the relocation code checks for a "System.c4g" in either
the executable path or a "data" folder directly below. CMake makes
sure that this points somewhere sensible for normal builds.
TODO:
* Check whether this actually works under Unixes. Can "ln -sf"
delete important stuff? Is there a safe alternative?
* Further unify with the Mac Os solution. Other platforms might
auto-pack for release builds too, for example - and it might
be a good idea to have a proper data subdirectory in Mac bundles
as well.
The various small utilities do not use the engine Log implementation but
one that simply prints to stdout. Instead of duplicating that one, link a
common one into the utilities.
Although the code already uses boost, boost/uuid hides the sha1
implementation in a deeply nested namespace, which is just too bizarre to
use. Also the name of that namespace suggests that it is just an
implementation detail that could go away without notice.
The BOOL->bool patch (ea7876ddd97d) changed the size of C4GroupEntryCore, thus
C4Groups could no longer be loaded correctly. This broke PlayerJoin for packed
player files.
The same patch seems to also cause other problems - normal Clonk movement
in the landscape is currently broken as well.
Because much more depends on C4Rect than only C4Shape, and C4Shape uses
lots of other stuff.
Also move some other files which depend on C4Group to src/c4group, because
I'm editing the build files anyway.
Before "Initialize some uninitialized variables", SCopy would do nothing
because the StdStrBug still contained the parameter, but with that patch,
it wrote the empty string into the result buffer.