Commit graph

5309 commits

Author SHA1 Message Date
harunasan
b2e5728af9 USR: Reduce clutch usage when engine RPM is low. Helps with cars that have very long gear ratios or very little low RPM torque, such as the MPE-Arc (long single gear car) and SDR Kart 125 (little low-end torque).
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9628 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c1fa6009b1244eff13e5cfa42a51e02390733c1c
Former-commit-id: 78f6f046dfd2afbf401fe9bf299563948856c187
2024-11-29 16:03:04 +00:00
xavi92
841825181a Revert "Revert "main.cpp: Ignore errors from portability::rmdir_r""
According to the documentation, applications using SHFileOperation
should only check for zero or non-zero. Moreover, the return values for
SHFileOperation are marked as not reliable or stable. [1]

Because of this, it is not possible to achieve the same behaviour
between Win32 and POSIX for portability::rmdir_r.

[1]: https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shfileoperationa


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9627 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5dcfb5a9d09f1b2b1509d50f3a3d842d140161d6
Former-commit-id: a19aa1200ed65c285e9649d8050fb1a8ee0d227e
2024-11-29 06:47:28 +00:00
xavi92
a17b60e74c tools/CMakeLists.txt: Propagate CMAKE_BUILD_TYPE
Otherwise, libraries built by the xmlversion target (namely,
portability, tgf and txml) could be built under a different
CMAKE_BUILD_TYPE.

For example, if CMAKE_BUILD_TYPE were assigned to Debug from the
top-level project, these libraries would otherwise under Release and
therefore debugging symbols would not be available.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9626 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: be8c87017665a74a63e2bb22c45a4b23c0c6cd2b
Former-commit-id: b7ef6cacb5b137156815d12304209cbca95d4464
2024-11-24 13:27:49 +00:00
xavi92
fd7b0ff371 Revert "main.cpp: Ignore errors from portability::rmdir_r"
Windows and POSIX had different behaviours for portability::rmdir_r if
a directory did not exist. This commit therefore modifies the Windows
implementation so as to match the same behaviour as in POSIX, and
therefore recover the original implementation in main.cpp.

This reverts commit r9624.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9625 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c6db7c5141d4a712f7b4240664889caa83b58080
Former-commit-id: 7aac87e5335fce45d5b9b9b2c75e4429d62251b6
2024-11-24 07:24:34 +00:00
xavi92
ed6975a8ca main.cpp: Ignore errors from portability::rmdir_r
Whereas GNU/Linux returns 0 even if the directory does not exist,
on Windows it returns non-zero since SHFileOperation fails in such
circumstances.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9624 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 590a61e5e540a7684bd32fefc4624838ca38188b
Former-commit-id: 789bc137b1fc746afc0a1f136954e385c1b1a727
2024-11-23 22:45:56 +00:00
harunasan
e721a4ad66 SimuV5: Transfer over all developments on SimuV4.1 in order to unify all car physics changes to one module. This includes:
- Fixes for excessive tire wear when cars spawn with wheels below the ground by limiting
- Ability to tweak tire temperature gain depending on 2D axis direction ("lateral mu heat factor" or "longitudinal mu heat factor")
- Ability to tweak tire cool down rates ("tire cooling factor", "tire speed cooling factor")
- Ability to tweak tire's ability to maintain heat in wet conditions ("tread water drain speed" - defaults to 0 for dry tires, 1.5 and 3 for and inter/wet tires). Higher numbers mean tires can retain heat even when track is wet.
- Removed explicit penalties for tire grip and heating for using wet tires on dry track

In addition, "Stiffness" now changes in accordance to tire pressure. This is intended to simulate the tire becoming stiffer as tire temperature - and thus - pressure - increases.

