ccarctrl big fix

This commit is contained in:
Nikolay Korolev
2020-05-09 20:21:13 +03:00
parent e30b538cd3
commit a55e738dfa
10 changed files with 184 additions and 36 deletions

View File

@ -145,4 +145,6 @@ public:
static int32 GetRandomNumberInRange(int32 low, int32 high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }
static void SetRandomSeed(int32 seed)
{ mysrand(seed); }
};

View File

@ -16,7 +16,7 @@ public:
m_matrix.GetPosition().y = y;
m_matrix.GetPosition().z = z;
}
void SetPosition(const CVector &pos) { m_matrix.GetPosition() = pos; }
void SetPosition(const CVector& pos) { m_matrix.GetPosition() = pos; }
CVector &GetRight(void) { return m_matrix.GetRight(); }
CVector &GetForward(void) { return m_matrix.GetForward(); }
CVector &GetUp(void) { return m_matrix.GetUp(); }

View File

@ -133,7 +133,7 @@ public:
// TODO: the cast is unsafe
return (int)((U*)entry - m_entries);
}
int GetNoOfUsedSpaces(void){
int GetNoOfUsedSpaces(void) const {
int i;
int n = 0;
for(i = 0; i < m_size; i++)
@ -164,6 +164,7 @@ public:
memcpy(entries, m_entries, sizeof(U)*m_size);
debug("Stored:%d (/%d)\n", GetNoOfUsedSpaces(), m_size); /* Assumed inlining */
}
int32 GetNoOfFreeSpaces() const { return GetSize() - GetNoOfUsedSpaces(); }
};
template<typename T>