Very similar thing with DrawFront flag
parent
74ab7afb23
commit
4251873f49
|
@ -826,7 +826,6 @@ void CEngine::DebugObject(int objRank)
|
|||
l->Debug(" baseObjRank = %d\n", m_objects[objRank].baseObjRank);
|
||||
l->Debug(" visible = %s\n", m_objects[objRank].visible ? "true" : "false");
|
||||
l->Debug(" drawWorld = %s\n", m_objects[objRank].drawWorld ? "true" : "false");
|
||||
l->Debug(" drawFront = %s\n", m_objects[objRank].drawFront ? "true" : "false");
|
||||
l->Debug(" type = %d\n", m_objects[objRank].type);
|
||||
l->Debug(" distance = %f\n", m_objects[objRank].distance);
|
||||
l->Debug(" shadowRank = %d\n", m_objects[objRank].shadowRank);
|
||||
|
@ -980,13 +979,6 @@ void CEngine::SetObjectDrawWorld(int objRank, bool draw)
|
|||
m_objects[objRank].drawWorld = draw;
|
||||
}
|
||||
|
||||
void CEngine::SetObjectDrawFront(int objRank, bool draw)
|
||||
{
|
||||
assert(objRank >= 0 && objRank < static_cast<int>( m_objects.size() ));
|
||||
|
||||
m_objects[objRank].drawFront = draw;
|
||||
}
|
||||
|
||||
void CEngine::GetObjectBBox(int objRank, glm::vec3& min, glm::vec3& max)
|
||||
{
|
||||
assert(objRank >= 0 && objRank < static_cast<int>( m_objects.size() ));
|
||||
|
@ -2803,6 +2795,12 @@ bool CEngine::IsGhostObject(int objRank)
|
|||
return gameObject->m_bCameraGhost;
|
||||
}
|
||||
|
||||
bool CEngine::IsDrawFrontObject(int objRank)
|
||||
{
|
||||
CObject *gameObject = m_objects[objRank].gameObject;
|
||||
return gameObject && gameObject->m_bDrawFront;
|
||||
}
|
||||
|
||||
void CEngine::Draw3DScene()
|
||||
{
|
||||
if (!m_worldCaptured)
|
||||
|
@ -3709,7 +3707,7 @@ void CEngine::DrawInterface()
|
|||
if (m_objects[objRank].type == ENG_OBJTYPE_TERRAIN)
|
||||
continue;
|
||||
|
||||
if (! m_objects[objRank].drawFront)
|
||||
if (! IsDrawFrontObject(objRank))
|
||||
continue;
|
||||
|
||||
auto combinedMatrix = projectionViewMatrix * m_objects[objRank].transform;
|
||||
|
|
|
@ -127,8 +127,6 @@ struct EngineObject
|
|||
bool visible = false;
|
||||
//! If true, object is behind the 2D interface
|
||||
bool drawWorld = false;
|
||||
//! If true, the shape is before the 2D interface
|
||||
bool drawFront = false;
|
||||
//! Type of object
|
||||
EngineObjectType type = ENG_OBJTYPE_NULL;
|
||||
//! Transformation matrix
|
||||
|
@ -593,11 +591,11 @@ public:
|
|||
|
||||
//! Sets drawWorld for given object
|
||||
void SetObjectDrawWorld(int objRank, bool draw);
|
||||
//! Sets drawFront for given object
|
||||
void SetObjectDrawFront(int objRank, bool draw);
|
||||
|
||||
//! Check if object is transparent to prevent blocking the camera view
|
||||
bool IsGhostObject(int objRank);
|
||||
//! Check if object draws in front of the user interface
|
||||
bool IsDrawFrontObject(int objRank);
|
||||
|
||||
//! Returns the bounding box for an object
|
||||
void GetObjectBBox(int objRank, glm::vec3& min, glm::vec3& max);
|
||||
|
|
|
@ -2728,7 +2728,7 @@ void CRobotMain::ScenePerso()
|
|||
CObject* obj = SearchHuman();
|
||||
if (obj != nullptr)
|
||||
{
|
||||
obj->SetDrawFront(true); // draws the interface
|
||||
obj->m_bDrawFront = true; // draws the interface
|
||||
|
||||
assert(obj->Implements(ObjectInterfaceType::Movable));
|
||||
CMotionHuman* mh = static_cast<CMotionHuman*>(dynamic_cast<CMovableObject&>(*obj).GetMotion());
|
||||
|
|
|
@ -164,6 +164,8 @@ public:
|
|||
|
||||
//! Is the object translucent to prevent blocking the camera view?
|
||||
bool m_bCameraGhost = false;
|
||||
//! Does the object draw in front of the user interface?
|
||||
bool m_bDrawFront = false;
|
||||
|
||||
//! Sets flag controlling animation effect on level reset
|
||||
void SetAnimateOnReset(bool animateOnReset);
|
||||
|
|
|
@ -1855,21 +1855,6 @@ glm::mat4 COldObject::GetWorldMatrix(int part)
|
|||
}
|
||||
|
||||
|
||||
// Indicates whether the object should be drawn over the interface.
|
||||
|
||||
void COldObject::SetDrawFront(bool bDraw)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i=0 ; i<OBJECTMAXPART ; i++ )
|
||||
{
|
||||
if ( m_objectPart[i].bUsed )
|
||||
{
|
||||
m_engine->SetObjectDrawFront(m_objectPart[i].object, bDraw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Creates shade under a vehicle as a negative light.
|
||||
|
||||
bool COldObject::CreateShadowLight(float height, Gfx::Color color)
|
||||
|
|
|
@ -130,8 +130,6 @@ public:
|
|||
void Write(CLevelParserLine* line) override;
|
||||
void Read(CLevelParserLine* line) override;
|
||||
|
||||
void SetDrawFront(bool bDraw) override;
|
||||
|
||||
int GetShadowLight();
|
||||
|
||||
void SetFloorHeight(float height);
|
||||
|
|
|
@ -46,11 +46,6 @@ int COldObjectInterface::GetOption()
|
|||
throw std::logic_error("GetOption: not implemented!");
|
||||
}
|
||||
|
||||
void COldObjectInterface::SetDrawFront(bool bDraw)
|
||||
{
|
||||
throw std::logic_error("SetDrawFront: not implemented!");
|
||||
}
|
||||
|
||||
|
||||
void COldObjectInterface::FloorAdjust()
|
||||
{
|
||||
|
|
|
@ -53,8 +53,6 @@ public:
|
|||
|
||||
virtual int GetOption();
|
||||
|
||||
virtual void SetDrawFront(bool bDraw);
|
||||
|
||||
|
||||
virtual void FloorAdjust();
|
||||
|
||||
|
|
|
@ -446,7 +446,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
m_toto = SearchToto();
|
||||
if ( m_toto != nullptr )
|
||||
{
|
||||
m_toto->SetDrawFront(true);
|
||||
m_toto->m_bDrawFront = true;
|
||||
|
||||
assert(m_toto->Implements(ObjectInterfaceType::Movable));
|
||||
CMotionToto* toto = static_cast<CMotionToto*>(dynamic_cast<CMovableObject&>(*m_toto).GetMotion());
|
||||
|
|
Loading…
Reference in New Issue