Unfortunately this breaks the parameters for A LOT of cars in some way: cars without tire options will be undrivable in wet conditions by default, and tire compounds must be rebalanced for cars with them.

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9623 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 8ae6c918bbfeab69ce5f3203ffcfa5b5a12fca53
Former-commit-id: e1e21b74aece3205cee9010eb9a092c3392277f1
2024-11-23 20:13:34 +00:00
harunasan
f8043f2ed7 OSGGraph: Lower F3 chase camera target. This brings the car down to the lower half of the camera shot like in most racing games.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9622 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 149531626af29aad4401b7f0c3dbf04ad0f2729b
Former-commit-id: c8176e105913d63be166c3ca9d538543e5a13d4a
2024-11-23 19:56:55 +00:00
xavi92
cbbb2e2f76 tfg: Add GFPARM_RMODE_NOREREAD
Even if GFPARM_RMODE_REREAD was meant as an optional flag for
GfParmReadFile, it is always set by the implementation. This forced
the parameter file to be always opened for reading, which would fail if
the file did not exist. This is undesired when creating new parameter
files from scratch.

Since this behaviour is probably assumed by many parts of the code, a
new flag, namely GFPARM_RMODE_NOREREAD, has been added so as to disable
such behaviour while maintaining backwards compatibility.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9621 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 24339c76e7e53a70400f4e24086d5a5f2550a8d8
Former-commit-id: 5bf59aae2e4ddc4d17f95360d1e521d6d5580eda
2024-11-23 11:22:38 +00:00
xavi92
9e82348cfb cars.cpp: Use entry type to recognise directories
Since the actual motivation behind GfCars::GfCars is to scan for
directories, checking against "CMakeLists.txt" is fragile since other
files could be listed as well, leading to undesired behaviour.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9620 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ec0e1670abc7c26b065e0225ecb8f9124515343d
Former-commit-id: 3010a5ed07c6b2f7e24f0af83318062e146198e6
2024-11-23 11:21:49 +00:00
xavi92
ad796559ed tgf: Add entry type to tFList
This allows users to distinguish regular files from directories.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9619 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 3a520d361746130e9397ed8fd33a1540080f59ba
Former-commit-id: 92b39e1be91f67772f9420dafe5d7b3b1d488d26
2024-11-23 11:21:24 +00:00
xavi92
501fb0e5a3 asset.cpp: Simplify return value generation
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9618 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: b52a0787494de91fda3a98efb9293bb250907ffc
Former-commit-id: 0ce2644734cf95c7e2c01a71c0f24587af6fdabe
2024-11-23 11:21:03 +00:00
xavi92
736adc8bcb main.cpp: Remove tmp directory on init
The tmp directory is not meant to be reused accross executions, so it is
a good idea to discard any previous data previously stored there.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9616 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: aae630901a7a923783a3abd3a889c56cbcd04d68
Former-commit-id: 8aabf5c730012f09e80f2c279b2419a5fe8022bc
2024-11-23 11:19:37 +00:00
xavi92
c4d61a411f unzip.cpp: Always ensure parent directory
The previous implementation naively assumed that, prior to extracting
a file from a .zip, its parent directory would appear earlier on the
list and, therefore, the directory would be created beforehand.

