mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Get scoreboard bar working
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#include "WindowDef.h"
|
||||
#include "IOStream.h"
|
||||
#include "CoreDefs.h"
|
||||
#include "PLPasStr.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
{
|
||||
bool WindowDef::Deserialize(IOStream *stream)
|
||||
{
|
||||
struct WindowDefPart1
|
||||
@@ -40,4 +43,21 @@ namespace PortabilityLayer
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
WindowDef WindowDef::Create(const Rect &initialRect, int16_t wdefID, bool isVisible, bool hasCloseBox, uint32_t refConstant, uint16_t positionSpec, const PLPasStr &title)
|
||||
{
|
||||
WindowDef wdef;
|
||||
wdef.m_initialRect = initialRect;
|
||||
wdef.m_wdefResID = wdefID;
|
||||
wdef.m_visibilityStatus = isVisible ? 1 : 0;
|
||||
wdef.m_hasCloseBox = hasCloseBox ? 1 : 0;
|
||||
wdef.m_referenceConstant = refConstant;
|
||||
wdef.m_positionSpec = positionSpec;
|
||||
|
||||
const uint8_t titleLength = static_cast<uint8_t>(std::max<size_t>(255, title.Length()));
|
||||
wdef.m_title[0] = titleLength;
|
||||
memcpy(wdef.m_title + 1, title.UChars(), titleLength);
|
||||
|
||||
return wdef;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user