mirror of https://github.com/qt/qt3d.git
Fix compile warnings
Change-Id: Iac24c13fa77bb0c6317af77f61016ee6fbf9a916 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
parent
222c7f3c57
commit
ee7dd0b8ec
|
|
@ -51,16 +51,16 @@ static QVector4D vec4dFromColor(const QColor &color)
|
|||
{
|
||||
if (!color.isValid())
|
||||
return QVector4D(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
return QVector4D(color.redF(), color.greenF(), color.blueF(), color.alphaF());
|
||||
return QVector4D(float(color.redF()), float(color.greenF()), float(color.blueF()), float(color.alphaF()));
|
||||
}
|
||||
|
||||
ClearBuffers::ClearBuffers()
|
||||
: FrameGraphNode(FrameGraphNode::ClearBuffers)
|
||||
, m_type(QClearBuffers::None)
|
||||
, m_clearColor(vec4dFromColor(m_clearColorAsColor))
|
||||
, m_clearColorAsColor(Qt::black)
|
||||
, m_clearDepthValue(1.f)
|
||||
, m_clearStencilValue(0)
|
||||
, m_clearColorAsColor(Qt::black)
|
||||
, m_clearColor(vec4dFromColor(m_clearColorAsColor))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ void ClearBuffers::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
|
|||
markDirty(AbstractRenderer::FrameGraphDirty);
|
||||
}
|
||||
|
||||
if (m_clearDepthValue != node->clearDepthValue()) {
|
||||
if (!qFuzzyCompare(m_clearDepthValue, node->clearDepthValue())) {
|
||||
m_clearDepthValue = node->clearDepthValue();
|
||||
markDirty(AbstractRenderer::FrameGraphDirty);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,17 +251,17 @@ void QRenderSurfaceSelector::setSurface(QObject *surfaceObject)
|
|||
d->m_surfaceEventFilter->setSurface(window);
|
||||
|
||||
if (window) {
|
||||
d->m_widthConn = QObject::connect(window, &QWindow::widthChanged, [=] (int width) {
|
||||
d->m_widthConn = QObject::connect(window, &QWindow::widthChanged, [=] (int) {
|
||||
d->update();
|
||||
});
|
||||
d->m_heightConn = QObject::connect(window, &QWindow::heightChanged, [=] (int height) {
|
||||
d->m_heightConn = QObject::connect(window, &QWindow::heightChanged, [=] (int) {
|
||||
d->update();
|
||||
});
|
||||
d->m_screenConn = QObject::connect(window, &QWindow::screenChanged, [=] (QScreen *screen) {
|
||||
if (screen && surfacePixelRatio() != screen->devicePixelRatio())
|
||||
setSurfacePixelRatio(screen->devicePixelRatio());
|
||||
if (screen && !qFuzzyCompare(surfacePixelRatio(), float(screen->devicePixelRatio())))
|
||||
setSurfacePixelRatio(float(screen->devicePixelRatio()));
|
||||
});
|
||||
setSurfacePixelRatio(window->devicePixelRatio());
|
||||
setSurfacePixelRatio(float(window->devicePixelRatio()));
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -291,7 +291,7 @@ QSize QRenderSurfaceSelector::externalRenderTargetSize() const
|
|||
void QRenderSurfaceSelector::setSurfacePixelRatio(float ratio)
|
||||
{
|
||||
Q_D(QRenderSurfaceSelector);
|
||||
if (d->m_surfacePixelRatio == ratio)
|
||||
if (qFuzzyCompare(d->m_surfacePixelRatio, ratio))
|
||||
return;
|
||||
d->m_surfacePixelRatio = ratio;
|
||||
emit surfacePixelRatioChanged(ratio);
|
||||
|
|
|
|||
|
|
@ -462,8 +462,8 @@ private slots:
|
|||
Qt3DCore::QEntity frontendEntityA, frontendEntityB, frontendEntityC;
|
||||
|
||||
auto backendA = createEntity(renderer, nodeManagers, frontendEntityA);
|
||||
auto backendB = createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
auto backendC = createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
|
||||
auto sendParentChange = [&nodeManagers](const Qt3DCore::QEntity &entity) {
|
||||
Entity *backendEntity = nodeManagers.renderNodesManager()->getOrCreateResource(entity.id());
|
||||
|
|
@ -497,8 +497,8 @@ private slots:
|
|||
frontendEntityC.setEnabled(false);
|
||||
|
||||
auto backendA = createEntity(renderer, nodeManagers, frontendEntityA);
|
||||
auto backendB = createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
auto backendC = createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
|
||||
auto sendParentChange = [&nodeManagers](const Qt3DCore::QEntity &entity) {
|
||||
Entity *backendEntity = nodeManagers.renderNodesManager()->getOrCreateResource(entity.id());
|
||||
|
|
@ -538,8 +538,8 @@ private slots:
|
|||
frontendEntityC.setEnabled(false);
|
||||
|
||||
auto backendA = createEntity(renderer, nodeManagers, frontendEntityA);
|
||||
auto backendB = createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
auto backendC = createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
createEntity(renderer, nodeManagers, frontendEntityB);
|
||||
createEntity(renderer, nodeManagers, frontendEntityC);
|
||||
|
||||
auto sendParentChange = [&nodeManagers](const Qt3DCore::QEntity &entity) {
|
||||
Entity *backendEntity = nodeManagers.renderNodesManager()->getOrCreateResource(entity.id());
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ private Q_SLOTS:
|
|||
// WHEN
|
||||
const bool newValue = false;
|
||||
proximityFilter.setEnabled(newValue);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, &backendProximityFilter);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, false);
|
||||
|
||||
// THEN
|
||||
QCOMPARE(backendProximityFilter.isEnabled(), newValue);
|
||||
|
|
@ -113,7 +113,7 @@ private Q_SLOTS:
|
|||
// WHEN
|
||||
const float newValue = 383.0f;
|
||||
proximityFilter.setDistanceThreshold(newValue);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, &backendProximityFilter);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, false);
|
||||
|
||||
|
||||
// THEN
|
||||
|
|
@ -125,7 +125,7 @@ private Q_SLOTS:
|
|||
// WHEN
|
||||
Qt3DCore::QEntity e;
|
||||
proximityFilter.setEntity(&e);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, &backendProximityFilter);
|
||||
backendProximityFilter.syncFromFrontEnd(&proximityFilter, false);
|
||||
|
||||
// THEN
|
||||
QCOMPARE(backendProximityFilter.entityId(), e.id());
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
TessellatedGeometry(Qt3DCore::QNode *parent = nullptr)
|
||||
: Qt3DRender::QGeometry(parent)
|
||||
, m_positionAttribute(new Qt3DRender::QAttribute(this))
|
||||
, m_vertexBuffer(new Qt3DRender::QBuffer(Qt3DRender::QBuffer::VertexBuffer, this))
|
||||
, m_vertexBuffer(new Qt3DRender::QBuffer(this))
|
||||
{
|
||||
const float positionData[] = {
|
||||
-0.8f, -0.8f, 0.0f,
|
||||
|
|
|
|||
Loading…
Reference in New Issue