Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUI.cpp
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | if (it == m_ScrollBarStyles.end()) | ||||
return nullptr; | return nullptr; | ||||
return &it->second; | return &it->second; | ||||
} | } | ||||
// private struct used only in GenerateText(...) | // private struct used only in GenerateText(...) | ||||
struct SGenerateTextImage | struct SGenerateTextImage | ||||
{ | { | ||||
// Only primitve members, so move assignments are the same as copy assignments. | |||||
float m_YFrom, // The image's starting location in Y | float m_YFrom, // The image's starting location in Y | ||||
m_YTo, // The image's end location in Y | m_YTo, // The image's end location in Y | ||||
m_Indentation; // The image width in other words | m_Indentation; // The image width in other words | ||||
// Some help functions | // Some help functions | ||||
// TODO Gee: CRect => CPoint ? | // TODO Gee: CRect => CPoint ? | ||||
void SetupSpriteCall(const bool Left, SGUIText::SSpriteCall& SpriteCall, | void SetupSpriteCall(const bool Left, SGUIText::SSpriteCall& SpriteCall, | ||||
const float width, const float y, | const float width, const float y, | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | if (WordWrapping && i > pos_last_img) | ||||
const SGUIIcon& icon = GetIcon(imgname); | const SGUIIcon& icon = GetIcon(imgname); | ||||
const CSize& size = icon.m_Size; | const CSize& size = icon.m_Size; | ||||
Image.SetupSpriteCall((j == CGUIString::SFeedback::Left), SpriteCall, Width, _y, size, icon.m_SpriteName, BufferZone, icon.m_CellID); | Image.SetupSpriteCall((j == CGUIString::SFeedback::Left), SpriteCall, Width, _y, size, icon.m_SpriteName, BufferZone, icon.m_CellID); | ||||
// Check if image is the lowest thing. | // Check if image is the lowest thing. | ||||
Text.m_Size.cy = std::max(Text.m_Size.cy, Image.m_YTo); | Text.m_Size.cy = std::max(Text.m_Size.cy, Image.m_YTo); | ||||
Images[j].push_back(Image); | Images[j].emplace_back(Image); | ||||
Text.m_SpriteCalls.push_back(std::move(SpriteCall)); | Text.m_SpriteCalls.emplace_back(std::move(SpriteCall)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
pos_last_img = std::max(pos_last_img, i); | pos_last_img = std::max(pos_last_img, i); | ||||
x += Feedback.m_Size.cx; | x += Feedback.m_Size.cx; | ||||
prelim_line_height = std::max(prelim_line_height, Feedback.m_Size.cy); | prelim_line_height = std::max(prelim_line_height, Feedback.m_Size.cy); | ||||
▲ Show 20 Lines • Show All 1,154 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator