CPlayer header, more CScriptPlatform, renaming

Former-commit-id: 5d9f7afa3b
This commit is contained in:
2022-09-19 00:19:46 -04:00
parent f6f1040fff
commit b32c6018e8
33 changed files with 674 additions and 63 deletions

View File

@@ -20,24 +20,38 @@ public:
const_pointer_iterator() : current(nullptr) {}
const_pointer_iterator(const T* begin) : current(const_cast< T* >(begin)) {}
const_pointer_iterator& operator++() {
++current;
++this->current;
return *this;
}
const_pointer_iterator& operator--() {
--current;
--this->current;
return *this;
}
const_pointer_iterator& operator+=(int v) {
this->current += v;
return *this;
}
const_pointer_iterator& operator-=(int v) {
this->current -= v;
return *this;
}
const_pointer_iterator operator+(int v) const {
return const_pointer_iterator(this->current + v);
}
const_pointer_iterator operator-(int v) const {
return const_pointer_iterator(this->current - v);
}
const T& operator*() const { return *current; }
const T* operator->() const { return current; }
bool operator==(const const_pointer_iterator& other) { return current == other.current; }
bool operator!=(const const_pointer_iterator& other) { return current != other.current; }
friend const_pointer_iterator operator+(const const_pointer_iterator& x, int v) {
return const_pointer_iterator(x.current + v);
}
friend const_pointer_iterator operator-(const const_pointer_iterator& x, int v) {
return const_pointer_iterator(x.current - v);
}
// friend const_pointer_iterator operator+(const const_pointer_iterator& x, int v) {
// return const_pointer_iterator(x.current + v);
// }
// friend const_pointer_iterator operator-(const const_pointer_iterator& x, int v) {
// return const_pointer_iterator(x.current - v);
// }
protected:
T* current;
@@ -64,12 +78,19 @@ public:
--this->current;
return *this;
}
friend pointer_iterator operator+(const pointer_iterator& x, int v) {
return pointer_iterator(x.current + v);
pointer_iterator& operator+=(int v) {
this->current += v;
return *this;
}
friend pointer_iterator operator-(const pointer_iterator& x, int v) {
return pointer_iterator(x.current - v);
pointer_iterator& operator-=(int v) {
this->current -= v;
return *this;
}
pointer_iterator operator+(int v) const {
return pointer_iterator(this->current + v);
}
pointer_iterator operator-(int v) const {
return pointer_iterator(this->current - v);
}
};
} // namespace rstl

View File

@@ -46,11 +46,9 @@ public:
~reserved_vector() { clear(); }
void push_back(const T& in) {
if (x0_count < N) {
iterator out = begin() + x0_count;
out = in;
++x0_count;
}
iterator out = begin() + x0_count;
out = in;
++x0_count;
}
inline T* data() { return reinterpret_cast< T* >(x4_data); }

View File

@@ -62,6 +62,7 @@ public:
}
void reserve(int size);
iterator erase(iterator it);
void push_back(const T& in) {
if (x4_count >= x8_capacity) {