This naive assumption made the extraction to fail when valid .zip files
listed files before their respective directories.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9615 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ac45a9481c9a301143d0139e46a6b39d2638bd20
Former-commit-id: 0e2a59d7909aa39f9eeb77c1794088a1bf07a45b
2024-11-23 11:19:02 +00:00
xavi92
8a9f85fd00 unzip.cpp: Add missing checks
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9614 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f7fa171396ce9d4fff5a5afc807340e0fa271d4a
Former-commit-id: 4d34b42f32cdd52eb6a391d24e4ca831f1feaab9
2024-11-23 11:18:37 +00:00
xavi92
48ed3d6d14 sink.h: Make flush() virtual
Otherwise, the writefile class would be unable to flush() its
std::ofstream, which might cause downloadsmenu.cpp to attempt to extract
an empty or partially written file.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9613 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c3f5435a045dbbfa74d55ef2c665a324bb72e5b5
Former-commit-id: 1edb27e20333ffd39c0378a390bffde5b74e7a49
2024-11-23 11:18:11 +00:00
xavi92
f996217509 customthirdparty.cmake: Optionally install libwinpthread
Some flavours of MinGW are built with the `posix` thread model, which
require to copy libwinpthread-1.dll to the `bin/` directory, as opposed
to those configured with the `win32` thread model.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9612 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d1c08685c33951fb150b94a0343e0d46d001ce4e
Former-commit-id: c146217ce9bef791e0cfb41a8ac2bea4e4a07346
2024-10-28 05:56:09 +00:00
xavi92
f38b49394a customthirdparty.cmake: Install freetype
For some unknown reason, this library was missing from the list, but is
required when rendering fonts from OpenSceneGraph.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9611 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 50b82dd90ada1f8a40c50c264f33a342e13e56ae
Former-commit-id: d167abf1e2cbfd4feedbf22b731d0a28947f8194
2024-10-27 08:11:50 +00:00
xavi92
b47e5f5bf3 cJSON: Use CMakePackageConfigHelpers
CMake discourages the use of configure_file() to generate files such as
cJSONConfig.cmake because it might expand variables such as
<project>_INCLUDE_DIR to absolute paths, which might cause issues on
Windows and macOS [1].

Instead, configure_package_config_file() is meant as a drop-in
replacement that generates cJSONConfig.cmake using relative paths. In
the context of this project, this should allow pre-compiled versions of
the `3rdParty` directory to be shared among developers.

[1]: https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9610 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: dc7f18be6bfa6f933909544176af600c48755173
Former-commit-id: 93228e7d1f46efa51dd919c3ce20e4b735c58726
2024-10-27 08:11:24 +00:00
xavi92
846ae9924e 3rdParty-devel: Import upstream cJSON CMakeLists.txt
Future commits will fix build issues related to cJSON.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9609 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: e0b094ab188b57f80fccba2340c3a7b56effb1c3
Former-commit-id: b4140198d20083e3ea069576f1a0d26648ff11b3
2024-10-27 08:10:49 +00:00
xavi92
04be4cf6bc librhash/CMakeLists.txt: Use standard library name
This call to set_target_properties would typically remove the "lib"
prefix from the library name for no reason, causing some systems to not
be able to find it when calling find_package().


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9608 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 542ac1c48c1764c5af5bd7f0901d05add1554e66
Former-commit-id: 654e67eaae7a5386af726da3b9457797a41c2cb1
2024-10-27 08:10:09 +00:00
xavi92
60bc291cf6 Depend on _WIN32 instead of WIN32
Whereas the former is predefined by the compiler [1], the latter is only
defined when including windows.h [2]. Because of the dependency against
windows.h, this had unexpected results where the WIN32 macro was
evaluated before windows.h were included. For example, it caused DLLEXT
to expand to ".so" instead of ".dll", causing unexpected behaviour on
several configuration menus.

In general, the use of the WIN32 macro is considered incorrect [2] and
should be replaced with _WIN32.

[1]: https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
[2]: https://stackoverflow.com/questions/662084/whats-the-difference-between-the-win32-and-win32-defines-in-c


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9607 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 7ef940a70e854369cd0669c023347ec18c206998
Former-commit-id: e9ae18d818891f977f49b34bdc59e1fd16e54b3f
2024-10-27 08:09:40 +00:00
xavi92
826e02b48d 3rdParty-devel: Install OpenGL headers only if needed
MinGW already distributes OpenGL headers and libraries under different
directories. In such cases, it is more sensible to rely on those than
the in-tree copies maintained by the project.

Note that, for some unknown reason, the include directories for the
OpenGL::GL target are not filled, even if find_package(OpenGL) is
successful and the library is found. Therefore, this commit works around
this limitation by finding GL/gl.h from a possible list of directories
inside the toolchain.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9606 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f663966c6bd42cfcb2b5135b871bb2e2e1636994
Former-commit-id: 92e313ea0f1edc8e030021225dec2c347b69f86f
2024-10-27 08:08:58 +00:00
xavi92
4e08c6ae72 checks.cmake: Do not assume CMAKE_PREFIX_PATH
If the user configures the project with a CMAKE_PREFIX_PATH, subprojects
such as xmlversion would not be configured correctly because its
CMAKE_ARGS would expand -DCMAKE_PREFIX_PATH to:

