mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Keep normal and dilatable textures in separate maps to fix crash on manly
"man" model.
This commit is contained in:
parent
8631cc3264
commit
6a265eacf2
2 changed files with 15 additions and 5 deletions
|
@ -107,10 +107,19 @@ GLuint TextureCache::getFileTextureID(const QString& filename) {
|
|||
}
|
||||
|
||||
QSharedPointer<NetworkTexture> TextureCache::getTexture(const QUrl& url, bool dilatable) {
|
||||
QSharedPointer<NetworkTexture> texture = _networkTextures.value(url);
|
||||
if (texture.isNull()) {
|
||||
texture = QSharedPointer<NetworkTexture>(dilatable ? new DilatableNetworkTexture(url) : new NetworkTexture(url));
|
||||
_networkTextures.insert(url, texture);
|
||||
QSharedPointer<NetworkTexture> texture;
|
||||
if (dilatable) {
|
||||
texture = _dilatableNetworkTextures.value(url);
|
||||
if (texture.isNull()) {
|
||||
texture = QSharedPointer<NetworkTexture>(new DilatableNetworkTexture(url));
|
||||
_dilatableNetworkTextures.insert(url, texture);
|
||||
}
|
||||
} else {
|
||||
texture = _networkTextures.value(url);
|
||||
if (texture.isNull()) {
|
||||
texture = QSharedPointer<NetworkTexture>(new NetworkTexture(url));
|
||||
_networkTextures.insert(url, texture);
|
||||
}
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,8 @@ private:
|
|||
QHash<QString, GLuint> _fileTextureIDs;
|
||||
|
||||
QHash<QUrl, QWeakPointer<NetworkTexture> > _networkTextures;
|
||||
|
||||
QHash<QUrl, QWeakPointer<NetworkTexture> > _dilatableNetworkTextures;
|
||||
|
||||
GLuint _primaryDepthTextureID;
|
||||
QOpenGLFramebufferObject* _primaryFramebufferObject;
|
||||
QOpenGLFramebufferObject* _secondaryFramebufferObject;
|
||||
|
|
Loading…
Reference in a new issue