MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / WhatUnitsGroup

Function WhatUnitsGroup

engine/Poseidon/Game/Chat.cpp:409–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408 if (GEngine->GetTextWidth(_size, _font, buffer) > _w)
409 {
410 const char* p = buffer;
411 const char* word = nullptr;
412 float width = 0;
413 while (*p != 0)
414 {
415 const char* q = p;
416 char c = *p++;
417 if ((unsigned char)c <= 32)
418 {
419 word = p;
420 }
421 char temp[8];
422 p = buffer + CopyTextElement(buffer, static_cast<int>(q - (const char*)buffer), _font->GetLangID(),
423 temp, sizeof(temp));
424 width += GEngine->GetTextWidth(_size, _font, temp);
425 if (width > _w)
426 {
427 if (word)

Callers 1

WhatUnitsFunction · 0.85

Calls 4

UnitWithIDMethod · 0.80
GetPersonMethod · 0.80
IsRemotePlayerMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected