1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Clean up MSVC warnings in CIrrDeviceSDL.{h,cpp} (#14872)

The only changes are to add a number of `static_cast`s to make implicit
type conversions explicit.
This commit is contained in:
JosiahWI 2024-07-27 11:28:54 -05:00 committed by GitHub
parent 7625f88a0c
commit ac284e61b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 16 deletions

View file

@ -159,7 +159,8 @@ public:
void setPosition(s32 x, s32 y) override
{
SDL_WarpMouseInWindow(Device->Window,
x / Device->ScaleX, y / Device->ScaleY);
static_cast<int>(x / Device->ScaleX),
static_cast<int>(y / Device->ScaleY));
if (SDL_GetRelativeMouseMode()) {
// There won't be an event for this warp (details on libsdl-org/SDL/issues/6034)
@ -192,7 +193,7 @@ public:
virtual void setRelativeMode(bool relative) _IRR_OVERRIDE_
{
// Only change it when necessary, as it flushes mouse motion when enabled
if (relative != SDL_GetRelativeMouseMode()) {
if (relative != static_cast<bool>(SDL_GetRelativeMouseMode())) {
if (relative)
SDL_SetRelativeMouseMode(SDL_TRUE);
else