Align AVA2 Windows behavior and improve mobile touch interactions
This commit is contained in:
@@ -10,14 +10,15 @@
|
||||
template <typename T>
|
||||
class CSingleton
|
||||
{
|
||||
static T * ms_singleton;
|
||||
static CSingleton<T> * ms_singleton;
|
||||
|
||||
public:
|
||||
CSingleton()
|
||||
{
|
||||
assert(!ms_singleton);
|
||||
intptr_t offset = (intptr_t) (T*) 1 - (intptr_t) (CSingleton <T>*) (T*) 1;
|
||||
ms_singleton = (T*) ((intptr_t) this + offset);
|
||||
// Register the actual base subobject. Convert to T only after its
|
||||
// construction starts, using the compiler's multiple-inheritance adjustment.
|
||||
ms_singleton = this;
|
||||
}
|
||||
|
||||
virtual ~CSingleton()
|
||||
@@ -29,19 +30,19 @@ public:
|
||||
__forceinline static T & Instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
return *static_cast<T*>(ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T * InstancePtr()
|
||||
{
|
||||
return (ms_singleton);
|
||||
return static_cast<T*>(ms_singleton);
|
||||
}
|
||||
|
||||
__forceinline static T & instance()
|
||||
{
|
||||
assert(ms_singleton);
|
||||
return (*ms_singleton);
|
||||
return *static_cast<T*>(ms_singleton);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> T * CSingleton<T>::ms_singleton = nullptr;
|
||||
template <typename T> CSingleton<T> * CSingleton<T>::ms_singleton = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user