More Actor imps

This commit is contained in:
Phillip Stephens 2016-04-23 03:51:53 -07:00
parent 43685b9119
commit 8f78aa5f16
6 changed files with 27 additions and 1 deletions

View File

@ -386,7 +386,8 @@ void CGraphics::SetDepthRange(float znear, float zfar)
} }
CTimeProvider* CGraphics::g_ExternalTimeProvider = nullptr; CTimeProvider* CGraphics::g_ExternalTimeProvider = nullptr;
float CGraphics::g_DefaultSeconds; float CGraphics::g_DefaultSeconds = 0.f;
u32 CGraphics::g_RenderTimings = 0;
float CGraphics::GetSecondsMod900() float CGraphics::GetSecondsMod900()
{ {
@ -395,6 +396,12 @@ float CGraphics::GetSecondsMod900()
return g_ExternalTimeProvider->x0_currentTime; return g_ExternalTimeProvider->x0_currentTime;
} }
void CGraphics::TickRenderTimings()
{
g_RenderTimings++;
g_DefaultSeconds = float(g_RenderTimings) / 60.f;
}
boo::IGraphicsDataFactory::Platform CGraphics::g_BooPlatform = boo::IGraphicsDataFactory::Platform::Null; boo::IGraphicsDataFactory::Platform CGraphics::g_BooPlatform = boo::IGraphicsDataFactory::Platform::Null;
boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr; boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr; boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;

View File

@ -154,6 +154,7 @@ enum class ETexelFormat
class CGraphics class CGraphics
{ {
public: public:
struct CProjectionState struct CProjectionState
{ {
bool x0_persp; bool x0_persp;
@ -193,6 +194,7 @@ public:
static void SetDepthWriteMode(bool test, ERglEnum comp, bool write); static void SetDepthWriteMode(bool test, ERglEnum comp, bool write);
static void SetBlendMode(ERglBlendMode, ERglBlendFactor, ERglBlendFactor, ERglLogicOp); static void SetBlendMode(ERglBlendMode, ERglBlendFactor, ERglBlendFactor, ERglLogicOp);
static void SetCullMode(ERglCullMode); static void SetCullMode(ERglCullMode);
static void BeginScene();
static void EndScene(); static void EndScene();
static void SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1); static void SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1);
static void SetViewPointMatrix(const zeus::CTransform& xf); static void SetViewPointMatrix(const zeus::CTransform& xf);
@ -221,9 +223,11 @@ public:
static CTimeProvider* g_ExternalTimeProvider; static CTimeProvider* g_ExternalTimeProvider;
static float g_DefaultSeconds; static float g_DefaultSeconds;
static u32 g_RenderTimings;
static void SetExternalTimeProvider(CTimeProvider* provider) static void SetExternalTimeProvider(CTimeProvider* provider)
{g_ExternalTimeProvider = provider;} {g_ExternalTimeProvider = provider;}
static float GetSecondsMod900(); static float GetSecondsMod900();
static void TickRenderTimings();
static boo::IGraphicsDataFactory::Platform g_BooPlatform; static boo::IGraphicsDataFactory::Platform g_BooPlatform;
static boo::IGraphicsDataFactory* g_BooFactory; static boo::IGraphicsDataFactory* g_BooFactory;

View File

@ -41,6 +41,7 @@ protected:
bool xe4_27_ : 1; bool xe4_27_ : 1;
bool xe4_28_ : 1; bool xe4_28_ : 1;
bool xe4_29_ : 1; bool xe4_29_ : 1;
bool xe4_30_ : 1;
bool xe5_0_opaque : 1; bool xe5_0_opaque : 1;
bool xe5_26_muted : 1; bool xe5_26_muted : 1;
bool xe5_27_useInSortedLists : 1; bool xe5_27_useInSortedLists : 1;
@ -63,6 +64,8 @@ public:
const CActorParameters&, TUniqueId); const CActorParameters&, TUniqueId);
virtual void Accept(IVisitor&) /*= 0*/; virtual void Accept(IVisitor&) /*= 0*/;
virtual void AddToRenderer(const zeus::CFrustum&, CStateManager&) {}
virtual void Render(CStateManager&) {}
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {} virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
virtual void SetActive(bool active) virtual void SetActive(bool active)
{ {

View File

@ -40,6 +40,9 @@ public:
const zeus::CAABox&, const SMoverData&, const CActorParameters&, const zeus::CAABox&, const SMoverData&, const CActorParameters&,
float, float); float, float);
void AddToRenderer(const zeus::CFrustum &, CStateManager &){}
void Render(CStateManager& mgr) { CActor::Render(mgr); }
float GetCollisionAccuracyModifier() float GetCollisionAccuracyModifier()
{ return x248_collisionAccuracyModifier; } { return x248_collisionAccuracyModifier; }

View File

@ -43,6 +43,12 @@ void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStat
{ {
} }
void CScriptDoor::AddToRenderer(const zeus::CFrustum& /*frustum*/, CStateManager &mgr)
{
if (!xe4_30_)
CPhysicsActor::Render(mgr);
}
/* ORIGINAL 0-00 OFFSET: 8007E0BC */ /* ORIGINAL 0-00 OFFSET: 8007E0BC */
void CScriptDoor::ForceClosed(CStateManager & mgr) void CScriptDoor::ForceClosed(CStateManager & mgr)
{ {

View File

@ -54,6 +54,9 @@ public:
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const; zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const;
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr); void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
void AddToRenderer(const zeus::CFrustum&, CStateManager& mgr);
zeus::CAABox GetTouchBounds() const {}
void Render(const CStateManager&) {}
void ForceClosed(CStateManager&); void ForceClosed(CStateManager&);
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area); bool IsConnectedToArea(const CStateManager& mgr, TAreaId area);
void OpenDoor(TUniqueId, CStateManager&); void OpenDoor(TUniqueId, CStateManager&);