Skip to content

Commit b78dc2f

Browse files
committed
Update fallback texture color every frame
1 parent fafcc9b commit b78dc2f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/core/Project.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ void Project::rebuild_fs_cache()
374374

375375
void Project::update(double current_time)
376376
{
377+
if (config.fallback_color != glm::vec3{m_fallback_texture.color()}) {
378+
m_fallback_texture.color(glm::vec4{config.fallback_color, 1.0f});
379+
}
380+
381+
// Update every 5 seconds
377382
auto const update_interval = 5.0;
378383
if (current_time - m_fs_cache_last_updated < update_interval) {
379384
return;
@@ -391,10 +396,6 @@ void Project::update(double current_time)
391396
rebuild_fs_cache();
392397
});
393398
});
394-
395-
if (config.fallback_color != glm::vec3{m_fallback_texture.color()}) {
396-
m_fallback_texture.color(glm::vec4{config.fallback_color, 1.0f});
397-
}
398399
}
399400

400401
Texture const* Project::fallback_texture() const

0 commit comments

Comments
 (0)