${PROJECT_SOURCE_DIR}/3rdParty ${CMAKE_PREFIX_PATH}

And this whitespace-separated list would be refused when configuring
xmlversion.

This has one side effect: the user is now required to always assign
CMAKE_PREFIX_PATH when configuring the project, and therefore not rely
on the 3rdParty directory to be available from the root directory.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9605 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9a7d683b5eb19de60403aafb2a89dd46b276b6db
Former-commit-id: 33e2c0fdfe057572b5b4f6e00339b1926cf96602
2024-10-27 08:08:24 +00:00
xavi92
05a7090c6d macros.cmake: Do not warn on INTERFACE libraries
Some third-party libraries might be defined as INTERFACE. [1]

[1]: https://cmake.org/cmake/help/latest/command/add_library.html#interface-libraries


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9603 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 1e3c228d771550ed3ef9674999fbe8182f4bfd75
Former-commit-id: 492a4d2569b0dcb8845a2a6c95deaabd1214a900
2024-10-27 08:07:20 +00:00
xavi92
ec2222a1a4 cmake: Install MinGW libraries
These libraries must be installed into the bin/ directory in order to
run the speed-dreams-2 executable.

Note that MinGW is distributed with several flavours and therefore might
define different names for libgcc. [1] libstdc++-6.dll has also been
found on different directories depending on the flavour. On the other
hand, libssp might not be available on some distributions, so it remains
optional.

[1]: https://wiki.unvanquished.net/wiki/MinGW


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9602 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 84c850bd58150fc67bdd124c0a353815185f86b0
Former-commit-id: 602c3a1227936c9da5b727c9e10ae6c90526227d
2024-10-27 08:06:42 +00:00
xavi92
7cd494f55e customthirdparty.cmake: Find libenet
Otherwise, libenet.dll would not be installed into the bin/ directory
and speed-dreams-2 would be unable to run.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9601 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: de8b4de35a2665ad6163522097efbd2ab2b923d3
Former-commit-id: 59e37f3174600adff65a134079558a45354e35bd
2024-10-27 08:06:10 +00:00
xavi92
50162b566b 3rdParty-devel: Find libbroad and libmoto
These libraries are defined by the FreeSOLID project and required by
the speed-dreams-2 executable. However, for some unknown reason,
upstream does not install() them, so it must be patched.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9600 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d40c860e1a5494c4e23022c1ce7d22b86ecd3455
Former-commit-id: 771b4a9d1612100acad3a9756553b922f7bb351e
2024-10-27 08:05:35 +00:00
xavi92
693cdc876a Import FreeSOLID/lib{moto,broad}/CMakeLists.txt
Future commits will patch these files so as to fix issues with
FreeSOLID's upstream build system.

These files have been copied from the 2.1.2 release.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9599 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9b06806b32131c5e41f1103dfa711e721039968f
Former-commit-id: b995698ff9c7f23f557574a6d2421dacd08d10c0
2024-10-27 08:04:59 +00:00
xavi92
29e77529b3 FreeSOLID-2.1.2.CMakeLists.txt: Remove -lrt
This library does not depend on any of the functions defined by
POSIX.1b [1]. Moreover, it made linking to fail on some MinGW flavours
where librt might not be available.

[1]: https://docs.oracle.com/cd/E86824_01/html/E54772/librt-3lib.html


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9598 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 89843ea922bbe14919a9a2ea9bc4a138ce31c90d
Former-commit-id: aa56dcdf148c579e63c2654c036c8147fb18ebde
2024-10-27 08:04:17 +00:00
xavi92
659d0ad143 FreeSOLID-2.1.2.CMakeLists.txt: Do not assign LIB_POSTFIX
Assigning this variable to "" causes some library names to contain the
double quotes e.g.: broad"".dll.

