MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetPureMapIndex

Method GetPureMapIndex

src/game/collision.cpp:831–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829}
830
831int CCollision::GetPureMapIndex(float x, float y) const
832{
833 int Nx = std::clamp(round_to_int(x) / 32, 0, m_Width - 1);
834 int Ny = std::clamp(round_to_int(y) / 32, 0, m_Height - 1);
835 return Ny * m_Width + Nx;
836}
837
838bool CCollision::TileExists(int Index) const
839{

Callers 7

IsStartMethod · 0.45
DDRaceTickMethod · 0.45
ResetCollisionMethod · 0.45
TickMethod · 0.45
DoBounceMethod · 0.45
DDRaceTickMethod · 0.45
HandleCharacterTilesMethod · 0.45

Calls 1

round_to_intFunction · 0.85

Tested by

no test coverage detected