SOB visibility to bitflags

This commit is contained in:
lawnjelly 2019-09-24 19:05:33 +01:00 committed by GitHub
parent fe83f1374e
commit 805b6153b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 15 deletions

2
ldob.h
View File

@ -38,7 +38,7 @@ public:
ObjectID m_ID; // godot object ObjectID m_ID; // godot object
AABB m_aabb; // world space AABB m_aabb; // world space
bool m_bVisible; //bool m_bSOBVisible;
}; };
// dynamic object // dynamic object

View File

@ -180,11 +180,9 @@ void LRoom::FinalizeVisibility(LRoomManager &manager)
if (pVI) if (pVI)
{ {
SoftShow(pVI, sob.m_bVisible); //SoftShow(pVI, sob.m_bSOBVisible);
// if (sob.m_bVisible) bool bVisible = manager.m_BF_visible_SOBs.GetBit(n) != 0;
// pVI->show(); SoftShow(pVI, bVisible);
// else
// pVI->hide();
} }
} }
@ -303,14 +301,12 @@ void LRoom::FirstTouch(LRoomManager &manager)
manager.m_pCurr_VisibleRoomList->push_back(m_RoomID); manager.m_pCurr_VisibleRoomList->push_back(m_RoomID);
// hide all objects // hide all objects
int last_sob = m_iFirstSOB + m_iNumSOBs; // int last_sob = m_iFirstSOB + m_iNumSOBs;
for (int n=m_iFirstSOB; n<last_sob; n++) // for (int n=m_iFirstSOB; n<last_sob; n++)
{ // {
LSob &sob = manager.m_SOBs[n]; // LSob &sob = manager.m_SOBs[n];
sob.m_bVisible = false; // sob.m_bSOBVisible = false;
} // }
// for (int n=0; n<m_SOBs.size(); n++)
// m_SOBs[n].m_bVisible = false;
// hide all dobs // hide all dobs
for (int n=0; n<m_DOBs.size(); n++) for (int n=0; n<m_DOBs.size(); n++)
@ -389,7 +385,7 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
if (bShow) if (bShow)
{ {
sob.m_bVisible = true; //sob.m_bSOBVisible = true;
// sob is renderable and visible (not shadow only) // sob is renderable and visible (not shadow only)
manager.m_BF_visible_SOBs.SetBit(n, true); manager.m_BF_visible_SOBs.SetBit(n, true);
//manager.m_BF_render_SOBs.SetBit(n, true); //manager.m_BF_render_SOBs.SetBit(n, true);