This fixes a build error from [MSBuild]::NormalizePath when using MSVC
as the C++ toolchain.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9597 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 7f5d1b427e0a0d4552f800b52d0777f54e3f5083
Former-commit-id: bad20fd8bffd6daf4574562d9d7d729485202cec
2024-10-27 08:03:38 +00:00
xavi92
5f524ebbbb 3rdParty-devel: Use upstream FreeSOLID CMakeLists.txt
There is no need to remove the assignment to CMAKE_DEBUG_POSTFIX on the
CMakeLists.txt since it is explicitly assigned by the call to
ExternalProject_Add.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9596 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 855063d1ca32df00e103675b1879ff4530340620
Former-commit-id: bcdc3f8798d8d69a33afc963754555948fec24f0
2024-10-27 08:02:44 +00:00
xavi92
cad91d2ead customthirdparty.cmake: Add missing libraries
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9595 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 90f49158d88f4009c7f5d0c79cfae7fb643a8cde
Former-commit-id: b01685f84ecbe3c9e1d657d156b1cb023e1eb947
2024-10-27 08:01:58 +00:00
xavi92
221a933702 Define xmlversion as ExternalProject
xmlversion is meant to be a build-time tool, which means it must never
be cross-compiled. Since toolchain settings are shared among all
libraries within a project, the only way in CMake to build an executable
using the host toolchain (instead of the cross-toolchain) is to define
it inside of an ExternalProject.

xmlversion also depends on several in-house libraries that must be also
build with the host toolchain, so those libraries shall be both
cross-compiled and natively compiled.

On the other hand, since a known install prefix is assigned to
xmlversion, _XMLVER_EXE, _XMLVER_DIR and _XMLVER_NAME no longer need to
be calculated.

Note that CMAKE_FIND_ROOT_PATH must not be passed to the ExternalProject
since xmlversion must never be cross-compiled.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9594 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d3332d5a3d388b6a6f0179b72e509606ec0055aa
Former-commit-id: 31997c4074f9e9395cb1ccfd9f7487e02584eaf4
2024-10-27 08:01:23 +00:00
xavi92
a90eae53b3 FindSDL2.cmake: Do not require mingw32 library
This library is not defined by the x86_64-w64-mingw32 toolchain, and it
is not required by the project, either.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9593 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5718cd2dbc3fc0d79246c65e65fae91b4f530bb7
Former-commit-id: 982e5f5388d65fce31ec9928d53a2976c75f5cae
2024-10-27 08:00:54 +00:00
xavi92
84f03be13d cmake: Set INTERFACE_* properties
Otherwise, target_link_libraries would be unable to find the library
path when using a target name e.g.: rhash::rhash.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9592 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ac76245db02518aa3d922d3655827259bbabfa54
Former-commit-id: 0b2d4fddd88c70ed19861d3e2d53bce395e92947
2024-10-27 08:00:07 +00:00
xavi92
2cd6611844 internaldeps.cmake: Deprecate legacy macros
ADD_INTERFACE_INCLUDEDIR relied on legacy CMake macros such as
INCLUDE_DIRECTORIES. Nowadays, targets do not specify their
dependencies' include directories, but just call target_link_libraries
so that CMake takes care of the rest.

