MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ScaleDataArray

Function ScaleDataArray

src/openrct2-ui/CursorRepository.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73static std::vector<uint8_t> ScaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale)
74{
75 const size_t length = width * height;
76
77 std::vector<uint8_t> res;
78 res.resize(length * scale * scale);
79
80 for (size_t y = 0; y < height * 8; y++)
81 {
82 for (size_t x = 0; x < width; x++)
83 {
84 const bool value = GetBit(data, x, y, width);
85 if (!value)
86 continue;
87
88 DrawRect(res.data(), x, y, width, scale);
89 }
90 }
91
92 return res;
93}
94
95SDL_Cursor* CursorRepository::Create(const CursorData* cursorInfo, uint8_t scale)
96{

Callers 1

CreateMethod · 0.85

Calls 3

GetBitFunction · 0.85
DrawRectFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected