mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Refactor color cursor loading
This commit is contained in:
@@ -89,33 +89,6 @@ CursHandle GetCursor(int cursorID)
|
||||
return GetResource('CURS', cursorID).ReinterpretCast<Cursor>();
|
||||
}
|
||||
|
||||
CCrsrHandle GetCCursor(int cursorID)
|
||||
{
|
||||
PortabilityLayer::HostDisplayDriver *driver = PortabilityLayer::HostDisplayDriver::GetInstance();
|
||||
IGpColorCursor *hwCursor = driver->LoadColorCursor(cursorID);
|
||||
|
||||
if (!hwCursor)
|
||||
return nullptr;
|
||||
|
||||
CCrsrHandle hdl = PortabilityLayer::MemoryManager::GetInstance()->NewHandle<CCursor>();
|
||||
if (!hdl)
|
||||
{
|
||||
hwCursor->Destroy();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CCursor *ccursor = *hdl;
|
||||
ccursor->hwCursor = hwCursor;
|
||||
|
||||
return hdl;
|
||||
}
|
||||
|
||||
void SetCCursor(CCrsrHandle handle)
|
||||
{
|
||||
assert(handle);
|
||||
PortabilityLayer::HostDisplayDriver::GetInstance()->SetColorCursor((*handle)->hwCursor);
|
||||
}
|
||||
|
||||
void HideCursor()
|
||||
{
|
||||
PortabilityLayer::HostDisplayDriver::GetInstance()->SetStandardCursor(EGpStandardCursors::kHidden);
|
||||
@@ -131,13 +104,6 @@ void SetBuiltinCursor(int builtinCursor)
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
||||
void DisposeCCursor(CCrsrHandle handle)
|
||||
{
|
||||
(*handle)->hwCursor->Destroy();
|
||||
|
||||
PortabilityLayer::MemoryManager::GetInstance()->ReleaseHandle(handle.MMBlock());
|
||||
}
|
||||
|
||||
void Delay(int ticks, UInt32 *endTickCount)
|
||||
{
|
||||
PLSysCalls::Sleep(ticks);
|
||||
|
Reference in New Issue
Block a user