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

Function WhatUnitsSide

engine/Poseidon/Game/Chat.cpp:426–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424 width += GEngine->GetTextWidth(_size, _font, temp);
425 if (width > _w)
426 {
427 if (word)
428 {
429 p = word;
430 }
431 else
432 {
433 p = q;
434 }
435 lines.Add(p - buffer);
436 word = nullptr;
437 width = 0;
438 }
439 }
440 }
441
442 for (int i = lines.Size() - 1; i >= 0; i--)
443 {
444 char* line = buffer.MutableData() + lines[i];
445
446 float wline = GEngine->GetTextWidth(_size, _font, line);
447 MipInfo mip = GLOB_ENGINE->TextBank()->UseMipmap(nullptr, 0, 0);
448 GEngine->Draw2D(mip, colorB, Rect2DPixel(_x * w, top * h, wline * w, _h * h));
449 GEngine->DrawText(Point2DFloat(_x, top), _size, Rect2DFloat(_x, top, _w, _h), _font, color, line);
450 *line = 0;
451
452 row--;

Callers 1

WhatUnitsFunction · 0.85

Calls 6

NGroupsMethod · 0.80
UnitWithIDMethod · 0.80
GetPersonMethod · 0.80
IsRemotePlayerMethod · 0.80
GetGroupMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected