MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getStringWidthNewLined

Function getStringWidthNewLined

src/OpenLoco/src/Graphics/TextRenderer.cpp:1798–1810  ·  view source on GitHub ↗

0x00495715 @param buffer @ @return width @

Source from the content-addressed store, hash-verified

1796 // @param buffer @<esi>
1797 // @return width @<cx>
1798 static uint16_t getStringWidthNewLined(Font font, const char* buffer)
1799 {
1800 uint16_t maxWidth = 0;
1801
1802 for (auto* ptr = buffer; *ptr != '\0'; ++ptr)
1803 {
1804 auto [lineWidth, nextLine, nextFont] = getStringWidthOneLine(ptr, font);
1805 ptr = nextLine;
1806 font = nextFont;
1807 maxWidth = std::max(maxWidth, lineWidth);
1808 }
1809 return maxWidth;
1810 }
1811
1812 /**
1813 * 0x004955BC

Callers 5

createErrorWindowFunction · 0.85
commonFunction · 0.85
tooltipFunction · 0.85
prepareDrawFunction · 0.85

Calls 1

getStringWidthOneLineFunction · 0.85

Tested by

no test coverage detected