Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 4 files). Show all
Unified · Split
| @@ -121,18 +121,18 @@ GLuint TextureCache::getFileTextureID(const QString& filename) { · 120 unmodified lines | ||
| 121 | 121 | return id; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | −QSharedPointer<NetworkTexture> TextureCache::getTexture(const QUrl& url, bool dilatable) { | |
| 124 | +QSharedPointer<NetworkTexture> TextureCache::getTexture(const QUrl& url, bool normalMap, bool dilatable) { | |
| 125 | 125 | QSharedPointer<NetworkTexture> texture; |
| 126 | 126 | if (dilatable) { |
| 127 | 127 | texture = _dilatableNetworkTextures.value(url); |
| 128 | 128 | if (texture.isNull()) { |
| 129 | − texture = QSharedPointer<NetworkTexture>(new DilatableNetworkTexture(url)); | |
| 129 | + texture = QSharedPointer<NetworkTexture>(new DilatableNetworkTexture(url, normalMap)); | |
| 130 | 130 | _dilatableNetworkTextures.insert(url, texture); |
| 131 | 131 | } |
| 132 | 132 | } else { |
| 133 | 133 | texture = _networkTextures.value(url); |
| 134 | 134 | if (texture.isNull()) { |
| 135 | − texture = QSharedPointer<NetworkTexture>(new NetworkTexture(url)); | |
| 135 | + texture = QSharedPointer<NetworkTexture>(new NetworkTexture(url, normalMap)); | |
| 136 | 136 | _networkTextures.insert(url, texture); |
| 137 | 137 | } |
| 138 | 138 | } |
| @@ -219,7 +219,7 @@ Texture::~Texture() { · 80 unmodified lines | ||
| 219 | 219 | glDeleteTextures(1, &_id); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | −NetworkTexture::NetworkTexture(const QUrl& url) : _reply(NULL), _averageColor(1.0f, 1.0f, 1.0f, 1.0f) { | |
| 222 | +NetworkTexture::NetworkTexture(const QUrl& url, bool normalMap) : _reply(NULL), _averageColor(1.0f, 1.0f, 1.0f, 1.0f) { | |
| 223 | 223 | if (!url.isValid()) { |
| 224 | 224 | return; |
| 225 | 225 | } |
| @@ -230,9 +230,9 @@ NetworkTexture::NetworkTexture(const QUrl& url) : _reply(NULL), _averageColor(1. · 4 unmodified lines | ||
| 230 | 230 | connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(handleDownloadProgress(qint64,qint64))); |
| 231 | 231 | connect(_reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(handleReplyError())); |
| 232 | 232 | |
| 233 | − // default to white | |
| 233 | + // default to white/blue | |
| 234 | 234 | glBindTexture(GL_TEXTURE_2D, getID()); |
| 235 | − loadSingleColorTexture(OPAQUE_WHITE); | |
| 235 | + loadSingleColorTexture(normalMap ? OPAQUE_BLUE : OPAQUE_WHITE); | |
| 236 | 236 | glBindTexture(GL_TEXTURE_2D, 0); |
| 237 | 237 | } |
| 238 | 238 | |
| @@ -288,8 +288,8 @@ void NetworkTexture::handleReplyError() { · 49 unmodified lines | ||
| 288 | 288 | _reply = NULL; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | −DilatableNetworkTexture::DilatableNetworkTexture(const QUrl& url) : | |
| 292 | − NetworkTexture(url), | |
| 291 | +DilatableNetworkTexture::DilatableNetworkTexture(const QUrl& url, bool normalMap) : | |
| 292 | + NetworkTexture(url, normalMap), | |
| 293 | 293 | _innerRadius(0), |
| 294 | 294 | _outerRadius(0) |
| 295 | 295 | { |