Commit Graph

2472 Commits

Author SHA1 Message Date
Vittorio Romeo
411d702d7a Use 'ccache' if available 2022-03-03 14:41:07 +00:00
Jan Haller
28e935673c Const-qualify local variables in Vector2 test, where possible 2022-02-28 16:18:00 +00:00
Jan Haller
2eef193c0e Unit tests for Vector2 extensions
Also adds ApproxVec and ApproxDeg types for more readable comparison of approximate vectors/angles.
2022-02-28 16:18:00 +00:00
Jan Haller
70eeba5067 Add Vector2 extension methods (inspired from Thor)
Adds vector algebra functionality as member functions for Vector2<T>, with some methods limited to floating-point T.
Also adds UnitX and UnitY constants for the two axis unit vectors.
2022-02-28 16:18:00 +00:00
kimci86
fab2c93d7a Simplify CI workflow 2022-02-20 17:00:43 +01:00
Chris Thrasher
106da21dd1 Revert accidental filesystem conversion
"extension" in this context is not referring to a file extension.
2022-02-18 19:48:54 +00:00
Chris Thrasher
80004d87b1 Build sf::Transformable tests
Transformable.cpp was originally compiled when I first submitted
PR #1973. While that PR was in review, #2012 got merged which
changed how tests are compiled. These two PR were in conflict so
when I went to resolve conflicts on #1973, I accidentaly removed
the line which added Transformable.cpp to the build. Because not
compiling this file caused no build breaks, nobody noticed until
after #1973 got merged. My bad, everybody.
2022-02-18 19:48:29 +00:00
Chris Thrasher
a733e4cd7e Remove unused CMake variables 2022-02-17 23:24:02 +01:00
Chris Thrasher
abe420897d Add tests for sf::Transformable 2022-02-17 20:48:30 +00:00
Chris Thrasher
2f2284955e Use list(APPEND to simplify modifying variables 2022-02-17 14:39:07 +01:00
Vittorio Romeo
d55b5ec5b9 Minor include cleanup ('Window', 'RenderWindow') 2022-02-17 01:42:31 +00:00
Chris Thrasher
5f2c7bb898 Use std::filesystem::path 2022-02-17 00:40:29 +00:00
Chris Thrasher
ec4ac1afc4 Remove GCC 8 workarounds 2022-02-17 00:40:29 +00:00
Chris Thrasher
2df0bfa1b5 Update iOS deployment target to 13.0 2022-02-17 00:40:29 +00:00
Jakub 'Eremiell' Marek
938a407a44 Update required Android API level in CMakeLists
API level 26 is required in the CI pipeline, so this seems to be a
leftover from some earlier version.
2022-02-17 00:40:29 +00:00
Jakub 'Eremiell' Marek
1334e3c466 Update Android NDK to r23b
This commit updates the NDK version to latest available at the
time.

The expectation from this change is to resolve issues with code
modernisation and to allow us to use C++ 17 features on Android.

This shouldn't affect devices supported as we're not changing the
API level.

For more details see:
https://developer.android.com/ndk/downloads/revision_history
2022-02-17 00:40:29 +00:00
Chris Thrasher
e93adc65ee Add missing override keyword 2022-02-17 00:40:29 +00:00
Vittorio Romeo
a3b27b4a6d Use pre-increment when post-increment is not necessary 2022-02-17 00:39:35 +00:00
Chris Thrasher
fbd624bcf3 Remove Cygwin workaround
This line was intended to silence a warning, however in the time
since that code was added in 95828a85a, the minimum required CMake
version was increased from 2.8.3 to 3.8. As of CMake 2.8.4 this
warning is no longer emitted which means we can remove this line.
2022-02-17 00:02:23 +00:00
Vittorio Romeo
218154cf00 Add move semantics to 'Font', 'Text,' and 'Image' 2022-02-16 16:29:45 +00:00
Vittorio Romeo
b069f88127 Avoid overuse of 'std::endl' 2022-02-16 16:28:39 +00:00
Vittorio Romeo
5fee1aad7d Add '[[nodiscard]]' in more useful/ambiguous places, fix usages 2022-02-16 16:27:32 +00:00
Jan Haller
eb321b3040 Update year to 2022 (master branch) 2022-02-16 13:52:31 +00:00
Chris Thrasher
5236513f16 Simplify how tests are built 2022-02-16 13:51:29 +00:00
Vittorio Romeo
83259a4a31 Add move semantics to 'sf::Packet' 2022-02-16 13:50:07 +00:00
Vittorio Romeo
32ad019304 Cleanup sf::err includes 2022-02-16 08:45:39 +01:00
binary1248
359fe9088c Fixed warnings reported by LGTM and Coverity Scan. 2022-02-16 08:26:17 +01:00
Vittorio Romeo
5b500ad2c2 Turn more compile-time constants into 'constexpr' variables 2022-02-15 13:27:10 +00:00
binary1248
9d51a6bd50 Fix license detection and add helpful links to external libraries and their licenses. 2022-02-11 08:29:00 +01:00
Vittorio Romeo
dbeef66693 Turn 'sf::Transform' into a 'constexpr' class 2022-02-10 23:51:47 +00:00
Vittorio Romeo
63ce7e4e92 Remove unnecessary includes from public-facing headers 2022-02-10 21:05:49 +00:00
binary1248
d7f48d15c6 Adjust .codecov.yml to make coverage have minimal impact for now. 2022-02-10 21:05:13 +01:00
binary1248
66339bc09c Added support for coverage reporting. 2022-02-10 08:08:47 +01:00
Vittorio Romeo
0e419543f2 Make 'Color' constants 'constexpr' and add tests 2022-02-08 23:32:12 +00:00
Chris Thrasher
28f273b9c9 Add sf::Angle
Similar to sf::Time, sf::Angle provides a typesafe API for working
with angles and provides named functions for converting to and from
degrees and radians.
2022-02-08 22:52:37 +00:00
Lukas Dürrenberger
ef8d6ee7f7 Remove VS 2017 as GitHub Actions compiler
VS 2017 doesn't fully support C++17
2022-02-05 19:11:15 +01:00
Chris Thrasher
0c8c35fa0c Fix findIntersection documentation 2022-02-04 09:35:34 +01:00
Chris Thrasher
8f1955af17 Don't add SFML:: namespace to external targets
The SFML target export set includes a number of external targets
which are not owned by the project itself. This includes targets
like Freetype and OpenGL. By specifying a namespace for the export
set, a SFML:: namespace was prepended to all targets. This is not
a problem when using shared libraries but when building and using
static libraries caused a problem where CMake was attempting and
failing to find targets with names like SFML::Freetype or
SFML::OpenGL which did not exist.

Luckily CMake allows you put namespaces in the EXPORT_NAME target
property so now we can just add the SFML:: namespace in the macro
which creates SFML targets and remove the `NAMESPACE SFML::` line
which was adding namespaces to all targets.
2022-01-28 08:11:53 +01:00
Chris Thrasher
7c80f302e4 Use std::optional to remove extra sf::Rect::intersects overload 2022-01-27 02:55:11 +00:00
Chris Thrasher
0ad6d1815c Remove unnecessary CMake version requirement
This is left over from 0f83e3d but we forgot to remove it. Nothing
about this file requires an elevated minimum CMake version now that
the FetchContent usage is gone.
2022-01-22 15:51:27 +01:00
kimci86
ad21794f39 Fix runtests target for multi-configuration generators 2022-01-21 21:19:32 +01:00
Chris Thrasher
052e624ddf Remove GCC 4 workaround 2022-01-21 21:19:05 +01:00
Chris Thrasher
a322d18e63 Use built-in CMake project version functionality 2022-01-21 21:09:20 +01:00
Lukas Dürrenberger
60deef9997 Add support for VS 2022 to the GitHub Actions workflow 2022-01-20 10:53:52 +01:00
Chris Thrasher
7cdb728e52 Add tests for sf::BlendMode 2022-01-20 07:39:19 +01:00
Chris Thrasher
871c021a75 Add tests for sf::ContextSettings 2022-01-13 23:49:37 +01:00
Vittorio Romeo
a880122836 Reintroduce 'SleepImpl' sleep implementation 2022-01-12 00:01:35 +00:00
Chris Thrasher
da6a226941 Add tests for sf::Clock 2022-01-11 22:49:00 +00:00
Chris Thrasher
4586db91a9 Add SFML:: namespace to targets
This removes the sfml- prefixed targets from the export set. The sfml-
prefixed targets are still available within the build tree but not to
downstream users thus making this an API breaking change when compared
to the 2.x releases. To keep things consistent, usage of the sfml-
targets were replaced with their namespaced counterparts.

This has a number of benefits:

  1. It's more idiomatic. Modern CMake libraries are expected to
     have namespaced targets.

  2. Namespaced targets are less likely to collide with user-defined
     targets. No one will accidentally define a SFML:: target.

  3. If a namespaced target is not found by CMake, configuration
     will immediately stop.
2022-01-11 22:27:39 +01:00
Chris Thrasher
b717a68fba Add tests for sf::Transform 2022-01-08 15:06:12 +01:00