mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-22 12:11:21 +00:00
- Tidy up coord
stat to use gi->getConsoleActor()
and also print pitch.
This commit is contained in:
parent
3c4b4e4483
commit
81caf74721
10 changed files with 7 additions and 45 deletions
|
@ -46,6 +46,7 @@
|
|||
#include "quotemgr.h"
|
||||
#include "gamestruct.h"
|
||||
#include "statusbar.h"
|
||||
#include "coreactor.h"
|
||||
|
||||
CVARD(Bool, cl_crosshair, true, CVAR_ARCHIVE, "enable/disable crosshair");
|
||||
CVARD(Bool, cl_automsg, false, CVAR_ARCHIVE, "enable/disable automatically sending messages to all players") // Not implemented for Blood
|
||||
|
@ -235,14 +236,14 @@ ADD_STAT(fps)
|
|||
|
||||
ADD_STAT(coord)
|
||||
{
|
||||
auto coord = gi->GetCoordinates();
|
||||
FString out;
|
||||
if (coord.first.X < DBL_MAX)
|
||||
if (const auto pActor = gi->getConsoleActor())
|
||||
{
|
||||
out.AppendFormat("X: %f ", coord.first.X);
|
||||
out.AppendFormat("Y: %f ", coord.first.Y);
|
||||
out.AppendFormat("Z: %f ", coord.first.Z);
|
||||
out.AppendFormat("Angle: %f\n", coord.second.Degrees());
|
||||
out.AppendFormat("X: %.4f ", pActor->spr.pos.X);
|
||||
out.AppendFormat("Y: %.4f ", pActor->spr.pos.Y);
|
||||
out.AppendFormat("Z: %.4f ", pActor->spr.pos.Z);
|
||||
out.AppendFormat("Yaw: %.4f ", pActor->spr.Angles.Yaw.Degrees());
|
||||
out.AppendFormat("Pitch: %.4f\n", pActor->spr.Angles.Pitch.Degrees());
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,6 @@ struct GameInterface
|
|||
virtual void SerializeGameState(FSerializer& arc) {}
|
||||
virtual void DrawPlayerSprite(const DVector2& origin, bool onteam) {}
|
||||
virtual void SetAmbience(bool on) {}
|
||||
virtual std::pair<DVector3, DAngle> GetCoordinates() { return {}; }
|
||||
virtual void ExitFromMenu() { throw CExitEvent(0); }
|
||||
virtual void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet = nullptr) {}
|
||||
virtual void UpdateSounds() {}
|
||||
|
|
|
@ -119,7 +119,6 @@ struct GameInterface : public ::GameInterface
|
|||
void MenuOpened() override;
|
||||
void MenuClosed() override;
|
||||
bool CanSave() override;
|
||||
std::pair<DVector3, DAngle> GetCoordinates() override;
|
||||
void UpdateSounds() override;
|
||||
void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet = nullptr) override;
|
||||
void Ticker() override;
|
||||
|
|
|
@ -774,13 +774,6 @@ bool GameInterface::GenerateSavePic()
|
|||
return true;
|
||||
}
|
||||
|
||||
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[myconnectindex];
|
||||
if (!pPlayer->actor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pPlayer->actor->spr.pos, pPlayer->actor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -36,7 +36,6 @@ struct GameInterface : public ::GameInterface
|
|||
FSavegameInfo GetSaveSig() override;
|
||||
double SmallFontScale() override { return isRR() ? 0.5 : 1.; }
|
||||
void SerializeGameState(FSerializer& arc) override;
|
||||
std::pair<DVector3, DAngle> GetCoordinates() override;
|
||||
void ExitFromMenu() override;
|
||||
void DrawPlayerSprite(const DVector2& origin, bool onteam) override;
|
||||
void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* packet = nullptr) override;
|
||||
|
|
|
@ -55,13 +55,6 @@ BEGIN_DUKE_NS
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||
{
|
||||
auto pActor = ps[screenpeek].GetActor();
|
||||
if (!pActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pActor->spr.pos, pActor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
GameStats GameInterface::getStats()
|
||||
{
|
||||
player_struct* p = &ps[myconnectindex];
|
||||
|
|
|
@ -679,13 +679,6 @@ bool GameInterface::CanSave()
|
|||
return new GameInterface;
|
||||
}
|
||||
|
||||
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||
{
|
||||
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
|
||||
if (!pPlayerActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(pPlayerActor->spr.pos, pPlayerActor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -238,7 +238,6 @@ struct GameInterface : public ::GameInterface
|
|||
void ToggleThirdPerson() override;
|
||||
void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) override;
|
||||
int GetCurrentSkill() override;
|
||||
std::pair<DVector3, DAngle> GetCoordinates() override;
|
||||
void StartSoundEngine() override;
|
||||
|
||||
::GameStats getStats() override;
|
||||
|
|
|
@ -967,19 +967,6 @@ void post_analyzesprites(tspriteArray& tsprites)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||
{
|
||||
auto ppActor = Player[myconnectindex].actor;
|
||||
if (!ppActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||
return std::make_pair(ppActor->spr.pos, ppActor->spr.Angles.Yaw);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PrintSpriteInfo(PLAYER* pp)
|
||||
{
|
||||
const int Y_STEP = 7;
|
||||
|
|
|
@ -1679,7 +1679,6 @@ struct GameInterface : public ::GameInterface
|
|||
FSavegameInfo GetSaveSig() override;
|
||||
void SerializeGameState(FSerializer& arc);
|
||||
void SetAmbience(bool on) override { if (on) StartAmbientSound(); else StopAmbientSound(); }
|
||||
std::pair<DVector3, DAngle> GetCoordinates() override;
|
||||
void UpdateSounds() override;
|
||||
void ErrorCleanup() override;
|
||||
void GetInput(ControlInfo* const hidInput, double const scaleAdjust, InputPacket* input = nullptr) override;
|
||||
|
|
Loading…
Reference in a new issue