Skip to content

Commit

Permalink
xrGame: removed uialloc (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jun 7, 2018
1 parent 9307acc commit 2556c5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 91 deletions.
3 changes: 0 additions & 3 deletions src/xrGame/ui/UIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "MainMenu.h"
#include "Include/xrRender/DebugRender.h"
#include "Include/xrRender/UIRender.h"
#include "xrCore/xrPool.h"

poolSS<_12b, 128> ui_allocator;

// #define LOG_ALL_WNDS
#ifdef LOG_ALL_WNDS
Expand Down
89 changes: 1 addition & 88 deletions src/xrGame/ui/UIWindow.h
Original file line number Diff line number Diff line change
@@ -1,94 +1,7 @@
#pragma once
#include "xr_level_controller.h"

// fwd. decl.
class CUIWindow;
struct _12b
{
/*DWORD*/ unsigned long _[3];
};
template <class T, int granularity> class poolSS;
extern poolSS<_12b, 128> ui_allocator;

// XXX: remove uialloc
template <class T>
class uialloc
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;

public:
template <class _Other>
struct rebind
{
typedef uialloc<_Other> other;
};

public:
pointer address(reference _Val) const { return (&_Val); }
const_pointer address(const_reference _Val) const { return (&_Val); }
uialloc() {}
uialloc(const uialloc<T>&) {}
template <class _Other>
uialloc(const uialloc<_Other>&)
{
}
template <class _Other>
uialloc<T>& operator=(const uialloc<_Other>&)
{
return (*this);
}
pointer allocate(size_type n, const void* p = 0) const
{
VERIFY(1 == n);
return (pointer)ui_allocator.create();
};
char* __charalloc(size_type n)
{
VERIFY(1 == n);
return (char*)ui_allocator.create();
};
void deallocate(pointer p, size_type n) const
{
VERIFY(1 == n);
_12b* p_ = (_12b*)p;
ui_allocator.destroy(p_);
}
void deallocate(void* p, size_type n) const
{
VERIFY(1 == n);
_12b* p_ = (_12b*)p;
ui_allocator.destroy(p_);
}
void construct(pointer p, const T& _Val) { std::_Construct(p, _Val); }
void destroy(pointer p) { std::_Destroy(p); }
size_type max_size() const
{
size_type _Count = (size_type)(-1) / sizeof(T);
return (0 < _Count ? _Count : 1);
}
};
template <class _Ty, class _Other>
inline bool operator==(const uialloc<_Ty>&, const uialloc<_Other>&)
{
return (true);
}
template <class _Ty, class _Other>
inline bool operator!=(const uialloc<_Ty>&, const uialloc<_Other>&)
{
return (false);
}

//. template<typename T>
//. class ui_list : public std::list<T,uialloc<T> >{ public: u32 size() const {return (u32)__super::size(); }
//};

//#define xr_list xr_list
#define ui_list xr_vector

#define DEF_UILIST(N, T) \
Expand Down

0 comments on commit 2556c5a

Please sign in to comment.