Of course, that requires every target to define their own include
directories, if any, via target_include_directories.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9591 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f1d7ea3cb16eb1a23d600b219da8c64502e10c00
Former-commit-id: f5f7e5f86e3e984e60f794115da53fb97f7a9b22
2024-10-27 07:59:26 +00:00
xavi92
5798b9b850 macros.cmake: Simplify definition for SOURCE_DIR
The intention behind this overly complicated code was to find the
path to the top-level directory, which can be easily achieved via
CMAKE_SOURCE_DIR.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9590 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c760749883682a7879fc8cf1b5ab36719d1bab97
Former-commit-id: 0f212d66bfb33d92f4270fba3d3e2122e67f6c25
2024-10-27 07:58:46 +00:00
xavi92
f409ebdecc FindSDL2.cmake: Add CMAKE_FIND_ROOT_PATH to PATHS
Otherwise, builds that do not rely on standard search paths (e.g.:
Windows builds using a relative 3rdParty/ directory) would not be able
to find SDL2 libraries or header files.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9589 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: b9ebe31b7b7de7dad0c7e3dc903e7acb893a3883
Former-commit-id: 09665c149ad79678cb3ac11bc5ed79ed9aea0cdb
2024-10-27 07:58:17 +00:00
xavi92
21807b8820 cmake: Remove SD_FIND_CUSTOM_3RDPARTY
This macro, along with _FIND_3RDPARTY_DEPENDENCY and
_FIND_3RDPARTY_DEPENDENCIES, was meant to tell find_package() and
friends about non-standard paths to find libraries when building for
Windows.

However, the same effect can be achieved via the standard CMake
variables CMAKE_PREFIX_PATH [1] and CMAKE_FIND_ROOT_PATH [2].

If cross-compiling, CMAKE_FIND_ROOT_PATH must be assigned when
configuring the project. This means the project must now be configured
with:

cmake -B <build-dir> -DCMAKE_FIND_ROOT_PATH=<root-dir>/3rdParty ...

