mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:17:34 +02:00
Fix refresh crash with ktx textures
This commit is contained in:
parent
7999ed6f60
commit
a886963e20
1 changed files with 9 additions and 1 deletions
|
@ -472,6 +472,10 @@ void NetworkTexture::startMipRangeRequest(uint16_t low, uint16_t high) {
|
||||||
void NetworkTexture::ktxHeaderRequestFinished() {
|
void NetworkTexture::ktxHeaderRequestFinished() {
|
||||||
Q_ASSERT(_ktxResourceState == LOADING_INITIAL_DATA);
|
Q_ASSERT(_ktxResourceState == LOADING_INITIAL_DATA);
|
||||||
|
|
||||||
|
if (!_ktxHeaderRequest) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_ktxHeaderRequestFinished = true;
|
_ktxHeaderRequestFinished = true;
|
||||||
maybeHandleFinishedInitialLoad();
|
maybeHandleFinishedInitialLoad();
|
||||||
}
|
}
|
||||||
|
@ -479,6 +483,10 @@ void NetworkTexture::ktxHeaderRequestFinished() {
|
||||||
void NetworkTexture::ktxMipRequestFinished() {
|
void NetworkTexture::ktxMipRequestFinished() {
|
||||||
Q_ASSERT(_ktxResourceState == LOADING_INITIAL_DATA || _ktxResourceState == REQUESTING_MIP);
|
Q_ASSERT(_ktxResourceState == LOADING_INITIAL_DATA || _ktxResourceState == REQUESTING_MIP);
|
||||||
|
|
||||||
|
if (!_ktxMipRequest) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_ktxResourceState == LOADING_INITIAL_DATA) {
|
if (_ktxResourceState == LOADING_INITIAL_DATA) {
|
||||||
_ktxHighMipRequestFinished = true;
|
_ktxHighMipRequestFinished = true;
|
||||||
maybeHandleFinishedInitialLoad();
|
maybeHandleFinishedInitialLoad();
|
||||||
|
@ -683,7 +691,7 @@ void NetworkTexture::loadContent(const QByteArray& content) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkTexture::refresh() {
|
void NetworkTexture::refresh() {
|
||||||
if ((_ktxHeaderRequest || _ktxMipRequest) && !loaded && !_failedToLoad) {
|
if ((_ktxHeaderRequest || _ktxMipRequest) && !_loaded && !_failedToLoad) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_ktxHeaderRequest || _ktxMipRequest) {
|
if (_ktxHeaderRequest || _ktxMipRequest) {
|
||||||
|
|
Loading…
Reference in a new issue