Commit graph

5295 commits

Author SHA1 Message Date
19a87b4418
build.yml: Upload Debian package
All checks were successful
/ build (pull_request) Successful in 16m23s
2025-01-08 22:39:42 +01:00
b21543a5fe
build.yml: Build Debian package
All checks were successful
/ build (pull_request) Successful in 14m27s
2025-01-07 00:22:55 +01:00
ec1cb5cca3
WIP revamp Debian packaging 2025-01-07 00:22:55 +01:00
6995a21a42
WIP Remove packagemanager-nsis.cmake 2025-01-07 00:22:55 +01:00
4c7ccc4914
CMakeLists.txt: Add HOMEPAGE_URL to project
This is later used by CPack for its CPACK_PACKAGE_HOMEPAGE_URL.

[1]: https://cmake.org/cmake/help/latest/module/CPack.html#variable:CPACK_PACKAGE_HOMEPAGE_URL
2025-01-07 00:22:55 +01:00
365b6684fd
build.yml: Add step names
These get reflected by the web browser interface, enhancing readability.
However, splitting into different steps requires to specify the working
directory.
2025-01-07 00:22:55 +01:00
4bd48b8ae0
build.yml: Change indentation from 4 to 2 spaces
Even if most of the project follows the 4-space convention, 2 spaces
seems more comfortable for YAML files, specially for workflows where
deeper levels of indentations are common.
2025-01-07 00:22:55 +01:00
Xavier Del Campo Romero
96d0dafac7 Merge pull request 'CMakeLists.txt: Reduce version to 2.3.0' (#13) from xavi/speed-dreams-code:reduce-version into main
Reviewed-on: #13
2025-01-07 00:20:31 +01:00
7700b68d87
CMakeLists.txt: Reduce version to 2.3.0
Some checks failed
/ build (pull_request) Has been cancelled
Until version 2.4.0 is not released, it is better to keep it as 2.3.0
since `git describe --tags --dirty` would return `v2.3.0-...` until the
`v2.4.0` tag is created.

Accordingly, speed-dreams-data also reduced its version to 2.3.0. [1]

[1]: 5c58ce805d
2025-01-07 00:18:47 +01:00
Xavier Del Campo Romero
c1cdee61e7 Merge pull request 'Add build.yml Forgejo workflow' (#9) from build-workflow into main
Reviewed-on: #9
2025-01-04 13:27:17 +01:00
17f37e85ad
Add build.yml Forgejo workflow
All checks were successful
/ build (pull_request) Successful in 12m52s
2025-01-04 13:00:28 +01:00
Xavier Del Campo Romero
7d2727c579 Merge pull request 'Introduce SD_ASSUME_DATADIR' (#10) from assume-datadir into main
Reviewed-on: #10
2025-01-04 13:00:03 +01:00
198f96295a
CMakeLists.txt: Introduce SD_ASSUME_DATADIR
This repository depends on the speed-dreams-data package in order to
generate a working package. However, in the context of CI/CD, it is
desirable to build this package without depending on the
speed-dreams-data, and instead assume it would be found on a standard
location.

Therefore, this would allow the generation of artifacts that install to
standard locations, such as Debian packages.
2025-01-04 11:55:19 +01:00
95f0bb57e6
CMakeLists.txt: Move call to project() to the top
Otherwise, references to standard CMake variables such as
CMAKE_INSTALL_PREFIX [1] would return an empty string.

Note: for some reason, CMake only documents this behaviour for other
variables such as PROJECT_SOURCE_DIR or PROJECT_BINARY_DIR, but not
CMAKE_INSTALL_PREFIX. [2] However, it was reproducible.

[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
[2]: https://cmake.org/cmake/help/latest/command/project.html
2025-01-04 11:51:37 +01:00
Xavier Del Campo Romero
6791a9358f Merge pull request 'advancedgraphicconfig.cpp: Fix wrong direction' (#8) from fix-wrong-dir into main
Reviewed-on: #8
2025-01-03 12:37:40 +01:00
d56b0c54dc
advancedgraphicconfig.cpp: Fix wrong direction
This was causing the right arrow to act like the left arrow, so shaders
would jump from "none" to "ultra" instead of from "none" to "little".
2025-01-03 12:32:57 +01:00
Xavier Del Campo Romero
316a1bc18b Merge pull request 'Fix several issues with file setup' (#2) from issue-1 into main
Reviewed-on: #2
2025-01-03 00:18:30 +01:00
Xavier Del Campo Romero
f6bce9f4fb Merge pull request 'mainmenu.cpp: Move downloads button to correct order' (#5) from issue-4 into main
Reviewed-on: #5
2025-01-02 23:09:30 +01:00
98806b1e6e
mainmenu.cpp: Move downloads button to correct order
Otherwise, pressing the "arrow down" key would jump with the following
order:

Options -> Downloads -> Credits -> Quit

Instead of the expected order:

Options -> Credits -> Downloads -> Quit
2025-01-02 23:00:34 +01:00
7e72f12a48
filesetup.cpp: Ensure destination dir before copy
When GfFileSetup is called on a fresh installation, none of the
destination directories might exist.

On the other hand, robustness has been slightly improved by adding calls
to good() and is_open().
2025-01-01 21:54:29 +01:00
1f81d42305
unitmain.cpp: Remove confusing error message
Now that the game ships without any driver by default, it is very likely
that simplix.xml does not exist on fresh installations. In fact, the
game already did not consider this as an error, so this was a leftover.
2025-01-01 21:05:12 +01:00
a0c31c8a1c
download-manager/README.md: Update driver info 2024-12-31 10:42:07 +01:00
bd2880e37b
Look up SD_DATADIR_ABS if SD_DATADIR not found
Commit 744677c3a6f3e6c1c463fe55b7b5408355ffe89b from speed-dreams-data
replaced the definition for SD_DATADIR from an absolute path to a
relative path. This was done in order to allow a relative path to be
looked up first by GfApplication::parseOptions() (as required by Windows
and macOS builds), and then look SD_DATADIR_ABS if not found (as
required by in-tree builds).
2024-12-31 08:34:49 +01:00
ef04856f25
cmake: Replace SVN versioning with git-describe(1)
Now that the project has been migrated from SVN to Git,
the complex logic to determine the project version is now no longer
needed, since Git can achieve the same effect with git-describe(1). [1]

TODO: CPack-related code should be also updated accordingly.

[1]: https://git-scm.com/docs/git-describe
2024-12-31 06:50:42 +01:00
58a4692905
CMakeLists.txt: Remove obsolete < 3.0.2 checks
CMake 3.0.2 was released over ten years ago. [1] It is therefore assumed
that more modern CMake versions are already widely available.

[1]: https://cmake.org/files/v3.0/
2024-12-31 06:25:57 +01:00
9a21275afc
Reload GfRaceManagers on downloadsmenu exit
This is required since _vecAcceptedCarCategoryIds must be reloaded so
that car categories are refreshed when entering the driver selection
menu.
2024-12-31 06:14:07 +01:00
a0c2dcc761
Reload tracks on downloadsmenu exit 2024-12-31 06:14:07 +01:00
bc95fd8f25
unitmain.cpp: Do not error on failed getCategory
The game would already ignore drivers with a non-existing car.
2024-12-31 06:14:07 +01:00
6fb613cc89
cmake: Do not install anything as DATA
Since the migration from SVN to Git, the data/ directory was put into a
separate repository, so that the engine repository should never install
anything there.
2024-12-31 06:14:07 +01:00
e93d3a9900
cmake: Leave SD_DATADIR empty if undefined
Otherwise, if the speed-dreams-data package is not found, SD_DATADIR
would expand to "/", which is a valid directory that the game would
attempt to look up.
2024-12-31 06:14:06 +01:00
d831bacfba
tgf/tgf.cpp: Return empty tgtPath on empty srcPath
Otherwise, even if srcPath is empty, a trailing '/' would be appended to
tgtPath, and therefore it would not be possible to get an empty data
directory if SD_DATADIR is undefined or empty.
2024-12-31 06:14:06 +01:00
522022fe1f
Remove xmlversion
This command line tool was meant to generate a XML file (typically,
version.xml) containing the version numbers for a list of files defined
by the SD_INSTALL_FILES CMake macro. Then, the game would read this XML
file and copy files around if an update was needed.

Unfortunately, this introduced a circular dependency between the engine
and data repositories, as the engine repository would rely on the data
directory to know the file list, and the data repository would rely on
the xmlversion executable to be available, and therefore the engine
repository.

Ultimately, none of this was needed: it is much simpler to define a
static, line-separated list of files in the data repository, and then
let the game figure out the versioning by itself. This renders
xmlversion entirely redundant, and therefore breaks the circular
dependency. As a bonus, some overly complex CMake stuff could be
removed.
2024-12-31 06:14:06 +01:00
91b7a3bb41
tgf/params.cpp: Return -1 on error
Otherwise, it would be impossible to distinguish an error from version
number '0', which is also valid.
2024-12-31 06:14:06 +01:00
63489e627e
install.cmake: Remove obsolete macros
Car/track installation is handled by the speed-dreams-data package.
2024-12-31 06:14:06 +01:00
cf18241a16
cmake: Get SD_DATADIR from speed-dreams-data package
So far, the game assets were located in the same repository as the game
engine. Since data and engine are split into different repositories, now
this project requires users to assign the CMAKE_PREFIX_PATH variable [1]
to indicate the location, only in the case of non-standard locations.

[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
2024-12-31 06:14:06 +01:00
f593eee939
Rename COPYING.txt to LICENSE 2024-12-31 06:14:05 +01:00
f9b820229f
Replace README.txt with README.md 2024-12-31 06:14:05 +01:00
7bd0fe9fa9
CMakeLists.txt: Do not depend on data/ 2024-12-31 05:23:42 +01:00
4d53ae9ce6
Add .gitignore 2024-12-31 05:23:42 +01:00
fec5fc09d3 drivers/CMakeLists.txt: Remove urbanski
Even if urbanski is a good example of a minimalistic implementation that
can be used for learning, it is far from a competitive driver and is
highly prone to crash in race, which would affect user experience
negatively.

Therefore, it is better to leave the source code available for reference
purposes, but do not include it into the build so that urbanski-drivers
cannot be selected.


Former-commit-id: 277281ef785291f0e7deb262e2c2c3b8f9cffc3b
Former-commit-id: efde653b918a8a4df65ac23b15025e4aeefc9275
2024-12-25 08:06:45 +01:00
65861b65dd Remove bt, K1999, hymie and kilo2008
These drivers are considered obsolete and were not even built any more.


Former-commit-id: 951cff0a690a7fe9320ed767863495266bac5159
Former-commit-id: 923e07a5ee892d5dab22593934c98958fdd63ed7
2024-12-25 08:06:44 +01:00
91d844529b simplix: Remove static buffers, use .json
Having statically allocated buffers in this context was not only
unnecessary, but also dangerous because these strings would be shared
among all TDriver instances, even if they really should not, since every
TDriver instance belongs to a different driver, and therefore different
parameters.

Also, since racing lines are now dumped into JSON files, it makes sense
to reflect this into the file extension, too, so that text editors can
easily recognise the syntax.


Former-commit-id: 3421b724bfc040f288fe61ffc0fc78fe5a25cd4f
Former-commit-id: 0844542eecaa950c1f96a860e2fcd21d6807059a
2024-12-25 08:06:44 +01:00
79765ddb87 unitclothoid.cpp: Rewrite points load/save
Since oPathPoints is defined as a std::vector, dumping TPathPt instances
as Plain Old Data is not valid any more. In fact, C++ compilers would
already warn that offsetof(3) could not be safely used with TPathPt
members since it never was Plain Old Data, but this warning was
suppressed only because raw pointer manipulation had been used instead
of offsetof(3).

On the other hand, dumping binary data is inherently non-portable and
not human-readable, so this commit suggests to dump such data in JSON
format, as cJSON is already used by the project and XML is bad, among
many other things, to store arbitrarily large arrays.


Former-commit-id: 4a447adb452dd9ae85ca4cce9993cbe9ad0487f6
Former-commit-id: b462a614ed53f1938eadb4680a10ef57576b29d9
2024-12-25 08:06:44 +01:00
d801a160f1 unitlane.cpp: Remove reference to TDriver
Otherwise, copying TLane objects using the default copy operation would
not be possible.


Former-commit-id: be7ac7e2191792ad8e43766ea39f745591f10916
Former-commit-id: 4d17b9524cd539c0dca0220108dea1d7a38e9f9b
2024-12-25 08:06:44 +01:00
8a6b2aadc7 simplix: Replace arrays with std::vector
Former-commit-id: 8b4302b8b5bbd9c7aed3d29fdf2f3c820c1573c5
Former-commit-id: 3c72d5837afce3fd38aaf2055ef9b3d2a45a134b
2024-12-25 08:06:44 +01:00
4a36fd8de7 unitlane.h: Remove dummy member
Former-commit-id: 51dc81acf9d63f7d546d0937bd1fd8543dced110
Former-commit-id: 270770ed620a887b1e5e3442f5777c45cab34c50
2024-12-25 08:06:43 +01:00
70acd3d39d unitstrategy.cpp: Use std::string::c_str
Former-commit-id: 4728473b0d6e7cffcdc44c51632d2677efb8b70b
Former-commit-id: 25db904cdebe501c4db16eaf2bf963631e54e6a4
2024-12-25 08:06:43 +01:00
9af00aa398 unitclothoid: const-qualify TClothoidLane::GetWeather
Former-commit-id: c42308e360bd00209ec962fd62fd7c7029e9e429
Former-commit-id: 25f42663812c6cb8467c361cf136061305fb4132
2024-12-25 08:06:43 +01:00
f1c266b487 simplix: Refactor a few things
- Replace some non-const-correct char * to std::string to avoid
potential dangling pointers and manual memory management.
- oCommonData was deemed redundant, so unitcommondata.{cpp,h} have been
removed.
- There was no need to define non-default destructors or operator= for
TCarParam.
- oSideScaleMu and oSideScaleBrake were always set to 0.95f instead of
0.97f by all categories, so assume these values as defaults and remove
both TDriver::ScaleSide and these variables altogether.
- Since robots now allocated driver data dynamically i.e., without
any arbitrary limits, oExtended was deemed redundant.


Former-commit-id: 6f64dba41e036e37345bfba1d2de75bdb347a976
Former-commit-id: bd10700dae55653ef15936f3613c942a8ec753a7
2024-12-25 08:06:43 +01:00
b70c47d274 simplix: Set oRacingLine as std::vector
Former-commit-id: 9f1b1e376ad6959e683f016b5d253eb885bc08d1
Former-commit-id: 0da217a412a5b19a24cc3b23a6259521c1cc18cf
2024-12-25 08:06:43 +01:00