mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
More work. Audio driver works enough to play music now.
This commit is contained in:
43
PortabilityLayer/WindowDef.cpp
Normal file
43
PortabilityLayer/WindowDef.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "WindowDef.h"
|
||||
#include "IOStream.h"
|
||||
#include "CoreDefs.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
bool WindowDef::Deserialize(IOStream *stream)
|
||||
{
|
||||
struct WindowDefPart1
|
||||
{
|
||||
BERect m_initialRect;
|
||||
BEInt16_t m_wdefResID;
|
||||
BEUInt16_t m_visibilityStatus;
|
||||
BEUInt16_t m_hasCloseBox;
|
||||
BEUInt32_t m_referenceConstant;
|
||||
uint8_t m_titleLength;
|
||||
};
|
||||
|
||||
PL_STATIC_ASSERT(sizeof(WindowDefPart1) == 19);
|
||||
|
||||
WindowDefPart1 wdefPart1;
|
||||
|
||||
if (stream->Read(&wdefPart1, sizeof(wdefPart1)) != sizeof(wdefPart1))
|
||||
return false;
|
||||
|
||||
m_initialRect = wdefPart1.m_initialRect.ToRect();
|
||||
m_wdefResID = wdefPart1.m_wdefResID;
|
||||
m_visibilityStatus = wdefPart1.m_visibilityStatus;
|
||||
m_hasCloseBox = wdefPart1.m_hasCloseBox;
|
||||
m_referenceConstant = wdefPart1.m_referenceConstant;
|
||||
|
||||
m_title[0] = wdefPart1.m_titleLength;
|
||||
if (stream->Read(m_title + 1, wdefPart1.m_titleLength) != wdefPart1.m_titleLength)
|
||||
return false;
|
||||
|
||||
if (stream->Read(&m_positionSpec, 2) == 2)
|
||||
ByteSwap::BigUInt16(m_positionSpec);
|
||||
else
|
||||
m_positionSpec = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user