mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
remove warnings from linux build
This commit is contained in:
parent
d0db56a4a6
commit
614fad0811
10 changed files with 27 additions and 30 deletions
|
@ -105,6 +105,8 @@ bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
|||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -141,4 +143,4 @@ bool OpenGLDisplayPlugin::isVsyncEnabled() {
|
|||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ void StereoDisplayPlugin::activate() {
|
|||
}
|
||||
|
||||
void StereoDisplayPlugin::updateScreen() {
|
||||
for (int i = 0; i < _screenActions.size(); ++i) {
|
||||
for (uint32_t i = 0; i < _screenActions.size(); ++i) {
|
||||
if (_screenActions[i]->isChecked()) {
|
||||
CONTAINER->setFullscreen(qApp->screens().at(i));
|
||||
break;
|
||||
|
|
|
@ -131,20 +131,20 @@ void ParticleEffectEntityItem::computeAndUpdateDimensions() {
|
|||
|
||||
float maxVelocityX = fabsf(_velocity.x) + _velocitySpread.x;
|
||||
float maxAccelerationX = fabsf(_acceleration.x) + _accelerationSpread.x;
|
||||
float maxXDistance = (maxVelocityX * time) + (0.5 * maxAccelerationX * time * time);
|
||||
float maxXDistance = (maxVelocityX * time) + (0.5f * maxAccelerationX * time * time);
|
||||
|
||||
float maxVelocityY = fabs(_velocity.y) + _velocitySpread.y;
|
||||
float maxVelocityY = fabsf(_velocity.y) + _velocitySpread.y;
|
||||
float maxAccelerationY = fabsf(_acceleration.y) + _accelerationSpread.y;
|
||||
float maxYDistance = (maxVelocityY * time) + (0.5 * maxAccelerationY * time * time);
|
||||
float maxYDistance = (maxVelocityY * time) + (0.5f * maxAccelerationY * time * time);
|
||||
|
||||
float maxVelocityZ = fabsf(_velocity.z) + _velocitySpread.z;
|
||||
float maxAccelerationZ = fabsf(_acceleration.z) + _accelerationSpread.z;
|
||||
float maxZDistance = (maxVelocityZ * time) + (0.5 * maxAccelerationZ * time * time);
|
||||
float maxZDistance = (maxVelocityZ * time) + (0.5f * maxAccelerationZ * time * time);
|
||||
|
||||
float maxDistance = std::max(maxXDistance, std::max(maxYDistance, maxZDistance));
|
||||
|
||||
//times 2 because dimensions are diameters not radii
|
||||
glm::vec3 dims(2.0 * maxDistance);
|
||||
glm::vec3 dims(2.0f * maxDistance);
|
||||
EntityItem::setDimensions(dims);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ void GLBackend::do_setViewportTransform(Batch& batch, uint32 paramOffset) {
|
|||
if (_stereo._pass) {
|
||||
vp.x += vp.z;
|
||||
}
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
glViewport(vp.x, vp.y, vp.z, vp.w);
|
||||
|
|
|
@ -230,7 +230,7 @@ void UserInputMapper::update(float deltaTime) {
|
|||
for (auto i = 0; i < NUM_ACTIONS; i++) {
|
||||
_actionStates[i] *= _actionScales[i];
|
||||
// Emit only on change, and emit when moving back to 0
|
||||
if (fabs(_actionStates[i] - _lastActionStates[i]) > EPSILON) {
|
||||
if (fabsf(_actionStates[i] - _lastActionStates[i]) > EPSILON) {
|
||||
_lastActionStates[i] = _actionStates[i];
|
||||
emit actionEvent(i, _actionStates[i]);
|
||||
}
|
||||
|
@ -319,4 +319,4 @@ void UserInputMapper::createActionNames() {
|
|||
_actionNames[SHIFT] = "SHIFT";
|
||||
_actionNames[ACTION1] = "ACTION1";
|
||||
_actionNames[ACTION2] = "ACTION2";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ void AmbientOcclusion::run(const render::SceneContextPointer& sceneContext, cons
|
|||
batch._glUniform2f(_depthTexCoordScaleLoc, depthTexCoordScaleS, depthTexCoordScaleT);
|
||||
|
||||
batch._glUniform2f(_renderTargetResLoc, fbWidth, fbHeight);
|
||||
batch._glUniform2f(_renderTargetResInvLoc, 1.0/fbWidth, 1.0/fbHeight);
|
||||
batch._glUniform2f(_renderTargetResInvLoc, 1.0f / fbWidth, 1.0f / fbHeight);
|
||||
|
||||
glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glm::vec2 bottomLeft(-1.0f, -1.0f);
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include "WebSocketServerClass.h"
|
||||
|
||||
WebSocketServerClass::WebSocketServerClass(QScriptEngine* engine, const QString& serverName, const quint16 port) :
|
||||
_engine(engine),
|
||||
_webSocketServer(serverName, QWebSocketServer::SslMode::NonSecureMode)
|
||||
_webSocketServer(serverName, QWebSocketServer::SslMode::NonSecureMode),
|
||||
_engine(engine)
|
||||
{
|
||||
if (_webSocketServer.listen(QHostAddress::Any, port)) {
|
||||
connect(&_webSocketServer, &QWebSocketServer::newConnection, this, &WebSocketServerClass::onNewConnection);
|
||||
|
|
|
@ -372,41 +372,37 @@ QRectF glmToRect(const glm::vec2 & pos, const glm::vec2 & size) {
|
|||
// create matrix from orientation and position
|
||||
glm::mat4 createMatFromQuatAndPos(const glm::quat& q, const glm::vec3& p) {
|
||||
glm::mat4 m = glm::mat4_cast(q);
|
||||
m[3] = glm::vec4(p, 1);
|
||||
m[3] = glm::vec4(p, 1.0f);
|
||||
return m;
|
||||
}
|
||||
|
||||
// cancel out roll and pitch
|
||||
glm::quat cancelOutRollAndPitch(const glm::quat& q) {
|
||||
glm::vec3 xAxis = q * glm::vec3(1, 0, 0);
|
||||
glm::vec3 yAxis = q * glm::vec3(0, 1, 0);
|
||||
glm::vec3 zAxis = q * glm::vec3(0, 0, 1);
|
||||
glm::vec3 zAxis = q * glm::vec3(0.0f, 0.0f, 1.0f);
|
||||
|
||||
// cancel out the roll and pitch
|
||||
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0) ? vec3(1, 0, 0) : glm::normalize(vec3(zAxis.x, 0, zAxis.z));
|
||||
glm::vec3 newX = glm::cross(vec3(0, 1, 0), newZ);
|
||||
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0.0f) ? vec3(1.0f, 0.0f, 0.0f) : glm::normalize(vec3(zAxis.x, 0.0f, zAxis.z));
|
||||
glm::vec3 newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
|
||||
glm::vec3 newY = glm::cross(newZ, newX);
|
||||
|
||||
glm::mat4 temp(glm::vec4(newX, 0), glm::vec4(newY, 0), glm::vec4(newZ, 0), glm::vec4(0, 0, 0, 1));
|
||||
glm::mat4 temp(glm::vec4(newX, 0.0f), glm::vec4(newY, 0.0f), glm::vec4(newZ, 0.0f), glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
return glm::quat_cast(temp);
|
||||
}
|
||||
|
||||
// cancel out roll and pitch
|
||||
glm::mat4 cancelOutRollAndPitch(const glm::mat4& m) {
|
||||
glm::vec3 xAxis = glm::vec3(m[0]);
|
||||
glm::vec3 yAxis = glm::vec3(m[1]);
|
||||
glm::vec3 zAxis = glm::vec3(m[2]);
|
||||
|
||||
// cancel out the roll and pitch
|
||||
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0) ? vec3(1, 0, 0) : glm::normalize(vec3(zAxis.x, 0, zAxis.z));
|
||||
glm::vec3 newX = glm::cross(vec3(0, 1, 0), newZ);
|
||||
glm::vec3 newZ = (zAxis.x == 0.0f && zAxis.z == 0.0f) ? vec3(1.0f, 0.0f, 0.0f) : glm::normalize(vec3(zAxis.x, 0.0f, zAxis.z));
|
||||
glm::vec3 newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
|
||||
glm::vec3 newY = glm::cross(newZ, newX);
|
||||
|
||||
glm::mat4 temp(glm::vec4(newX, 0), glm::vec4(newY, 0), glm::vec4(newZ, 0), m[3]);
|
||||
glm::mat4 temp(glm::vec4(newX, 0.0f), glm::vec4(newY, 0.0f), glm::vec4(newZ, 0.0f), m[3]);
|
||||
return temp;
|
||||
}
|
||||
|
||||
glm::vec3 transformPoint(const glm::mat4& m, const glm::vec3& p) {
|
||||
glm::vec4 temp = m * glm::vec4(p, 1);
|
||||
glm::vec4 temp = m * glm::vec4(p, 1.0f);
|
||||
return glm::vec3(temp.x / temp.w, temp.y / temp.w, temp.z / temp.w);
|
||||
}
|
||||
|
|
|
@ -93,8 +93,8 @@ template <typename T>
|
|||
void testByteCountCoded() {
|
||||
testByteCountCodedStable<T>(0);
|
||||
testByteCountCodedStable<T>(1);
|
||||
testByteCountCodedStable<T>(1 << 16);
|
||||
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 16);
|
||||
testByteCountCodedStable<T>(1 << 8*sizeof(T));
|
||||
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
|
||||
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8);
|
||||
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 1);
|
||||
testByteCountCodedStable<T>(std::numeric_limits<T>::max());
|
||||
|
|
|
@ -342,8 +342,8 @@ public:
|
|||
glm::vec3 unitscale { 1.0f };
|
||||
glm::vec3 up { 0.0f, 1.0f, 0.0f };
|
||||
|
||||
glm::vec3 cam_pos { 1.5f * sin(t), 0.0f, 2.0f };
|
||||
// glm::vec3 camera_focus { 5.0f * cos(t * 0.1f), 0.0f, 0.0f };
|
||||
glm::vec3 cam_pos { 1.5f * sinf(t), 0.0f, 2.0f };
|
||||
// glm::vec3 camera_focus { 5.0f * cosf(t * 0.1f), 0.0f, 0.0f };
|
||||
glm::vec3 camera_focus { 0.0f, 0.0f, 0.0f };
|
||||
glm::quat cam_rotation;
|
||||
// glm::quat cam_rotation = glm::quat_cast(glm::lookAt(cam_pos, camera_focus, up));
|
||||
|
|
Loading…
Reference in a new issue