mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
parent
24bb72138d
commit
291e50acf3
@ -199,7 +199,7 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config::Settings::AltTabFix::OFF == Config::altTabFix.get())
|
if (Config::Settings::AltTabFix::KEEPVIDMEM != Config::altTabFix.get())
|
||||||
{
|
{
|
||||||
return LOG_RESULT(g_origDDrawWindowProc(hwnd, WM_ACTIVATEAPP, wParam, lParam));
|
return LOG_RESULT(g_origDDrawWindowProc(hwnd, WM_ACTIVATEAPP, wParam, lParam));
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ namespace
|
|||||||
{
|
{
|
||||||
auto lcl = DDraw::DirectDrawSurface::getInt(*surface.getDDS()).lpLcl;
|
auto lcl = DDraw::DirectDrawSurface::getInt(*surface.getDDS()).lpLcl;
|
||||||
if (!(lcl->dwFlags & DDRAWISURF_INVALID) &&
|
if (!(lcl->dwFlags & DDRAWISURF_INVALID) &&
|
||||||
(keepPrimary || !(surface.getOrigCaps() & DDSCAPS_PRIMARYSURFACE)))
|
(keepPrimary || !surface.isPrimary()))
|
||||||
{
|
{
|
||||||
lcl->dwFlags |= DDRAWISURF_INVALID;
|
lcl->dwFlags |= DDRAWISURF_INVALID;
|
||||||
surfacesToRestore.insert(lcl);
|
surfacesToRestore.insert(lcl);
|
||||||
@ -236,7 +236,7 @@ namespace
|
|||||||
auto realPrimary(DDraw::RealPrimarySurface::getSurface());
|
auto realPrimary(DDraw::RealPrimarySurface::getSurface());
|
||||||
if (realPrimary)
|
if (realPrimary)
|
||||||
{
|
{
|
||||||
realPrimary->Restore(realPrimary);
|
DDraw::RealPrimarySurface::restore();
|
||||||
auto gdiResource = DDraw::PrimarySurface::getGdiResource();
|
auto gdiResource = DDraw::PrimarySurface::getGdiResource();
|
||||||
if (gdiResource)
|
if (gdiResource)
|
||||||
{
|
{
|
||||||
|
@ -274,6 +274,13 @@ namespace DDraw
|
|||||||
{
|
{
|
||||||
resource->setAsPrimary();
|
resource->setAsPrimary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto surf = DDraw::Surface::getSurface(*surface);
|
||||||
|
if (surf)
|
||||||
|
{
|
||||||
|
surf->setAsPrimary();
|
||||||
|
}
|
||||||
|
|
||||||
CompatPtr<IDirectDrawSurface7> next;
|
CompatPtr<IDirectDrawSurface7> next;
|
||||||
result = surface->GetAttachedSurface(surface, &caps, &next.getRef());
|
result = surface->GetAttachedSurface(surface, &caps, &next.getRef());
|
||||||
next.swap(surface);
|
next.swap(surface);
|
||||||
|
@ -52,6 +52,7 @@ namespace DDraw
|
|||||||
, m_refCount(0)
|
, m_refCount(0)
|
||||||
, m_sizeOverride{}
|
, m_sizeOverride{}
|
||||||
, m_sysMemBuffer(nullptr, &heapFree)
|
, m_sysMemBuffer(nullptr, &heapFree)
|
||||||
|
, m_isPrimary(false)
|
||||||
{
|
{
|
||||||
g_surfaces.insert(this);
|
g_surfaces.insert(this);
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,10 @@ namespace DDraw
|
|||||||
template <typename TSurface>
|
template <typename TSurface>
|
||||||
SurfaceImpl<TSurface>* getImpl() const;
|
SurfaceImpl<TSurface>* getImpl() const;
|
||||||
|
|
||||||
|
bool isPrimary() const { return m_isPrimary; }
|
||||||
virtual void restore();
|
virtual void restore();
|
||||||
|
|
||||||
|
void setAsPrimary() { m_isPrimary = true; }
|
||||||
void setSizeOverride(DWORD width, DWORD height);
|
void setSizeOverride(DWORD width, DWORD height);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -71,5 +73,6 @@ namespace DDraw
|
|||||||
DWORD m_refCount;
|
DWORD m_refCount;
|
||||||
SIZE m_sizeOverride;
|
SIZE m_sizeOverride;
|
||||||
std::unique_ptr<void, void(*)(void*)> m_sysMemBuffer;
|
std::unique_ptr<void, void(*)(void*)> m_sysMemBuffer;
|
||||||
|
bool m_isPrimary;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user