Fixes
This commit is contained in:
@@ -52,11 +52,11 @@ GraphicsService GraphicsServiceInstance;
|
||||
|
||||
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)
|
||||
{
|
||||
// Clean any danging pointer to last task (might stay if engine is disposing after crash)
|
||||
GPUDevice::Instance->CurrentTask = nullptr;
|
||||
|
||||
GPUDevice::Instance->Dispose();
|
||||
LOG_FLUSH();
|
||||
Delete(GPUDevice::Instance);
|
||||
|
||||
@@ -43,20 +43,6 @@ namespace
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
auto user = FindUser(userLocalId);
|
||||
auto user = Platform::FindUser(userLocalId);
|
||||
switch (event)
|
||||
{
|
||||
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);
|
||||
|
||||
User* oldGameUser = FindUser(change->oldUser);
|
||||
User* oldGameUser = Platform::FindUser(change->oldUser);
|
||||
if (oldGameUser)
|
||||
{
|
||||
oldGameUser->AssociatedDevices.Remove(change->deviceId);
|
||||
}
|
||||
|
||||
User* newGameUser = FindUser(change->newUser);
|
||||
User* newGameUser = Platform::FindUser(change->newUser);
|
||||
if (newGameUser)
|
||||
{
|
||||
newGameUser->AssociatedDevices.Add(change->deviceId);
|
||||
@@ -184,7 +170,7 @@ void CALLBACK AddUserComplete(_In_ XAsyncBlock* ab)
|
||||
XUserLocalId localId;
|
||||
XUserGetLocalId(userHandle, &localId);
|
||||
|
||||
if (FindUser(localId) == nullptr)
|
||||
if (Platform::FindUser(localId) == nullptr)
|
||||
{
|
||||
// Login
|
||||
auto user = New<User>(userHandle, userLocalId, String::Empty);
|
||||
@@ -326,6 +312,20 @@ bool GDKPlatform::IsRunningOnDevKit()
|
||||
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()
|
||||
{
|
||||
if (Win32Platform::Init())
|
||||
@@ -425,10 +425,12 @@ void GDKPlatform::Exit()
|
||||
XTaskQueueCloseHandle(TaskQueue);
|
||||
}
|
||||
|
||||
UnregisterAppStateChangeNotification(Plm);
|
||||
|
||||
CloseHandle(PlmSuspendComplete);
|
||||
CloseHandle(PlmSignalResume);
|
||||
if (Plm)
|
||||
UnregisterAppStateChangeNotification(Plm);
|
||||
if (PlmSuspendComplete)
|
||||
CloseHandle(PlmSuspendComplete);
|
||||
if (PlmSignalResume)
|
||||
CloseHandle(PlmSignalResume);
|
||||
|
||||
UnregisterClassW(ApplicationWindowClass, nullptr);
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ public:
|
||||
|
||||
static bool IsRunningOnDevKit();
|
||||
|
||||
static User* FindUser(const struct XUserLocalId& id);
|
||||
|
||||
public:
|
||||
|
||||
// [Win32Platform]
|
||||
|
||||
@@ -414,7 +414,7 @@ void ScriptingObject::OnDeleteObject()
|
||||
|
||||
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)
|
||||
|
||||
@@ -394,9 +394,26 @@ namespace Flax.Build.Bindings
|
||||
}
|
||||
|
||||
// Filter condition
|
||||
condition = condition.Replace("1|1", "1");
|
||||
condition = condition.Replace("1|0", "1");
|
||||
condition = condition.Replace("0|1", "1");
|
||||
bool modified;
|
||||
do
|
||||
{
|
||||
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
|
||||
if (condition != "1")
|
||||
|
||||
Reference in New Issue
Block a user