clement's comments from PR14858

This commit is contained in:
SamGondelman 2019-02-12 09:51:11 -08:00
parent d2ecc21f0b
commit 189ccfde4a
8 changed files with 19 additions and 20 deletions

View file

@ -41,7 +41,7 @@ QSharedPointer<Resource> AnimationCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> AnimationCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new Animation(*resource.staticCast<Animation>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new Animation(*resource.staticCast<Animation>()), &Resource::deleter);
}
AnimationReader::AnimationReader(const QUrl& url, const QByteArray& data) :

View file

@ -40,5 +40,5 @@ QSharedPointer<Resource> SoundCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> SoundCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new Sound(*resource.staticCast<Sound>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new Sound(*resource.staticCast<Sound>()), &Resource::deleter);
}

View file

@ -425,7 +425,7 @@ QSharedPointer<Resource> MaterialCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> MaterialCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new NetworkMaterialResource(*resource.staticCast<NetworkMaterialResource>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new NetworkMaterialResource(*resource.staticCast<NetworkMaterialResource>()), &Resource::deleter);
}
NetworkMaterial::NetworkMaterial(const NetworkMaterial& m) :

View file

@ -29,5 +29,5 @@ QSharedPointer<Resource> ShaderCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> ShaderCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new NetworkShader(*resource.staticCast<NetworkShader>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new NetworkShader(*resource.staticCast<NetworkShader>()), &Resource::deleter);
}

View file

@ -197,16 +197,16 @@ public:
namespace std {
template <>
struct hash<QByteArray> {
size_t operator()(const QByteArray& a) const {
return qHash(a);
size_t operator()(const QByteArray& byteArray) const {
return qHash(byteArray);
}
};
template <>
struct hash<TextureExtra> {
size_t operator()(const TextureExtra& a) const {
size_t operator()(const TextureExtra& textureExtra) const {
size_t result = 0;
hash_combine(result, (int)a.type, a.content, a.maxNumPixels);
hash_combine(result, (int)textureExtra.type, textureExtra.content, textureExtra.maxNumPixels);
return result;
}
};
@ -328,14 +328,13 @@ QSharedPointer<Resource> TextureCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> TextureCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new NetworkTexture(*resource.staticCast<NetworkTexture>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new NetworkTexture(*resource.staticCast<NetworkTexture>()), &Resource::deleter);
}
int networkTexturePointerMetaTypeId = qRegisterMetaType<QWeakPointer<NetworkTexture>>();
NetworkTexture::NetworkTexture(const QUrl& url, bool resourceTexture) :
Resource(url),
_maxNumPixels(100)
Resource(url)
{
if (resourceTexture) {
_textureSource = std::make_shared<gpu::TextureSource>(url);

View file

@ -76,9 +76,9 @@ namespace std {
template <>
struct hash<GeometryExtra> {
size_t operator()(const GeometryExtra& a) const {
size_t operator()(const GeometryExtra& geometryExtra) const {
size_t result = 0;
hash_combine(result, a.mapping, a.textureBaseUrl, a.combineParts);
hash_combine(result, geometryExtra.mapping, geometryExtra.textureBaseUrl, geometryExtra.combineParts);
return result;
}
};
@ -394,7 +394,7 @@ QSharedPointer<Resource> ModelCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> ModelCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new GeometryDefinitionResource(*resource.staticCast<GeometryDefinitionResource>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new GeometryDefinitionResource(*resource.staticCast<GeometryDefinitionResource>()), &Resource::deleter);
}
GeometryResource::Pointer ModelCache::getGeometryResource(const QUrl& url,

View file

@ -489,14 +489,14 @@ protected:
QWeakPointer<Resource> _self;
QPointer<ResourceCache> _cache;
qint64 _bytesReceived{ 0 };
qint64 _bytesTotal{ 0 };
qint64 _bytes{ 0 };
qint64 _bytesReceived { 0 };
qint64 _bytesTotal { 0 };
qint64 _bytes { 0 };
int _requestID;
ResourceRequest* _request{ nullptr };
ResourceRequest* _request { nullptr };
size_t _extraHash;
size_t _extraHash { std::numeric_limits<size_t>::max() };
public slots:
void handleDownloadProgress(uint64_t bytesReceived, uint64_t bytesTotal);

View file

@ -54,5 +54,5 @@ QSharedPointer<Resource> ClipCache::createResource(const QUrl& url) {
}
QSharedPointer<Resource> ClipCache::createResourceCopy(const QSharedPointer<Resource>& resource) {
return QSharedPointer<Resource>(new NetworkClipLoader(*resource.staticCast<NetworkClipLoader>().data()), &Resource::deleter);
return QSharedPointer<Resource>(new NetworkClipLoader(*resource.staticCast<NetworkClipLoader>()), &Resource::deleter);
}