Depending on the mood of the linker, the editor may have been
constructed before and destroyed after the system-wide string table
because they weren't defined in the same file. Destruction of the editor
tries to load some strings, which would then access the already
destroyed string table and thus crash.
C4Group::SearchNextEntry would waste lots of cycles looking up file
attributes that were never inspected afterwards. Since all we want is
the file size, and we already get that for free from FindFirstFile and
FindNextFile, store it with the directory iterator instead of querying
it at every iteration.
This reduces load times on my machine by almost half, tested across
several different scenarios.
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?
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
Using memset to initialize non-POD types doesn't work. Or rather, it may
work right now, but will fail when somebody adds a member that relies on
its constructor doing something (like for example any STL container).
Either way it's undefined behavior and needs to go. Furthermore, using
it to reinitialize an object also prevents any dtors from doing their
work when needed.
A new helper function InplaceReconstruct will take an object of nothrow-
default-constructible type, and call the dtor to properly clean up
before placement-new reconstructing the object in the same location.
This is still bad design, but unfortunately removing the Default/Clear
functions from every object currently using them is a herculean task.
* Renamed from material shapes to textures shapes
* No per-texture, so the same material can use different shapes with different textures
* Load a shape image instead of text file with vector components
* Allow texture sizes that are not multiple of the map zoom
* Add minimum overlap parameter to draw shapes only when the given overlap is reached.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
The new behaviour that allows 255 mat-tex combinations (once we increased
C4M_MaxTexCount...) is enabled with MapFg.bmp, and then MapBg.bmp can be
used to draw IFT or other fancy things.
The background landscape is a 8-bit landscape which stores the material
that a particular pixel will be replaced with when it is cleared, e.g.
by digging or blasting.
This is just the groundwork for this and does not offer much advantage
over the IFT flag that was used previously for that purpose. However,
additional features such as keeping the background material/texture
fixed when loam bridges are built, PXS are incorporated into the landscape
or the massmover is moving things around can be added.
See http://bugs.openclonk.org/view.php?id=1338 for more details.
Adds text to local TODO.txt file. Useful for taking notes quickly e.g. when testing new scenarios in a network game.
TODO filenames are configurable. Default file is TODO.txt in the scenario file (if it's unpacked) and TODO.txt on the current path if access to the first location failed.
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.