Remove port state, fix background not darkening in room editor

This commit is contained in:
elasota
2020-06-20 02:08:22 -04:00
parent 3bf689664f
commit 9d5adb9bb6
34 changed files with 45 additions and 138 deletions

View File

@@ -196,6 +196,8 @@ namespace PortabilityLayer
void HandleScreenResolutionChange(uint32_t prevWidth, uint32_t prevHeight, uint32_t newWidth, uint32_t newHeight) override;
void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b) override;
Window *GetPutInFrontSentinel() const override;
static WindowManagerImpl *GetInstance();
@@ -1163,9 +1165,6 @@ namespace PortabilityLayer
DetachWindow(window);
if (PortabilityLayer::QDManager::GetInstance()->GetPort() == windowImpl->GetDrawSurface())
PortabilityLayer::QDManager::GetInstance()->SetPort(nullptr);
windowImpl->~WindowImpl();
PortabilityLayer::MemoryManager::GetInstance()->Release(windowImpl);
}
@@ -1290,9 +1289,16 @@ namespace PortabilityLayer
void WindowManagerImpl::SwapExclusiveWindow(Window *& windowRef)
{
const bool hadExclusiveWindow = (m_exclusiveWindow != nullptr);
Window *temp = m_exclusiveWindow;
m_exclusiveWindow = static_cast<WindowImpl*>(windowRef);
windowRef = temp;
const bool haveExclusiveWindow = (m_exclusiveWindow != nullptr);
if (hadExclusiveWindow != haveExclusiveWindow)
HostDisplayDriver::GetInstance()->SetBackgroundDarkenEffect(haveExclusiveWindow);
}
void WindowManagerImpl::FlickerWindowIn(Window *window, int32_t velocity)
@@ -1472,6 +1478,11 @@ namespace PortabilityLayer
}
}
void WindowManagerImpl::SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b)
{
HostDisplayDriver::GetInstance()->SetBackgroundColor(r, g, b, 255);
}
void WindowManagerImpl::ResizeWindow(Window *window, int width, int height)
{
static_cast<WindowImpl*>(window)->Resize(width, height);