Fixes
This commit is contained in:
@@ -52,11 +52,11 @@ GraphicsService GraphicsServiceInstance;
|
|||||||
|
|
||||||
void Graphics::DisposeDevice()
|
void Graphics::DisposeDevice()
|
||||||
{
|
{
|
||||||
// Clean any danging pointer to last task (might stay if engine is disposing after crash)
|
|
||||||
GPUDevice::Instance->CurrentTask = nullptr;
|
|
||||||
|
|
||||||
if (GPUDevice::Instance)
|
if (GPUDevice::Instance)
|
||||||
{
|
{
|
||||||
|
// Clean any danging pointer to last task (might stay if engine is disposing after crash)
|
||||||
|
GPUDevice::Instance->CurrentTask = nullptr;
|
||||||
|
|
||||||
GPUDevice::Instance->Dispose();
|
GPUDevice::Instance->Dispose();
|
||||||
LOG_FLUSH();
|
LOG_FLUSH();
|
||||||
Delete(GPUDevice::Instance);
|
Delete(GPUDevice::Instance);
|
||||||
|
|||||||
@@ -43,20 +43,6 @@ namespace
|
|||||||
XTaskQueueRegistrationToken UserDeviceAssociationChangedCallbackToken;
|
XTaskQueueRegistrationToken UserDeviceAssociationChangedCallbackToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
User* FindUser(const XUserLocalId& id)
|
|
||||||
{
|
|
||||||
User* result = nullptr;
|
|
||||||
for (auto& user : Platform::Users)
|
|
||||||
{
|
|
||||||
if (user->LocalId.value == id.value)
|
|
||||||
{
|
|
||||||
result = user;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
@@ -98,7 +84,7 @@ void CALLBACK UserChangeEventCallback(_In_opt_ void* context, _In_ XUserLocalId
|
|||||||
{
|
{
|
||||||
LOG(Info, "User event (userLocalId: {0}, event: {1})", userLocalId.value, (int32)event);
|
LOG(Info, "User event (userLocalId: {0}, event: {1})", userLocalId.value, (int32)event);
|
||||||
|
|
||||||
auto user = FindUser(userLocalId);
|
auto user = Platform::FindUser(userLocalId);
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case XUserChangeEvent::SignedInAgain:
|
case XUserChangeEvent::SignedInAgain:
|
||||||
@@ -131,13 +117,13 @@ void CALLBACK UserDeviceAssociationChangedCallback(_In_opt_ void* context,_In_ c
|
|||||||
{
|
{
|
||||||
LOG(Info, "User device association event (deviceId: {0}, oldUser: {1}, newUser: {2})", ToString(change->deviceId), change->oldUser.value, change->newUser.value);
|
LOG(Info, "User device association event (deviceId: {0}, oldUser: {1}, newUser: {2})", ToString(change->deviceId), change->oldUser.value, change->newUser.value);
|
||||||
|
|
||||||
User* oldGameUser = FindUser(change->oldUser);
|
User* oldGameUser = Platform::FindUser(change->oldUser);
|
||||||
if (oldGameUser)
|
if (oldGameUser)
|
||||||
{
|
{
|
||||||
oldGameUser->AssociatedDevices.Remove(change->deviceId);
|
oldGameUser->AssociatedDevices.Remove(change->deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
User* newGameUser = FindUser(change->newUser);
|
User* newGameUser = Platform::FindUser(change->newUser);
|
||||||
if (newGameUser)
|
if (newGameUser)
|
||||||
{
|
{
|
||||||
newGameUser->AssociatedDevices.Add(change->deviceId);
|
newGameUser->AssociatedDevices.Add(change->deviceId);
|
||||||
@@ -184,7 +170,7 @@ void CALLBACK AddUserComplete(_In_ XAsyncBlock* ab)
|
|||||||
XUserLocalId localId;
|
XUserLocalId localId;
|
||||||
XUserGetLocalId(userHandle, &localId);
|
XUserGetLocalId(userHandle, &localId);
|
||||||
|
|
||||||
if (FindUser(localId) == nullptr)
|
if (Platform::FindUser(localId) == nullptr)
|
||||||
{
|
{
|
||||||
// Login
|
// Login
|
||||||
auto user = New<User>(userHandle, userLocalId, String::Empty);
|
auto user = New<User>(userHandle, userLocalId, String::Empty);
|
||||||
@@ -326,6 +312,20 @@ bool GDKPlatform::IsRunningOnDevKit()
|
|||||||
return deviceType == XSystemDeviceType::XboxOneXDevkit || deviceType == XSystemDeviceType::XboxScarlettDevkit;
|
return deviceType == XSystemDeviceType::XboxOneXDevkit || deviceType == XSystemDeviceType::XboxScarlettDevkit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
User* GDKPlatform::FindUser(const XUserLocalId& id)
|
||||||
|
{
|
||||||
|
User* result = nullptr;
|
||||||
|
for (auto& user : Platform::Users)
|
||||||
|
{
|
||||||
|
if (user->LocalId.value == id.value)
|
||||||
|
{
|
||||||
|
result = user;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool GDKPlatform::Init()
|
bool GDKPlatform::Init()
|
||||||
{
|
{
|
||||||
if (Win32Platform::Init())
|
if (Win32Platform::Init())
|
||||||
@@ -425,10 +425,12 @@ void GDKPlatform::Exit()
|
|||||||
XTaskQueueCloseHandle(TaskQueue);
|
XTaskQueueCloseHandle(TaskQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
UnregisterAppStateChangeNotification(Plm);
|
if (Plm)
|
||||||
|
UnregisterAppStateChangeNotification(Plm);
|
||||||
CloseHandle(PlmSuspendComplete);
|
if (PlmSuspendComplete)
|
||||||
CloseHandle(PlmSignalResume);
|
CloseHandle(PlmSuspendComplete);
|
||||||
|
if (PlmSignalResume)
|
||||||
|
CloseHandle(PlmSignalResume);
|
||||||
|
|
||||||
UnregisterClassW(ApplicationWindowClass, nullptr);
|
UnregisterClassW(ApplicationWindowClass, nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public:
|
|||||||
|
|
||||||
static bool IsRunningOnDevKit();
|
static bool IsRunningOnDevKit();
|
||||||
|
|
||||||
|
static User* FindUser(const struct XUserLocalId& id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Win32Platform]
|
// [Win32Platform]
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ void ScriptingObject::OnDeleteObject()
|
|||||||
|
|
||||||
String ScriptingObject::ToString() const
|
String ScriptingObject::ToString() const
|
||||||
{
|
{
|
||||||
return _type ? String(_type.GetType().ManagedClass->GetFullName()) : String::Empty;
|
return _type ? String(_type.GetType().Fullname) : String::Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
|
ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
|
||||||
|
|||||||
@@ -394,9 +394,26 @@ namespace Flax.Build.Bindings
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Filter condition
|
// Filter condition
|
||||||
condition = condition.Replace("1|1", "1");
|
bool modified;
|
||||||
condition = condition.Replace("1|0", "1");
|
do
|
||||||
condition = condition.Replace("0|1", "1");
|
{
|
||||||
|
modified = false;
|
||||||
|
if (condition.Contains("1|1"))
|
||||||
|
{
|
||||||
|
condition = condition.Replace("1|1", "1");
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
if (condition.Contains("1|0"))
|
||||||
|
{
|
||||||
|
condition = condition.Replace("1|0", "1");
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
if (condition.Contains("0|1"))
|
||||||
|
{
|
||||||
|
condition = condition.Replace("0|1", "1");
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
} while (modified);
|
||||||
|
|
||||||
// Skip chunk of code of condition fails
|
// Skip chunk of code of condition fails
|
||||||
if (condition != "1")
|
if (condition != "1")
|
||||||
|
|||||||
Reference in New Issue
Block a user