Commit 448297d2 authored by Sergey Galin's avatar Sergey Galin

Merge branch 'feature/fix_warnings' into 'master'

Fix warnings

See merge request !75
parents 0b430a1f dac0eb97
......@@ -168,14 +168,14 @@ public:
virtual bool seek(qint64 pos)
{
if (m_assetFile)
return pos == AAsset_seek(m_assetFile, pos, SEEK_SET);
return pos == AAsset_seek(m_assetFile, static_cast<off_t>(pos), SEEK_SET);
return false;
}
virtual qint64 read(char *data, qint64 maxlen)
{
if (m_assetFile)
return AAsset_read(m_assetFile, data, maxlen);
return AAsset_read(m_assetFile, data, static_cast<size_t>(maxlen));
return -1;
}
......@@ -288,7 +288,7 @@ void AndroidAssetsFileEngineHandler::prepopulateCache() const
qint64 size = fileEngine.size();
if (size <= maxPrepopulatedCacheSize) {
QByteArray bytes(size, Qt::Uninitialized);
QByteArray bytes(static_cast<int>(size), Qt::Uninitialized);
qint64 read = fileEngine.read(bytes.data(), size);
if (read != size) {
qWarning("Failed to read prepopulated cache");
......
......@@ -231,25 +231,25 @@ void QOpenGLTextureHolder::blitTexture(const QRect & targetRect, const QRect & s
// vertices by the pmv matrix, so we need to do the effect
// of the orthographic projection here ourselves.
QRectF r;
qreal w = targetRect.width();
qreal h = targetRect.height();
r.setLeft((targetRect.left() / w) * 2.0f - 1.0f);
qreal w = static_cast<qreal>(targetRect.width());
qreal h = static_cast<qreal>(targetRect.height());
r.setLeft((static_cast<qreal>(targetRect.left()) / w) * 2.0f - 1.0f);
if (targetRect.right() == (targetRect.width() - 1))
{
r.setRight(1.0f);
}
else
{
r.setRight((targetRect.right() / w) * 2.0f - 1.0f);
r.setRight((static_cast<qreal>(targetRect.right()) / w) * 2.0f - 1.0f);
}
r.setBottom((targetRect.top() / h) * 2.0f - 1.0f);
r.setBottom((static_cast<qreal>(targetRect.top()) / h) * 2.0f - 1.0f);
if (targetRect.bottom() == (targetRect.height() - 1))
{
r.setTop(1.0f);
}
else
{
r.setTop((targetRect.bottom() / w) * 2.0f - 1.0f);
r.setTop((static_cast<qreal>(targetRect.bottom()) / w) * 2.0f - 1.0f);
}
drawTexture(r, sourceRect, reverse_y);
blitProgram->release();
......@@ -289,12 +289,14 @@ void QOpenGLTextureHolder::drawTexture(const QRectF & rect, const QRectF & bitma
// Using a piece of texture
: QRectF(
// (Reverse Y axis)
QPointF(bitmap_rect.x(), texture_size_.height() - bitmap_rect.bottom())
, bitmap_rect.size());
QPointF(
bitmap_rect.x()
, static_cast<qreal>(texture_size_.height()) - bitmap_rect.bottom())
, bitmap_rect.size());
// Convert in-texture coords to [0..1]
qreal width = texture_size_.width();
qreal height = texture_size_.height();
qreal width = static_cast<qreal>(texture_size_.width());
qreal height = static_cast<qreal>(texture_size_.height());
GLfloat tx1 = src.left() / width;
GLfloat tx2 = src.right() / width;
......@@ -423,7 +425,7 @@ void QOpenGLTextureHolder::allocateTexture(const QImage & qimage, GLenum texture
// Create texture and load bits into its memory
glGenTextures(1, &texture_id_);
glBindTexture(texture_type, texture_id_);
glTexImage2D(texture_type, 0, type, width, height, 0, type, pixel_type, bits);
glTexImage2D(texture_type, 0, static_cast<GLint>(type), width, height, 0, type, pixel_type, bits);
glTexParameteri(texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(texture_type, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment