feat: sync with Whoa implementation

This commit is contained in:
VDm 2026-04-26 17:10:11 +04:00
parent 12ab8f7721
commit 6928bf3f0c
46 changed files with 2980 additions and 441 deletions

View file

@ -19,6 +19,7 @@ class TSBaseArray {
// Member functions
T& operator[](uint32_t index);
const T& operator[](uint32_t index) const;
void CheckArrayBounds(uint32_t index) const;
void Constructor();
uint32_t Count() const;
@ -33,6 +34,12 @@ T& TSBaseArray<T>::operator[](uint32_t index) {
return this->m_data[index];
}
template <class T>
const T& TSBaseArray<T>::operator[](uint32_t index) const {
this->CheckArrayBounds(index);
return this->m_data[index];
}
template <class T>
void TSBaseArray<T>::CheckArrayBounds(uint32_t index) const {
if (index < this->Count()) {
@ -40,14 +47,15 @@ void TSBaseArray<T>::CheckArrayBounds(uint32_t index) const {
}
SErrDisplayErrorFmt(
0x85100080,
STORM_ERROR_ACCESS_OUT_OF_BOUNDS,
this->MemFileName(),
this->MemLineNo(),
1,
1,
"index (0x%08X), array size (0x%08X)",
index,
this->Count());
this->Count()
);
}
template <class T>