mirror of
https://github.com/elasota/Aerofoil.git
synced 2026-03-01 21:34:15 +00:00
More work. Audio driver works enough to play music now.
This commit is contained in:
31
PortabilityLayer/QDUtils.cpp
Normal file
31
PortabilityLayer/QDUtils.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "QDUtils.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "SharedTypes.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
Region **QDUtils::CreateRegion(const Rect &rect)
|
||||
{
|
||||
PL_STATIC_ASSERT(sizeof(Region) == 10);
|
||||
|
||||
Region **rgnHandle = MemoryManager::GetInstance()->NewHandle<Region>();
|
||||
if (!rgnHandle)
|
||||
return nullptr;
|
||||
|
||||
Region ®ion = (**rgnHandle);
|
||||
region.rect = rect;
|
||||
region.size = sizeof(Region);
|
||||
|
||||
return rgnHandle;
|
||||
}
|
||||
|
||||
void QDUtils::ResetRegionToRect(Region **regionHdl, const Rect &rect)
|
||||
{
|
||||
if (MemoryManager::GetInstance()->ResizeHandle(reinterpret_cast<MMHandleBlock*>(regionHdl), sizeof(Region)))
|
||||
{
|
||||
Region ®ion = **regionHdl;
|
||||
region.size = sizeof(Region);
|
||||
region.rect = rect;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user