[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
[2]: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_ROOT_PATH.html


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9588 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9a28c7ff755e57080c1f6075dc9b7585146681b9
Former-commit-id: b406ba92a1955da3523eff392606d04d752bfdd0
2024-10-27 07:57:27 +00:00
xavi92
53f11523b6 3rdParty-devel: Add cJSON/LICENSE
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9587 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 7b09c4fd9dc5296cadb9f712884805c33e999c66
Former-commit-id: 842ddc4518d59a7c8089d2d7b3544ed1ae423fe9
2024-10-27 07:56:57 +00:00
xavi92
05f45ee35a 3rdParty-devel: Upgrade to minizip-1.3.1
According to Repology [1], zlib-1.3 is affected by CVE-2023-45853 [2].

[1]: https://repology.org/project/zlib/cves?version=1.3
[2]: https://nvd.nist.gov/vuln/detail/CVE-2023-45853


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9586 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f3c09590b0a6838d0478d5f05732dab0d09615a7
Former-commit-id: e2bdf1831a8b48bf7846526af2cfad73f781d79c
2024-10-27 07:56:24 +00:00
xavi92
95782a8ff4 3rdParty-devel: Set OPENTHREADS_ATOMIC_USE_MUTEX=ON
Otherwise, OpenSceneGraph would fail to configure with:

-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE (advanced)
_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE__TRYRUN_OUTPUT (advanced)
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED_EXITCODE (advanced)
_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED_EXITCODE__TRYRUN_OUTPUT (advanced)
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Failed

Note: in the case of the x86_64-w64-mingw32 cross-toolchain, this
commit requires the win32 thread model.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9585 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: abf7682212a38ea7a333eff88ed0743fef66da47
Former-commit-id: fb021387b5f54830fb7a6b93e3794e05d10de7de
2024-10-27 07:55:38 +00:00
xavi92
4e3e21fc01 3rdParty-devel: Patch .def files for vorbis
Even if the library name on the "LIBRARY" directive from a .def
file is defined as optional according to the specification [1],
MinGW requires it anyway. Otherwise, the linker would throw the
following error message:

.def: file format not recognized; treating as linker script

Even if this had been already reported as an issue many years ago [2],
it can still be reproduced on x86_64-w64-mingw32-ld-win32 2.43.

[1]: http://msdn2.microsoft.com/en-us/library/30fw19zw
[2]: https://lists.gnu.org/archive/html/bug-binutils/2006-03/msg00147.html


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9584 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5dd3ccdc7d18670008698ea22820d357c7ec362c
Former-commit-id: 4647af42a658582de0c01115ec9a345af43300b5
2024-10-27 07:55:04 +00:00
xavi92
fcc3ce9428 3rdParty-devel: Import vorbis files to patch
Future commits shall patch these files to fix some build-time issues in
Windows. Since CMake lacks a PATCH command as of the time of this
writing, files must be copied entirely.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9583 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: eb5fe306634342de935a1a5317da8e843d918296
Former-commit-id: 7ad29f1ce76b5ccddd6ac8ad9b239ea2e01fcec9
2024-10-27 07:54:30 +00:00
xavi92
2004f4ba0c cmake: Rely on CURL::libcurl instead of CURL_LIBRARY
When calling find_package(CURL), different files might be inspected:

- $CMAKE_PREFIX/Modules/FindCURL.cmake
- 3rdParty/lib/cmake/CURL/CURLConfig.cmake

Which file is selected is decided by CMake depending on the context.
Unfortunately, whereas the former defines CURL_LIBRARY, the latter
does not.

However, both define the CURL::libcurl target, from which the library
location can be retrieved with get_property() so as to achieve the
same effect.

Fixing this also makes CURL_NO_CURL_CMAKE redundant.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9582 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 470e785d15589e41bf6f5d1b3c42318bb5ef645e
Former-commit-id: 5f8c279fc814833acdb26ade8979f67950033a8b
2024-10-27 07:54:00 +00:00
xavi92
060bdf2a24 3rdParty-devel: Patch OpenSceneGraph-3.6.5
There were several errors when building OpenSceneGraph for Windows:

- using namespace std caused ambiguity with some symbols, and
DisplaySettings.cpp was already prepending std:: to all standard
symbols.
- ChangeDisplaySettingsEx returns a LONG [1], so casting to unsigned int
causes loss of precisions in some platforms.

[1]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-changedisplaysettingsexa


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9581 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 8991aeb238dfe0539be4a73e65ce8e2ed2bfe1ee
Former-commit-id: ebe17105114bd97afe72520289ffd08fe5acfcae
2024-10-27 07:53:27 +00:00
xavi92
bdc55d6494 3rdParty-devel: Import OpenSceneGraph files to patch
Future commits shall patch these files to fix some build-time issues in
Windows. Since CMake lacks a PATCH command as of the time of this
writing, files must be copied entirely.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9580 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d2542a7c4caffa37bc57550ba60ffab3bb0d383e
Former-commit-id: d8aaf4bbfd6017780ba1d3ffce8e600c388ea505
2024-10-27 07:52:37 +00:00
xavi92
078066c053 3rdParty-devel: Patch plib
There are several errors when building plib for Windows:

- Casting a pointer to DWORD is unsafe because they might have different
sizes. DWORD_PTR [1] must be used instead.
- Casting a pointer to long is unsafe because they might have different
sizes. ptrdiff_t must be used for pointer arithmetic.
- slDSP::counter is private so it cannot be used by waveOutProc. A
public function is now defined to achieve the expected behaviour.

[1]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/66d61dd8-2191-4a37-b963-e49bf0dc2579


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9579 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d284052bb28c49e40714a36cdc135aa284a524fa
Former-commit-id: a5f73738a1f8f9a1687c5e071f20c99b0e83a4dd
2024-10-27 07:52:04 +00:00
xavi92
a99733cbed 3rdParty-devel: Import plib files to patch
Future commits shall patch these files to fix some build-time issues in
Windows. Since, as of the time of this writing, CMake lacks a PATCH
command, files must be copied entirely.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9578 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ae23404d634e4146147f01f3d3d5faafccdea77e
Former-commit-id: bcde47f4b24ff356f32ebd222393bf731bed6ad8
2024-10-27 07:51:29 +00:00
xavi92
a8d1009656 3rdParty-devel: Remove sd_libpng_rename
These are in fact not required.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9577 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 32c552e368a378bb72549a9f2645926e2b69dedb
Former-commit-id: 31422c76cbbabd7ffef11d72979095274480262d
2024-10-27 07:50:46 +00:00