Files
ph/libs/cpp/include/vector
T
SammygoodTunes 5b15874c4d Decomp src/00_Core/Map/MapBase.cpp (57%) (#129)
* Comments

* Lay out theoretical code

* Externalise func_020196bc & func_020196fc

* Pull merge

* Pull merge

* Decomp MapBase::func_ov00_02080edc

* Fix MapManager TilePos params

* Decomp progress

* Fix MapManager param issue

* Decomp progress

* Update MapManager var pointer type

* Fix function defs

* Update symbols

* Update

* Match MapBase_Unk2::func_ov00_02080ad0 (thx 2 dt mow & yanis)

* Update

* Decomp progress 26%

* Decomp progress 28%

* Fix struct overlap

* Fix unknown members

* Uncomment and fix rest of methods (most still non-matching)

* Decomp progress

* Corrections
2025-09-21 14:21:31 +02:00

41 lines
913 B
Plaintext

#pragma once
#include <string.h>
namespace std {
template <class T> class vector {
public:
T *mElements;
int mSize;
int mCapacity;
~vector() {
if (mElements != NULL) {
decrease_size(mSize);
delete mElements;
}
}
int push_back(T &value) {
get_new_capacity(1);
append_back(1, &value);
}
T *erase(T *first, T *last) {
if (first != last) {
int bytesToMove = (int) mElements + mSize * sizeof(T) - (int) last;
memmove(first, last, bytesToMove);
mSize -= (int) last - (int) first;
}
return first;
}
private:
void decrease_size(int amount);
int get_new_capacity(int growth);
void append_back(int length, T *items);
};
} // namespace std