Update submodules, add room timer

This commit is contained in:
Phillip Stephens 2020-12-31 14:00:10 -08:00
parent 0364d50164
commit c6593760b1
6 changed files with 26 additions and 2 deletions

View File

@ -72,6 +72,19 @@ void ViewManager::TestGameView::think() {
auto pt = std::div(igt, 3600);
overlayText +=
fmt::format(FMT_STRING("PlayTime: {:02d}:{:02d}:{:02d}.{:03d}\n"), pt.quot, pt.rem / 60, pt.rem % 60, ms);
if (g_StateManager->GetCurrentArea() != nullptr) {
if (m_currentRoom != g_StateManager->GetCurrentArea()) {
m_currentRoom = static_cast<const void*>(g_StateManager->GetCurrentArea());
m_lastRoomTime = igt - m_currentRoomStart;
m_currentRoomStart = igt;
}
double currentRoomTime = igt - m_currentRoomStart;
u32 curFrames = std::round(u32(currentRoomTime * 60));
u32 lastFrames = std::round(u32(m_lastRoomTime * 60));
overlayText += fmt::format(FMT_STRING("Room Time:{:8.3f}/{:6d}| Last Room:{:8.3f}/{:6d}\n"),
currentRoomTime, curFrames,
m_lastRoomTime, lastFrames);
}
}
if (g_StateManager->Player() && m_cvarCommons.m_debugOverlayPlayerInfo->toBoolean()) {

View File

@ -59,6 +59,9 @@ class ViewManager final : public specter::IViewManager {
ViewManager& m_vm;
std::unique_ptr<specter::MultiLineTextView> m_debugText;
hecl::CVarCommons m_cvarCommons;
const void* m_currentRoom = nullptr;
double m_lastRoomTime = 0.f;
double m_currentRoomStart = 0.f;
public:
TestGameView(ViewManager& vm, specter::ViewResources& res, specter::View& parent, hecl::CVarManager& cvarMgr)

View File

@ -2845,4 +2845,11 @@ void CStateManager::sub_80044098(const CCollisionResponseData& colRespData, cons
TUniqueId uid, const CWeaponMode& weaponMode, u32 w1, u8 thermalFlags) {
// TODO implement
}
const CGameArea* CStateManager::GetCurrentArea() const {
if (x850_world == nullptr || x850_world->GetCurrentAreaId() == kInvalidAreaId) {
return nullptr;
}
return x850_world->GetAreaAlways(x850_world->GetCurrentAreaId());
};
} // namespace urde

View File

@ -464,6 +464,7 @@ public:
void sub_80044098(const CCollisionResponseData& colRespData, const CRayCastResult& rayCast, TUniqueId uid,
const CWeaponMode& weaponMode, u32 w1, u8 thermalFlags);
const CGameArea* GetCurrentArea() const;
void SetWarping(bool warp) { m_warping = warp; }
};
} // namespace urde

2
hecl

@ -1 +1 @@
Subproject commit d2e629b1e90b8c0f7b2b44ae065941b18fe3293f
Subproject commit 2b75ffed470e6f9287da83bca72039ab2598c261

2
nod

@ -1 +1 @@
Subproject commit 2783337c36bacdf832f78182340e4aa6063dece9
Subproject commit d53d6770386b5944a4e65251bde30596332bdc2c