|
1 | 1 | #pragma once |
2 | 2 | #include "xr_level_controller.h" |
3 | 3 |
|
4 | | -// fwd. decl. |
5 | | -class CUIWindow; |
6 | | -struct _12b |
7 | | -{ |
8 | | - /*DWORD*/ unsigned long _[3]; |
9 | | -}; |
10 | | -template <class T, int granularity> class poolSS; |
11 | | -extern poolSS<_12b, 128> ui_allocator; |
12 | | - |
13 | | -// XXX: remove uialloc |
14 | | -template <class T> |
15 | | -class uialloc |
16 | | -{ |
17 | | -public: |
18 | | - typedef size_t size_type; |
19 | | - typedef ptrdiff_t difference_type; |
20 | | - typedef T* pointer; |
21 | | - typedef const T* const_pointer; |
22 | | - typedef T& reference; |
23 | | - typedef const T& const_reference; |
24 | | - typedef T value_type; |
25 | | - |
26 | | -public: |
27 | | - template <class _Other> |
28 | | - struct rebind |
29 | | - { |
30 | | - typedef uialloc<_Other> other; |
31 | | - }; |
32 | | - |
33 | | -public: |
34 | | - pointer address(reference _Val) const { return (&_Val); } |
35 | | - const_pointer address(const_reference _Val) const { return (&_Val); } |
36 | | - uialloc() {} |
37 | | - uialloc(const uialloc<T>&) {} |
38 | | - template <class _Other> |
39 | | - uialloc(const uialloc<_Other>&) |
40 | | - { |
41 | | - } |
42 | | - template <class _Other> |
43 | | - uialloc<T>& operator=(const uialloc<_Other>&) |
44 | | - { |
45 | | - return (*this); |
46 | | - } |
47 | | - pointer allocate(size_type n, const void* p = 0) const |
48 | | - { |
49 | | - VERIFY(1 == n); |
50 | | - return (pointer)ui_allocator.create(); |
51 | | - }; |
52 | | - char* __charalloc(size_type n) |
53 | | - { |
54 | | - VERIFY(1 == n); |
55 | | - return (char*)ui_allocator.create(); |
56 | | - }; |
57 | | - void deallocate(pointer p, size_type n) const |
58 | | - { |
59 | | - VERIFY(1 == n); |
60 | | - _12b* p_ = (_12b*)p; |
61 | | - ui_allocator.destroy(p_); |
62 | | - } |
63 | | - void deallocate(void* p, size_type n) const |
64 | | - { |
65 | | - VERIFY(1 == n); |
66 | | - _12b* p_ = (_12b*)p; |
67 | | - ui_allocator.destroy(p_); |
68 | | - } |
69 | | - void construct(pointer p, const T& _Val) { std::_Construct(p, _Val); } |
70 | | - void destroy(pointer p) { std::_Destroy(p); } |
71 | | - size_type max_size() const |
72 | | - { |
73 | | - size_type _Count = (size_type)(-1) / sizeof(T); |
74 | | - return (0 < _Count ? _Count : 1); |
75 | | - } |
76 | | -}; |
77 | | -template <class _Ty, class _Other> |
78 | | -inline bool operator==(const uialloc<_Ty>&, const uialloc<_Other>&) |
79 | | -{ |
80 | | - return (true); |
81 | | -} |
82 | | -template <class _Ty, class _Other> |
83 | | -inline bool operator!=(const uialloc<_Ty>&, const uialloc<_Other>&) |
84 | | -{ |
85 | | - return (false); |
86 | | -} |
87 | | - |
88 | | -//. template<typename T> |
89 | | -//. class ui_list : public std::list<T,uialloc<T> >{ public: u32 size() const {return (u32)__super::size(); } |
90 | | -//}; |
91 | | - |
| 4 | +//#define xr_list xr_list |
92 | 5 | #define ui_list xr_vector |
93 | 6 |
|
94 | 7 | #define DEF_UILIST(N, T) \ |
|
0 commit comments