From 5527b9f373ef4267a2b44f816be07ddab48a289d Mon Sep 17 00:00:00 2001 From: DS Date: Mon, 20 Feb 2023 13:22:28 +0100 Subject: [PATCH 1/4] SDL: Use SDL_WINDOW_FULLSCREEN_DESKTOP and allow to maximize+fullscreen at once (#156) --- source/Irrlicht/CIrrDeviceSDL.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 23f00d2..1af434b 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -234,13 +234,17 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) createKeyMap(); if (CreationParams.Fullscreen) { +#ifdef _IRR_EMSCRIPTEN_PLATFORM_ SDL_Flags |= SDL_WINDOW_FULLSCREEN; - } else { - if (Resizable) - SDL_Flags |= SDL_WINDOW_RESIZABLE; - if (CreationParams.WindowMaximized) - SDL_Flags |= SDL_WINDOW_MAXIMIZED; +#else + SDL_Flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; +#endif } + if (Resizable) + SDL_Flags |= SDL_WINDOW_RESIZABLE; + if (CreationParams.WindowMaximized) + SDL_Flags |= SDL_WINDOW_MAXIMIZED; + if (CreationParams.DriverType == video::EDT_OPENGL) { SDL_Flags |= SDL_WINDOW_OPENGL; From ea297196b7135faac820073d0ce107e43a734d48 Mon Sep 17 00:00:00 2001 From: Desour Date: Tue, 21 Feb 2023 18:30:14 +0100 Subject: [PATCH 2/4] Resolve some -Wreorder warnings --- source/Irrlicht/CIrrDeviceLinux.h | 7 +++---- source/Irrlicht/CWriteFile.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceLinux.h b/source/Irrlicht/CIrrDeviceLinux.h index c456a1a..ea50d7c 100644 --- a/source/Irrlicht/CIrrDeviceLinux.h +++ b/source/Irrlicht/CIrrDeviceLinux.h @@ -414,6 +414,9 @@ namespace irr bool HasNetWM; // text is utf-8 mutable core::stringc Clipboard; +#endif +#if defined(_IRR_LINUX_X11_XINPUT2_) + int currentTouchedCount; #endif u32 Width, Height; bool WindowHasFocus; @@ -454,10 +457,6 @@ namespace irr }; core::array ActiveJoysticks; #endif - -#if defined(_IRR_LINUX_X11_XINPUT2_) - int currentTouchedCount; -#endif }; diff --git a/source/Irrlicht/CWriteFile.cpp b/source/Irrlicht/CWriteFile.cpp index aa07b49..2af6936 100644 --- a/source/Irrlicht/CWriteFile.cpp +++ b/source/Irrlicht/CWriteFile.cpp @@ -12,7 +12,7 @@ namespace io CWriteFile::CWriteFile(const io::path& fileName, bool append) -: FileSize(0), Filename(fileName) +: Filename(fileName), FileSize(0) { #ifdef _DEBUG setDebugName("CWriteFile"); From 839bdc1a658773ea9525bec547e2b887664a14ba Mon Sep 17 00:00:00 2001 From: Desour Date: Tue, 21 Feb 2023 18:54:07 +0100 Subject: [PATCH 3/4] Fix -Wignored-qualifiers warnings in irrUString.h --- include/irrUString.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/irrUString.h b/include/irrUString.h index a50d497..5b2b857 100644 --- a/include/irrUString.h +++ b/include/irrUString.h @@ -963,11 +963,11 @@ public: #endif if (sizeof(wchar_t) == 4) - append(reinterpret_cast(c)); + append(reinterpret_cast(c)); else if (sizeof(wchar_t) == 2) - append(reinterpret_cast(c)); + append(reinterpret_cast(c)); else if (sizeof(wchar_t) == 1) - append(reinterpret_cast(c)); + append(reinterpret_cast(c)); } @@ -982,11 +982,11 @@ public: #endif if (sizeof(wchar_t) == 4) - append(reinterpret_cast(c), length); + append(reinterpret_cast(c), length); else if (sizeof(wchar_t) == 2) - append(reinterpret_cast(c), length); + append(reinterpret_cast(c), length); else if (sizeof(wchar_t) == 1) - append(reinterpret_cast(c), length); + append(reinterpret_cast(c), length); } @@ -1116,11 +1116,11 @@ public: ustring16& operator=(const wchar_t* const c) { if (sizeof(wchar_t) == 4) - *this = reinterpret_cast(c); + *this = reinterpret_cast(c); else if (sizeof(wchar_t) == 2) - *this = reinterpret_cast(c); + *this = reinterpret_cast(c); else if (sizeof(wchar_t) == 1) - *this = reinterpret_cast(c); + *this = reinterpret_cast(c); return *this; } @@ -3049,14 +3049,14 @@ public: //! Gets the encoding of the Unicode string this class contains. //! \return An enum describing the current encoding of this string. - const unicode::EUTF_ENCODE getEncoding() const + unicode::EUTF_ENCODE getEncoding() const { return encoding; } //! Gets the endianness of the Unicode string this class contains. //! \return An enum describing the endianness of this string. - const unicode::EUTF_ENDIAN getEndianness() const + unicode::EUTF_ENDIAN getEndianness() const { if (encoding == unicode::EUTFE_UTF16_LE || encoding == unicode::EUTFE_UTF32_LE) From 09e6eeb65b03d0bec1dfbcc008bd57fd5cd5802c Mon Sep 17 00:00:00 2001 From: Desour Date: Tue, 21 Feb 2023 19:29:32 +0100 Subject: [PATCH 4/4] Remove irr::core::hash Its use of std::unary_function was deprecated. And it wasn't used anywhere. --- include/irrUString.h | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/include/irrUString.h b/include/irrUString.h index 5b2b857..8e553fd 100644 --- a/include/irrUString.h +++ b/include/irrUString.h @@ -3612,33 +3612,5 @@ inline std::wostream& operator<<(std::wostream& out, const ustring16& in) return out; } -namespace unicode -{ - -//! Hashing algorithm for hashing a ustring. Used for things like unordered_maps. -//! Algorithm taken from std::hash. -class hash : public std::unary_function -{ - public: - size_t operator()(const core::ustring& s) const - { - size_t ret = 2166136261U; - size_t index = 0; - size_t stride = 1 + s.size_raw() / 10; - - core::ustring::const_iterator i = s.begin(); - while (i != s.end()) - { - // TODO: Don't force u32 on an x64 OS. Make it agnostic. - ret = 16777619U * ret ^ (size_t)s[(u32)index]; - index += stride; - i += stride; - } - return (ret); - } -}; - -} // end namespace unicode - } // end namespace core } // end namespace irr