MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnShow

Method OnShow

Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp:22–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 }
21
22 void RefreshCacheSection::OnShow(IMenuContainer* root)
23 {
24 MenuSection::OnShow(root);
25
26#if defined(WITH_THREADS)
27 _thread = Thread([](void* arg) {
28 auto _this = static_cast<RefreshCacheSection*>(arg);
29 if (auto mainMenu = runtime_cast<MainMenu>(_this->_root)) {
30 mainMenu->_root->RefreshCacheLevels(true);
31 }
32
33 std::uint32_t filesRemoved = RenderResources::GetBinaryShaderCache().Prune();
34 LOGI("Pruning binary shader cache (removed {} directories)...", filesRemoved);
35
36 _this->_done = true;
37 }, this);
38#else
39 if (auto mainMenu = runtime_cast<MainMenu*>(_root)) {
40 mainMenu->_root->RefreshCacheLevels(true);
41 }
42
43 std::uint32_t filesRemoved = RenderResources::binaryShaderCache().Prune();
44 LOGI("Pruning binary shader cache (removed {} directories)...", filesRemoved);
45
46 _done = true;
47#endif
48 }
49
50 void RefreshCacheSection::OnUpdate(float timeMult)
51 {

Callers

nothing calls this directly

Calls 3

ThreadClass · 0.85
RefreshCacheLevelsMethod · 0.80
PruneMethod · 0.80

Tested by

no test coverage detected