diff --git a/Editor/MaterialWindow.cpp b/Editor/MaterialWindow.cpp index b13785a24..b41060681 100644 --- a/Editor/MaterialWindow.cpp +++ b/Editor/MaterialWindow.cpp @@ -198,16 +198,16 @@ void MaterialWindow::Create(EditorComponent* _editor) shaderTypeComboBox.SetSize(XMFLOAT2(wid, hei)); shaderTypeComboBox.OnSelect(forEachSelected([this] (auto material, auto args) { if (args.iValue >= MaterialComponent::SHADERTYPE_COUNT) - { - material->SetCustomShaderID(args.iValue - MaterialComponent::SHADERTYPE_COUNT); - blendModeComboBox.SetEnabled(false); - } - else - { - material->shaderType = (MaterialComponent::SHADERTYPE)args.userdata; - material->SetCustomShaderID(-1); - blendModeComboBox.SetEnabled(true); - } + { + material->SetCustomShaderID(args.iValue - MaterialComponent::SHADERTYPE_COUNT); + blendModeComboBox.SetEnabled(false); + } + else + { + material->shaderType = (MaterialComponent::SHADERTYPE)args.userdata; + material->SetCustomShaderID(-1); + blendModeComboBox.SetEnabled(true); + } })); shaderTypeComboBox.SetEnabled(false); shaderTypeComboBox.SetMaxVisibleItemCount(5); diff --git a/WickedEngine/CMakeLists.txt b/WickedEngine/CMakeLists.txt index fdcb9fb86..00d5094d0 100644 --- a/WickedEngine/CMakeLists.txt +++ b/WickedEngine/CMakeLists.txt @@ -125,6 +125,9 @@ else () #-Werror #uncomment this to stop the compilation at the first error # -Wfatal-errors + + # turn off some warnings we don't want + -Wno-nullability-completeness # _Nonnull etc. are only supported on Clang ) elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # add some warnings and set them as errors diff --git a/WickedEngine/LUA/CMakeLists.txt b/WickedEngine/LUA/CMakeLists.txt index 3017fb754..a7d9c6069 100644 --- a/WickedEngine/LUA/CMakeLists.txt +++ b/WickedEngine/LUA/CMakeLists.txt @@ -12,9 +12,15 @@ if (UNIX) target_compile_definitions(LUA PUBLIC LUA_USE_POSIX=1) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(LUA PRIVATE + -Wno-string-plus-int + ) +endif() + set_target_properties(LUA PROPERTIES - FOLDER "ThirdParty" - POSITION_INDEPENDENT_CODE ${WICKED_PIC} + FOLDER "ThirdParty" + POSITION_INDEPENDENT_CODE ${WICKED_PIC} ) install(FILES ${LUA_HEADERS} diff --git a/WickedEngine/wiInput.cpp b/WickedEngine/wiInput.cpp index 5d833e940..51a602107 100644 --- a/WickedEngine/wiInput.cpp +++ b/WickedEngine/wiInput.cpp @@ -328,11 +328,11 @@ namespace wi::input case Controller::SDLINPUT: connected = wi::input::sdlinput::GetControllerState(&controller.state, controller.deviceIndex); break; -#ifdef PLATFORM_PS5 case Controller::PS5: +#ifdef PLATFORM_PS5 connected = wi::input::ps5::GetControllerState(&controller.state, controller.deviceIndex); - break; #endif // PLATFORM_PS5 + break; case Controller::DISCONNECTED: connected = false; break; @@ -1129,7 +1129,7 @@ namespace wi::input if (strcmp(str, "Numpad 9") == 0) return KEYBOARD_BUTTON_NUMPAD9; - if (str[0] >= DIGIT_RANGE_START && str[0] < GAMEPAD_RANGE_START) + if (str[0] >= DIGIT_RANGE_START /*&& str[0] < GAMEPAD_RANGE_START*/) { return (BUTTON)str[0]; } diff --git a/WickedEngine/wiPhysics_Jolt.cpp b/WickedEngine/wiPhysics_Jolt.cpp index 3335cd489..f0e8cf8e7 100644 --- a/WickedEngine/wiPhysics_Jolt.cpp +++ b/WickedEngine/wiPhysics_Jolt.cpp @@ -1929,6 +1929,10 @@ namespace wi::physics return; } break; + + // make Clang happy + case wi::scene::RigidBodyPhysicsComponent::ENUM_FORCE_UINT32: + JPH_ASSERT(false); } if (!shape_result.IsValid()) diff --git a/WickedEngine/wiVideo.cpp b/WickedEngine/wiVideo.cpp index 8ea6e47a6..59202ff6b 100644 --- a/WickedEngine/wiVideo.cpp +++ b/WickedEngine/wiVideo.cpp @@ -192,7 +192,7 @@ namespace wi::video int size = 0; int index = 0; const void* data = nullptr; - while (data = MP4D_read_sps(&mp4, ntrack, index, &size)) + while ((data = MP4D_read_sps(&mp4, ntrack, index, &size))) { const uint8_t* sps_data = (const uint8_t*)data; #ifdef DEBUG_DUMP_H264 @@ -236,7 +236,7 @@ namespace wi::video int size = 0; int index = 0; const void* data = nullptr; - while (data = MP4D_read_pps(&mp4, ntrack, index, &size)) + while ((data = MP4D_read_pps(&mp4, ntrack, index, &size))) { const uint8_t* pps_data = (const uint8_t*)data; #ifdef DEBUG_DUMP_H264