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

Method GetMapIndex

src/game/collision.cpp:902–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900}
901
902int CCollision::GetMapIndex(vec2 Pos) const
903{
904 int Nx = std::clamp((int)Pos.x / 32, 0, m_Width - 1);
905 int Ny = std::clamp((int)Pos.y / 32, 0, m_Height - 1);
906 int Index = Ny * m_Width + Nx;
907
908 if(TileExists(Index))
909 return Index;
910 else
911 return -1;
912}
913
914std::vector<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, unsigned MaxIndices) const
915{

Callers 15

UpdateLocalTuningMethod · 0.80
ExtractProjectileInfoFunction · 0.80
ExtractLaserInfoFunction · 0.80
ExtractLaserInfoDDNetFunction · 0.80
CProjectileMethod · 0.80
CLaserMethod · 0.80
HandleTuneLayerMethod · 0.80
DDRacePostCoreTickMethod · 0.80
ReadMethod · 0.80
RenderLaserMethod · 0.80
TickMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected