Commit Graph

3312 Commits

Author SHA1 Message Date
Chris Thrasher
f5497b2db6 Use more in-class member initializers 2023-12-22 21:55:51 -06:00
Chris Thrasher
3d4ea00135 Use sf::Vector2<T> conversion constructor 2023-12-22 20:32:08 -06:00
Chris Thrasher
ffe9cc0671 Fix incorrect assertion comment 2023-12-22 16:00:39 -06:00
kimci86
39da2b829c Make Keyboard::Key a scoped enumeration 2023-12-22 10:47:30 -06:00
kimci86
82ee0f79ac Remove Key::Last and Scan::Last enumerators
The purpose of those was to make it obvious that an action is needed to
update KeyCount or ScancodeCount when adding more enumerators, but we
rarely touch those enumerations so it is not worth adding those
technical names to the public API.
2023-12-19 22:37:13 +01:00
Chris Thrasher
b13b488f9f Remove unused function 2023-12-17 22:53:35 -07:00
Chris Thrasher
22b518af1f Remove unused function 2023-12-17 20:59:59 -07:00
Chris Thrasher
d1eb21e04f Remove reference to SFML 2 2023-12-17 20:28:11 -07:00
Chris Thrasher
674d68faa6 Remove unhelpful return values 2023-12-17 17:48:11 -07:00
Chris Thrasher
2bc4e15043 Fix typos 2023-12-17 15:48:19 -07:00
kimci86
d2f4452fc8 Use EnumArray for Key or Scancode-indexed arrays 2023-12-17 15:47:47 -07:00
kimci86
faaceb5b5b Define KeyCount and ScancodeCount out of enums
Those values are not valid Key or Scancode values, so it doesn't make
sense for them to have Key or Scancode type.
Moving them out of their enum makes it possible to write exhaustive
switch case statement without having to write a case for those values.
Making them unsigned int allows to use them as array size without having
to do a static_cast.
2023-12-17 15:47:47 -07:00
Chris Thrasher
329e40019a Print out new video mode when current mode is rejected 2023-12-17 12:59:47 -07:00
kimci86
a474654ea7
Add EnumArray to implement enum-indexed arrays 2023-12-16 18:31:25 -07:00
Chris Thrasher
92826e1c1f Remove static_casts 2023-12-16 18:28:05 -07:00
kimci86
b20376813c Rename XButton1 and XButton2 into Extra1 and Extra2
This is to avoid repeating Button when using those values now that the
sf::Mouse::Button enumeration is a scoped enumeration.
2023-12-16 12:14:43 -07:00
kimci86
eab8f426e7 Make Sensor::Type a scoped enumeration 2023-12-15 15:18:25 -07:00
kimci86
3fb0ffce51 Make Mouse::Button and Mouse::Wheel scoped enumerations 2023-12-15 15:18:25 -07:00
kimci86
ebf190b660 Make Joystick::Axis a scoped enumeration 2023-12-15 15:18:25 -07:00
kimci86
df2f56fe83 Make Cursor::Type a scoped enumeration 2023-12-15 15:18:25 -07:00
Chris Thrasher
b9fdc1de7b Remove unnecessary helper function 2023-12-15 09:04:22 -07:00
Chris Thrasher
3cf25d1c2e Add readability-containers-contains clang-tidy check 2023-12-12 09:10:51 -07:00
Chris Thrasher
2c4ffe997a Implement predicate with lambdas 2023-12-12 00:16:26 -07:00
Chris Thrasher
bdf676aec1 Fix CMake formatting 2023-12-11 23:42:12 -07:00
Chris Thrasher
79cd91124a Remove unused variable 2023-12-11 23:11:23 -07:00
Chris Thrasher
04a7184ab4 Simplify sf::View construction 2023-12-11 19:33:20 -07:00
Chris Thrasher
a6b63de5ec Remove unnecessary sf:: namespaces 2023-12-11 17:19:31 -07:00
Chris Thrasher
9a75494c01
Merge branch '2.6.x' into master 2023-12-11 15:52:55 -07:00
Chris Thrasher
81a86ebdbd
Merge branch '2.6.x' into feature/backmerge 2023-12-11 09:32:14 -07:00
Chris Thrasher
ea42079da9 Update Catch2
https://github.com/catchorg/Catch2/releases/tag/v3.5.0
2023-12-10 19:40:28 -07:00
Chris Thrasher
b199cc68d1 Unify TODO comment style for better searchability 2023-12-10 17:20:25 -07:00
Lukas Dürrenberger
c9d065a054 Issue an error when using a MinGW UCRT version 2023-12-11 00:57:08 +01:00
Chris Thrasher
0e17f4d320 Apply const to more local variables 2023-12-10 16:38:08 -07:00
Chris Thrasher
819bdb67e9 Use ranged for loop 2023-12-10 14:44:06 -07:00
Chris Thrasher
e11154e7f7 Define default special member functions in headers 2023-12-10 10:28:42 -07:00
Chris Thrasher
7223a5db63 Remove unused forward declaration 2023-12-10 00:44:12 -07:00
Chris Thrasher
f93e1e4974 Fix typos 2023-12-09 12:33:26 -07:00
Chris Thrasher
7f5d87dcd5 Add move semantics to sf::Context 2023-12-09 10:27:57 -07:00
Chris Thrasher
cc5dc0f08c Fix sf::Context::setActive bug 2023-12-08 13:42:00 -07:00
Chris Thrasher
4e2f6ae655 Add more tests for sf::Context 2023-12-01 07:09:03 -07:00
Chris Thrasher
7c9e7aa31a Avoid taking lock when not necessary 2023-11-29 17:41:24 -07:00
Chris Thrasher
48071ed335 Remove some references to SFML 2
Mentioning the version number isn't always necessary so I removed
some instances of the version number to prevent us redoing this work
for new major releases going forward.
2023-11-29 17:37:10 -07:00
Chris Thrasher
c3f69e5d64 Remove leading newlines 2023-11-29 15:54:38 -07:00
Chris Thrasher
c89c5eae69 Replace raw loops with standard algorithm 2023-11-28 09:41:28 -07:00
Chris Thrasher
c6919e28fc Prefer std::optional return types over output parameters 2023-11-28 09:37:03 -07:00
Chris Thrasher
fe0785769e Ensure consistent behavior between Android and other OSes
Android never checked if m_file was null and thus would invoke UB
upon calling certain functions whereas all other OSes would return
a defined value.
2023-11-27 17:22:15 -07:00
Chris Thrasher
9b751899eb Add tests for sf::InputSoundFile 2023-11-27 10:49:51 -05:00
Chris Thrasher
35d82b7847 Simplify implementation of sf::InputSoundFile::close 2023-11-27 10:49:51 -05:00
Chris Thrasher
0a1090c89d Let compiler define default constructors 2023-11-27 10:49:51 -05:00
Chris Thrasher
95465a3359 Modernize memory management of FLAC pointers 2023-11-26 23:30:19 -05:00