File tree Expand file tree Collapse file tree 9 files changed +20
-24
lines changed Expand file tree Collapse file tree 9 files changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,10 @@ typedef enum
144
144
sfKeyPause , ///< The Pause key
145
145
} sfKeyCode ;
146
146
147
- CSFML_WINDOW_API const unsigned int sfKeyCount ; ///< The total number of keyboard keys
148
-
147
+ enum
148
+ {
149
+ sfKeyCount = sfKeyPause + 1 ///< The total number of keyboard keys
150
+ };
149
151
150
152
////////////////////////////////////////////////////////////
151
153
/// \brief Scancodes
@@ -312,8 +314,10 @@ typedef enum
312
314
sfScanLaunchMediaSelect , //!< Keyboard Launch Media Select key
313
315
} sfScancode ;
314
316
315
- CSFML_WINDOW_API const unsigned int sfScancodeCount ; //!< The total number of scancodes
316
-
317
+ enum
318
+ {
319
+ sfScancodeCount = sfScanLaunchMediaSelect + 1 //!< The total number of scancodes
320
+ };
317
321
318
322
////////////////////////////////////////////////////////////
319
323
/// \brief Check if a key is pressed
Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ typedef enum
46
46
sfMouseButtonExtra2 , ///< The second extra mouse button
47
47
} sfMouseButton ;
48
48
49
- CSFML_WINDOW_API const unsigned int sfMouseButtonCount ; ///< The total number of mouse buttons
49
+ enum
50
+ {
51
+ sfMouseButtonCount = sfMouseButtonExtra2 + 1 ///< The total number of mouse buttons
52
+ };
50
53
51
54
////////////////////////////////////////////////////////////
52
55
/// \brief Mouse wheels
Original file line number Diff line number Diff line change @@ -47,8 +47,10 @@ typedef enum
47
47
sfSensorOrientation , ///< Measures the absolute 3D orientation (degrees)
48
48
} sfSensorType ;
49
49
50
- CSFML_WINDOW_API const unsigned int sfSensorCount ; ///< The total number of sensor types
51
-
50
+ enum
51
+ {
52
+ sfSensorCount = sfSensorOrientation + 1 ///< The total number of sensor types
53
+ };
52
54
53
55
////////////////////////////////////////////////////////////
54
56
/// \brief Check if a sensor is available on the underlying platform
Original file line number Diff line number Diff line change 33
33
#include < cstring>
34
34
35
35
36
- // //////////////////////////////////////////////////////////
37
- const unsigned int sfKeyCount = sfKeyPause + 1 ;
38
- const unsigned int sfScancodeCount = sfScanLaunchMediaSelect + 1 ;
39
-
40
-
41
36
// //////////////////////////////////////////////////////////
42
37
bool sfKeyboard_isKeyPressed (sfKeyCode key)
43
38
{
Original file line number Diff line number Diff line change 33
33
#include < SFML/Window/Mouse.hpp>
34
34
35
35
36
- // //////////////////////////////////////////////////////////
37
- const unsigned int sfMouseButtonCount = sfMouseButtonExtra2 + 1 ;
38
-
39
-
40
36
// //////////////////////////////////////////////////////////
41
37
bool sfMouse_isButtonPressed (sfMouseButton button)
42
38
{
Original file line number Diff line number Diff line change 31
31
#include < SFML/Window/Sensor.hpp>
32
32
33
33
34
- // //////////////////////////////////////////////////////////
35
- const unsigned int sfSensorCount = sfSensorOrientation + 1 ;
36
-
37
-
38
34
// //////////////////////////////////////////////////////////
39
35
bool sfSensor_isAvailable (sfSensorType sensor)
40
36
{
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ TEST_CASE("[Window] sfKeyboard")
14
14
STATIC_CHECK (sfKeyC == static_cast <int >(sf::Keyboard::Key::C));
15
15
STATIC_CHECK (sfKeyD == static_cast <int >(sf::Keyboard::Key::D));
16
16
STATIC_CHECK (sfKeyPause == static_cast <int >(sf::Keyboard::Key::Pause));
17
- CHECK (sfKeyCount == sf::Keyboard::KeyCount);
17
+ STATIC_CHECK (sfKeyCount == sf::Keyboard::KeyCount);
18
18
}
19
19
20
20
SECTION (" sfScancode" )
@@ -24,6 +24,6 @@ TEST_CASE("[Window] sfKeyboard")
24
24
STATIC_CHECK (sfScanB == static_cast <int >(sf::Keyboard::Scan::B));
25
25
STATIC_CHECK (sfScanC == static_cast <int >(sf::Keyboard::Scan::C));
26
26
STATIC_CHECK (sfScanD == static_cast <int >(sf::Keyboard::Scan::D));
27
- CHECK (sfScancodeCount == sf::Keyboard::ScancodeCount);
27
+ STATIC_CHECK (sfScancodeCount == sf::Keyboard::ScancodeCount);
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ TEST_CASE("[Window] sfMouse")
13
13
STATIC_CHECK (sfMouseMiddle == static_cast <int >(sf::Mouse::Button::Middle));
14
14
STATIC_CHECK (sfMouseButtonExtra1 == static_cast <int >(sf::Mouse::Button::Extra1));
15
15
STATIC_CHECK (sfMouseButtonExtra2 == static_cast <int >(sf::Mouse::Button::Extra2));
16
- CHECK (sfMouseButtonCount == sf::Mouse::ButtonCount);
16
+ STATIC_CHECK (sfMouseButtonCount == sf::Mouse::ButtonCount);
17
17
}
18
18
19
19
SECTION (" sfMouseWheel" )
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ TEST_CASE("[Window] sfSensor")
14
14
STATIC_CHECK (sfSensorGravity == static_cast <int >(sf::Sensor::Type::Gravity));
15
15
STATIC_CHECK (sfSensorUserAcceleration == static_cast <int >(sf::Sensor::Type::UserAcceleration));
16
16
STATIC_CHECK (sfSensorOrientation == static_cast <int >(sf::Sensor::Type::Orientation));
17
- CHECK (sfSensorCount == sf::Sensor::Count);
17
+ STATIC_CHECK (sfSensorCount == sf::Sensor::Count);
18
18
}
19
19
}
You can’t perform that action at this time.
0 commit comments