The last segment of the path is shortened to avoid going too close
and risk bumping into the object that it was meant to approach.
The same position could also be found by finding the roots of a second
order polynomial analytically but this solution is simple and sufficient.
This is a bit redundant because the current usage of goto
does not trigger it. It can be triggered by:
* increasing goalRadius
* decreasing NUMQUEUEBUCKETS
* decreasing BM_DIM_STEP
* increasing edge costs
* Remove hardcoded default font name.
This means the `fonts/fonts.ini` file is now mandatory
and must contain definition of all 9 font types.
Old mods relying on an incomplete `fonts.ini` file might break.
A separate PR creating the required `fonts/fonts.ini` file
should be merged before this pull request.
* Simplify `CFontLoader`.
* Return `std::optional` instead of returning a default.
* Remove the now unnecessary `std::map`s.
* Remove the now unnecessary `GetFontType` method.
* Improve Gfx::FontType.
* Provide `ToString` function for the enum, which is now
used for logs and by `CFontLoader`.
* Provide `ToBoldFontType` and `ToItalicFontType` functions.
* Replace hex literals with binary literals for readability.
* Move font caching related code to a new private class `FontsCache`.
* Add neccessary changes because of changes made in `CFontLoader`.
* Add minor code improvements like renames and formatting.
* Split the code into smaller functions for readability.
* Simplify the `CText` class.
* Apply the rule of 5 to the `CachedFont` structure.
Split the test into several parametrised tests for each data type.
Add more tests with different values.
Fix the ReadBinary() function in order to fix the ReadDouble() function
for negative values (the sign bit was being lost).
We currently use CMake 3.16 for compatibility with Ubuntu 18.04 LTS.
The `NAME_MISMATCHED` argument which turns off a CMake warning
when using `FIND_PACKAGE_HANDLE_STANDARD_ARGS`, is not available
in CMake 3.16 and can prevent a successful build.
See
https://github.com/colobot/colobot/pull/1478#issuecomment-986204233