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

Method SetSize

src/game/client/components/ghost.cpp:95–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void CGhost::CGhostPath::SetSize(int Items)
96{
97 int Chunks = m_vpChunks.size();
98 int NeededChunks = (Items + m_ChunkSize - 1) / m_ChunkSize;
99
100 if(NeededChunks > Chunks)
101 {
102 m_vpChunks.resize(NeededChunks);
103 for(int i = Chunks; i < NeededChunks; i++)
104 m_vpChunks[i] = (CGhostCharacter *)calloc(m_ChunkSize, sizeof(CGhostCharacter));
105 }
106
107 m_NumItems = Items;
108}
109
110void CGhost::CGhostPath::Add(const CGhostCharacter &Char)
111{

Callers 1

LoadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected