mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 03:53:34 +02:00
handle 16 byte hash while reading in TextureCache
This commit is contained in:
parent
3c5754282f
commit
e708a71b64
1 changed files with 5 additions and 2 deletions
|
@ -559,13 +559,16 @@ void NetworkTexture::maybeHandleFinishedInitialLoad() {
|
|||
});
|
||||
std::string filename;
|
||||
std::string hash;
|
||||
if (found == keyValues.end() || found->_value.size() != 32) {
|
||||
if (found == keyValues.end() || found->_value.size() != gpu::SOURCE_HASH_BYTES) {
|
||||
qWarning("Invalid source hash key found, bailing");
|
||||
_ktxResourceState = FAILED_TO_LOAD;
|
||||
finishedLoading(false);
|
||||
return;
|
||||
} else {
|
||||
hash = filename = std::string(reinterpret_cast<char*>(found->_value.data()), 32);
|
||||
// at this point the source hash is in binary 16-byte form
|
||||
// and we need it in a hexadecimal string
|
||||
auto binaryHash = QByteArray(reinterpret_cast<char*>(found->_value.data()), gpu::SOURCE_HASH_BYTES);
|
||||
hash = filename = binaryHash.toHex().toStdString();
|
||||
}
|
||||
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
|
|
Loading…
Reference in a new issue