Skip to content

Commit 83e98fb

Browse files
committed
Fixed work of dbg_show_ani_info console command
The code for it was partially disabled. Not it's fully functional disabled by default) I changed the output for it to be more organized Also I deleted IReceived and ICoincidenced variables that were just unused
1 parent 6ba3e68 commit 83e98fb

File tree

2 files changed

+33
-54
lines changed

2 files changed

+33
-54
lines changed

src/xrGame/Actor.cpp

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ const u32 patch_frames = 50;
7979
const float respawn_delay = 1.f;
8080
const float respawn_auto = 7.f;
8181

82-
static float IReceived = 0;
83-
static float ICoincidenced = 0;
8482
extern float cammera_into_collision_shift;
8583

8684
string32 ACTOR_DEFS::g_quick_use_slots[4] = {NULL, NULL, NULL, NULL};
@@ -1459,46 +1457,13 @@ bool CActor::use_default_throw_force()
14591457
}
14601458

14611459
float CActor::missile_throw_force() { return 0.f; }
1462-
#ifdef DEBUG
1463-
extern BOOL g_ShowAnimationInfo;
1464-
#endif // DEBUG
1465-
// HUD
14661460

1461+
// HUD
14671462
void CActor::OnHUDDraw(CCustomHUD*)
14681463
{
14691464
R_ASSERT(IsFocused());
14701465
if (!((mstate_real & mcLookout) && !IsGameTypeSingle()))
14711466
g_player_hud->render_hud();
1472-
1473-
#if 0 // ndef NDEBUG
1474-
if (Level().CurrentControlEntity() == this && g_ShowAnimationInfo)
1475-
{
1476-
string128 buf;
1477-
UI().Font().pFontStat->SetColor (0xffffffff);
1478-
UI().Font().pFontStat->OutSet (170,530);
1479-
UI().Font().pFontStat->OutNext ("Position: [%3.2f, %3.2f, %3.2f]",VPUSH(Position()));
1480-
UI().Font().pFontStat->OutNext ("Velocity: [%3.2f, %3.2f, %3.2f]",VPUSH(m_PhysicMovementControl->GetVelocity()));
1481-
UI().Font().pFontStat->OutNext ("Vel Magnitude: [%3.2f]",m_PhysicMovementControl->GetVelocityMagnitude());
1482-
UI().Font().pFontStat->OutNext ("Vel Actual: [%3.2f]",m_PhysicMovementControl->GetVelocityActual());
1483-
switch (m_PhysicMovementControl->Environment())
1484-
{
1485-
case CPHMovementControl::peOnGround: xr_strcpy(buf,"ground"); break;
1486-
case CPHMovementControl::peInAir: xr_strcpy(buf,"air"); break;
1487-
case CPHMovementControl::peAtWall: xr_strcpy(buf,"wall"); break;
1488-
}
1489-
UI().Font().pFontStat->OutNext (buf);
1490-
1491-
if (IReceived != 0)
1492-
{
1493-
float Size = 0;
1494-
Size = UI().Font().pFontStat->GetSize();
1495-
UI().Font().pFontStat->SetSize(Size*2);
1496-
UI().Font().pFontStat->SetColor (0xffff0000);
1497-
UI().Font().pFontStat->OutNext ("Input : [%3.2f]", ICoincidenced/IReceived * 100.0f);
1498-
UI().Font().pFontStat->SetSize(Size);
1499-
};
1500-
};
1501-
#endif
15021467
}
15031468

15041469
void CActor::RenderIndicator(Fvector dpos, float r1, float r2, const ui_shader& IndShader)

src/xrGame/ActorAnimation.cpp

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ CMotion* FindMotionKeys(MotionID motion_ID, IRenderVisual* V)
315315
}
316316

317317
#ifdef DEBUG
318-
BOOL g_ShowAnimationInfo = TRUE;
318+
BOOL g_ShowAnimationInfo = FALSE;
319319
#endif // DEBUG
320320
constexpr pcstr mov_state[] = {
321321
"idle", "walk", "run", "sprint",
@@ -644,26 +644,40 @@ void CActor::g_SetAnimation(u32 mstate_rl)
644644
#endif
645645

646646
#ifdef DEBUG
647-
if ((Level().CurrentControlEntity() == this) && g_ShowAnimationInfo)
647+
if (g_ShowAnimationInfo && Level().CurrentControlEntity() == this)
648648
{
649+
auto movement = character_physics_support()->movement();
650+
auto pFontStat = UI().Font().pFontStat;
651+
u32 color = pFontStat->GetColor();
652+
pFontStat->SetColor(0xffffffff);
653+
pFontStat->OutSet(170, 530);
654+
649655
string128 buf;
650656
ConvState(mstate_rl, &buf);
651-
UI().Font().pFontStat->OutNext("MSTATE: [%s]", buf);
652-
/*
653-
switch (m_PhysicMovementControl->Environment())
654-
{
655-
case CPHMovementControl::peOnGround: xr_strcpy(buf,"ground"); break;
656-
case CPHMovementControl::peInAir: xr_strcpy(buf,"air"); break;
657-
case CPHMovementControl::peAtWall: xr_strcpy(buf,"wall"); break;
658-
}
659-
UI().Font().pFontStat->OutNext (buf);
660-
UI().Font().pFontStat->OutNext ("Accel [%3.2f, %3.2f, %3.2f]",VPUSH(NET_SavedAccel));
661-
UI().Font().pFontStat->OutNext ("V [%3.2f, %3.2f,
662-
%3.2f]",VPUSH(m_PhysicMovementControl->GetVelocity()));
663-
UI().Font().pFontStat->OutNext ("vertex ID %d",ai_location().level_vertex_id());
664-
665-
Game().m_WeaponUsageStatistic->Draw();
666-
*/
657+
pFontStat->OutNext("Movement state: [%s]", buf);
658+
switch (movement->Environment())
659+
{
660+
case CPHMovementControl::peOnGround:
661+
pFontStat->OutNext("Movement environment: [OnGround]");
662+
break;
663+
case CPHMovementControl::peInAir:
664+
pFontStat->OutNext("Movement environment: [InAir]");
665+
break;
666+
case CPHMovementControl::peAtWall:
667+
pFontStat->OutNext("Movement environment: [AtWall]");
668+
break;
669+
}
670+
671+
pFontStat->OutNext("Vertex ID: [%d]", ai_location().level_vertex_id());
672+
pFontStat->OutNext("Position: [%3.2f, %3.2f, %3.2f]", VPUSH(Position()));
673+
pFontStat->OutNext("Accel: [%3.2f, %3.2f, %3.2f]", VPUSH(NET_SavedAccel));
674+
pFontStat->OutNext("Velocity: [%3.2f, %3.2f, %3.2f]", VPUSH(movement->GetVelocity()));
675+
pFontStat->OutNext("Vel Magnitude: [%3.2f]", movement->GetVelocityMagnitude());
676+
pFontStat->OutNext("Vel Actual: [%3.2f]", movement->GetVelocityActual());
677+
678+
pFontStat->SetColor(color);
679+
680+
//Game().m_WeaponUsageStatistic->Draw();
667681
};
668682
#endif
669683

0 commit comments

Comments
 (0)