mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 10:28:22 +02:00
Merge pull request #8708 from samcake/color
Fix the crash on start up if default ambient map fails to load
This commit is contained in:
commit
f84f98f804
2 changed files with 8 additions and 5 deletions
|
@ -2170,7 +2170,7 @@ bool Application::event(QEvent* event) {
|
||||||
// handle custom URL
|
// handle custom URL
|
||||||
if (event->type() == QEvent::FileOpen) {
|
if (event->type() == QEvent::FileOpen) {
|
||||||
|
|
||||||
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
|
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
|
||||||
|
|
||||||
QUrl url = fileEvent->url();
|
QUrl url = fileEvent->url();
|
||||||
|
|
||||||
|
@ -4361,8 +4361,13 @@ namespace render {
|
||||||
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
auto scene = DependencyManager::get<SceneScriptingInterface>()->getStage();
|
||||||
auto sceneKeyLight = scene->getKeyLight();
|
auto sceneKeyLight = scene->getKeyLight();
|
||||||
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
|
auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture();
|
||||||
sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
|
if (defaultSkyboxAmbientTexture) {
|
||||||
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance());
|
||||||
|
sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture);
|
||||||
|
} else {
|
||||||
|
static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex(
|
||||||
|
"Failed to get a valid Default Skybox Ambient Texture ? probably because it couldn't be find during initialization step");
|
||||||
|
}
|
||||||
// fall through: render defaults skybox
|
// fall through: render defaults skybox
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -511,9 +511,7 @@ void GL45Texture::stripToMip(uint16_t newMinMip) {
|
||||||
_minMip = newMinMip;
|
_minMip = newMinMip;
|
||||||
// Re-sync the sampler to force access to the new mip level
|
// Re-sync the sampler to force access to the new mip level
|
||||||
syncSampler();
|
syncSampler();
|
||||||
size_t oldSize = _size;
|
|
||||||
updateSize();
|
updateSize();
|
||||||
Q_ASSERT(_size > oldSize);
|
|
||||||
|
|
||||||
|
|
||||||
// Re-insert into the texture-by-mips map if appropriate
|
// Re-insert into the texture-by-mips map if appropriate
|
||||||
|
|
Loading…
Reference in a new issue