Begin CBallCamera & more headers

Former-commit-id: 21f597aeb7
This commit is contained in:
2022-09-21 01:18:07 -04:00
parent 57bb02906e
commit 9637b6f796
23 changed files with 981 additions and 140 deletions

View File

@@ -23,10 +23,12 @@ public:
++this->current;
return *this;
}
const_pointer_iterator& operator++(int) { return const_pointer_iterator(this->current++); }
const_pointer_iterator& operator--() {
--this->current;
return *this;
}
const_pointer_iterator& operator--(int) { return const_pointer_iterator(this->current--); }
const_pointer_iterator& operator+=(int v) {
this->current += v;
return *this;
@@ -65,19 +67,17 @@ public:
void operator=(const T& other) { rstl::construct(this->current, other); }
T& operator*() { return *this->current; }
T* operator->() { return this->current; }
void destroy() const {
if (this->current != nullptr) {
rstl::destroy(this->current);
}
}
void destroy() const { rstl::destroy(this->current); }
pointer_iterator& operator++() {
++this->current;
return *this;
}
pointer_iterator operator++(int) { return pointer_iterator(this->current++); }
pointer_iterator& operator--() {
--this->current;
return *this;
}
pointer_iterator operator--(int) { return pointer_iterator(this->current--); }
pointer_iterator& operator+=(int v) {
this->current += v;
return *this;
@@ -86,12 +86,8 @@ public:
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);
}
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

@@ -14,7 +14,7 @@ struct rmemory_allocator {
template < typename T >
static void deallocate(T* ptr) {
if (ptr != nullptr)
delete ptr;
CMemory::Free(ptr);
}
};
} // namespace rstl

View File

@@ -98,11 +98,14 @@ public:
inline T* data() { return xc_items; }
inline const T* data() const { return xc_items; }
inline int size() const { return x4_count; }
inline bool empty() const { return x4_count == 0; }
inline int capacity() const { return x8_capacity; }
inline T& front() { return xc_items[0]; }
inline const T& front() const { return xc_items[0]; }
inline T& back() { return xc_items[x4_count - 1]; }
inline const T& back() const { return xc_items[x4_count - 1]; }
inline T& at(int idx) { return xc_items[idx]; }
inline const T& at(int idx) const { return xc_items[idx]; }
inline T& front() { return at(0); }
inline const T& front() const { return at(0); }
inline T& back() { return at(x4_count - 1); }
inline const T& back() const { return at(x4_count - 1); }
inline T& operator[](int idx) { return xc_items[idx]; }
inline const T& operator[](int idx) const { return xc_items[idx]; }
};