Refactor QD ports so they no longer need to be the first member of draw surfaces

This commit is contained in:
elasota
2020-05-20 23:33:17 -04:00
parent f53dc21475
commit 66fc278ce9
18 changed files with 29 additions and 154 deletions

View File

@@ -46,15 +46,10 @@ void OffsetRect(Rect *rect, int right, int down)
DrawSurface *GetGraphicsPort()
{
PortabilityLayer::QDPort *port = PortabilityLayer::QDManager::GetInstance()->GetPort();
DrawSurface *grafPtr = reinterpret_cast<DrawSurface *>(port);
assert(&grafPtr->m_port == port);
return grafPtr;
return PortabilityLayer::QDManager::GetInstance()->GetPort();
}
void SetGraphicsPort(DrawSurface *gw)
{
PortabilityLayer::QDManager::GetInstance()->SetPort(&gw->m_port);
PortabilityLayer::QDManager::GetInstance()->SetPort(gw);
}