Skip to content

Commit

Permalink
Bind wallmark life time on dynamic objects to r__wallmark_ttl
Browse files Browse the repository at this point in the history
Increased max wallmark lifetime to 10 minutes
  • Loading branch information
abramcumner authored and Xottab-DUTY committed Jan 19, 2018
1 parent d711d59 commit 748246c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Layers/xrRender/SkeletonCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ void CKinematics::AddWallmark(
wallmarks.push_back(wm);
}

static const float LIFE_TIME = 30.f;
struct zero_wm_pred : public std::unary_function<intrusive_ptr<CSkeletonWallmark>, bool>
{
bool operator()(const intrusive_ptr<CSkeletonWallmark> x) { return x == nullptr; }
Expand All @@ -741,7 +740,7 @@ void CKinematics::CalculateWallmarks()
for (auto it = wallmarks.begin(); it != wallmarks.end(); it++)
{
intrusive_ptr<CSkeletonWallmark>& wm = *it;
float w = (RDEVICE.fTimeGlobal - wm->TimeStart()) / LIFE_TIME;
float w = (RDEVICE.fTimeGlobal - wm->TimeStart()) / ps_r__WallmarkTTL;
if (w < 1.f)
{
// append wm to WallmarkEngine
Expand Down Expand Up @@ -777,7 +776,7 @@ void CKinematics::RenderWallmark(intrusive_ptr<CSkeletonWallmark> wm, FVF::LIT*&
for (u32 f_idx = 0; f_idx < wm->m_Faces.size(); f_idx++)
{
CSkeletonWallmark::WMFace F = wm->m_Faces[f_idx];
float w = (RDEVICE.fTimeGlobal - wm->TimeStart()) / LIFE_TIME;
float w = (RDEVICE.fTimeGlobal - wm->TimeStart()) / ps_r__WallmarkTTL;
for (u32 k = 0; k < 3; k++)
{
Fvector P;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/xrRender_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void xrRender_initconsole()
CMD4(CCC_Float, "r__wallmark_shift_v", &ps_r__WallmarkSHIFT_V, 0.0f, 1.f);
CMD1(CCC_ModelPoolStat, "stat_models");
#endif // DEBUG
CMD4(CCC_Float, "r__wallmark_ttl", &ps_r__WallmarkTTL, 1.0f, 5.f * 60.f);
CMD4(CCC_Float, "r__wallmark_ttl", &ps_r__WallmarkTTL, 1.0f, 10.f * 60.f);

CMD4(CCC_Integer, "r__supersample", &ps_r__Supersample, 1, 8);

Expand Down

0 comments on commit 748246c

Please sign in to comment.