MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / PrintShape

Method PrintShape

src/Utilities/ShapeTextPrinter.cpp:3–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "ShapeTextPrinter.h"
2
3void ShapeTextPrinter::PrintShape
4(
5 const char* text,
6 ShapeTextPrintData& data,
7 Point2D position,
8 RectangleStruct& bounds,
9 DSurface* pSurface,
10 Point2D offset,
11 BlitterFlags blitterFlags,
12 int brightness,
13 int tintColor
14)
15{
16 const int length = strlen(text);
17 std::vector<int> frames;
18 frames.reserve(length);
19
20 for (int i = 0; i < length; i++)
21 {
22 int frame = 0;
23
24 if (isdigit(text[i]))
25 {
26 frame = data.BaseNumberFrame + text[i] - '0';
27 }
28 else
29 {
30 size_t signIndex = SignSequence.find(text[i]);
31
32 if (signIndex < SignSequence.size())
33 frame = data.BaseExtraFrame + signIndex;
34 else
35 return;
36 }
37
38 frames.emplace_back(frame);
39 }
40
41 for (int frame : frames)
42 {
43 pSurface->DrawSHP
44 (
45 const_cast<ConvertClass*>(data.Palette),
46 const_cast<SHPStruct*>(data.Shape),
47 frame,
48 &position,
49 &bounds,
50 BlitterFlags::None,
51 0,
52 0,
53 ZGradient::Ground,
54 brightness,
55 tintColor,
56 nullptr,
57 0,
58 0,
59 0
60 );

Callers

nothing calls this directly

Calls 2

findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected