MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / calc

Method calc

src/SB/Core/x/xFont.cpp:1688–1847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1686}
1687
1688void xtextbox::layout::calc(const xtextbox& ctb, size_t start_text)
1689{
1690 if (!start_text)
1691 {
1692 dynamics_size = 0;
1693 context_buffer_size = 0;
1694 _lines_size = 0;
1695 _jots_size = 0;
1696 }
1697
1698 if (!tb.texts_size)
1699 {
1700 return;
1701 }
1702
1703 start_layout(ctb);
1704
1705 jot_line& first_line = _lines[_lines_size];
1706 first_line.first = 0;
1707 first_line.bounds.w = 0.0f;
1708 first_line.bounds.x = 0.0f;
1709 first_line.bounds.y = 0.0f;
1710 first_line.baseline = 0.0f;
1711
1712 struct
1713 {
1714 const char* s;
1715 const char* end;
1716 } text_stack[16];
1717
1718 size_t text_stack_size = 0;
1719 size_t size = ((!tb.text_sizes) ? 0x40000000 : tb.text_sizes[start_text]);
1720 size_t text_index = start_text + 1;
1721 const char* s = tb.texts[start_text];
1722 const char* end = s + size;
1723 const char* r25;
1724
1725 while (true)
1726 {
1727 jot& a = _jots[_jots_size];
1728 jot_line& line = _lines[_lines_size];
1729
1730 a.context = &context_buffer[context_buffer_size];
1731 a.context_size = 0;
1732 a.reset_flags();
1733 a.cb = NULL;
1734 a.tag = NULL;
1735
1736 if (s == end || *s == '\0')
1737 {
1738 if (text_stack_size)
1739 {
1740 text_stack_size--;
1741 s = text_stack[text_stack_size].s;
1742 end = text_stack[text_stack_size].end;
1743 }
1744 else if (text_index < tb.texts_size)
1745 {

Callers

nothing calls this directly

Calls 6

start_layoutFunction · 0.85
parse_next_jotFunction · 0.85
fit_lineFunction · 0.85
stop_layoutFunction · 0.85
reset_flagsMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected