| @@ -1,18 +1,20 @@ | | | @@ -1,18 +1,20 @@ |
1 | $NetBSD: patch-src_quick3dparticles_qquick3dparticleemitter.cpp,v 1.1 2023/02/01 19:36:37 wiz Exp $ | | 1 | $NetBSD: patch-src_quick3dparticles_qquick3dparticleemitter.cpp,v 1.2 2023/02/01 22:01:44 wiz Exp $ |
2 | | | 2 | |
3 | Fix | | 3 | Fix |
4 | qquick3dparticleemitter.cpp:723:84: error: no matching function for call to 'min(float, __gnu_cxx::__enable_if<true, double>::__type)' | | 4 | qquick3dparticleemitter.cpp:723:84: error: no matching function for call to 'min(float, __gnu_cxx::__enable_if<true, double>::__type)' |
5 | | | 5 | |
| | | 6 | https://bugreports.qt.io/browse/QTBUG-110870 |
| | | 7 | |
6 | --- src/quick3dparticles/qquick3dparticleemitter.cpp.orig 2022-11-08 19:27:13.000000000 +0000 | | 8 | --- src/quick3dparticles/qquick3dparticleemitter.cpp.orig 2022-11-08 19:27:13.000000000 +0000 |
7 | +++ src/quick3dparticles/qquick3dparticleemitter.cpp | | 9 | +++ src/quick3dparticles/qquick3dparticleemitter.cpp |
8 | @@ -716,11 +716,11 @@ void QQuick3DParticleEmitter::emitPartic | | 10 | @@ -716,11 +716,11 @@ void QQuick3DParticleEmitter::emitPartic |
9 | // max value 127*127 = 16129 degrees/second | | 11 | // max value 127*127 = 16129 degrees/second |
10 | float sign; | | 12 | float sign; |
11 | sign = rotVelX < 0.0f ? -1.0f : 1.0f; | | 13 | sign = rotVelX < 0.0f ? -1.0f : 1.0f; |
12 | - rotVelX = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelX)))); | | 14 | - rotVelX = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelX)))); |
13 | + rotVelX = std::max(-127.0f, std::min<float>(127.0f, sign * std::sqrt(abs(rotVelX)))); | | 15 | + rotVelX = std::max(-127.0f, std::min<float>(127.0f, sign * std::sqrt(abs(rotVelX)))); |
14 | sign = rotVelY < 0.0f ? -1.0f : 1.0f; | | 16 | sign = rotVelY < 0.0f ? -1.0f : 1.0f; |
15 | - rotVelY = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelY)))); | | 17 | - rotVelY = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelY)))); |
16 | + rotVelY = std::max(-127.0f, std::min<float>(127.0f, sign * std::sqrt(abs(rotVelY)))); | | 18 | + rotVelY = std::max(-127.0f, std::min<float>(127.0f, sign * std::sqrt(abs(rotVelY)))); |
17 | sign = rotVelZ < 0.0f ? -1.0f : 1.0f; | | 19 | sign = rotVelZ < 0.0f ? -1.0f : 1.0f; |
18 | - rotVelZ = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelZ)))); | | 20 | - rotVelZ = std::max(-127.0f, std::min(127.0f, sign * std::sqrt(abs(rotVelZ)))); |