MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / process_vis_prefetch

Method process_vis_prefetch

ogsr_engine/Layers/xrRender/ModelPool.cpp:762–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762void CModelPool::process_vis_prefetch() const
763{
764 if (!vis_prefetch_ini->section_exist("prefetch"))
765 return;
766 xr_vector<const char*> expired;
767 const auto& sect = vis_prefetch_ini->r_section("prefetch");
768 for (const auto& [key, val] : sect.Data)
769 {
770 float val1{}, val2{};
771 sscanf(val.c_str(), "%f,%f", &val1, &val2);
772 // Msg("--[%s] sscanf returns: [%f,%f]", __FUNCTION__, val1, val2);
773 const float need = val1 * 0.8f; // скорость уменьшение популярности визуала
774 // -0.5..+0.5 - добавить случайность, чтобы не было общего выключения
775 const float rnd = Random.randF() - 0.5f;
776 val1 = need + rnd * 0.1f;
777 if (val1 > 0.1f && val2 > 0.f)
778 vis_prefetch_ini->w_fvector2("prefetch", key.c_str(), Fvector2{val1, val2});
779 else
780 expired.emplace_back(key.c_str());
781 }
782 for (const char* s : expired)
783 vis_prefetch_ini->remove_line("prefetch", s);
784}
785
786void CModelPool::begin_prefetch1(bool val) { now_prefetch1 = val; }

Callers

nothing calls this directly

Calls 5

section_existMethod · 0.80
randFMethod · 0.80
w_fvector2Method · 0.80
remove_lineMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected