MCPcopy Create free account
hub / github.com/crossuo/crossuo / GetArtPixels

Method GetArtPixels

src/Managers/UOFileReader.cpp:92–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92std::vector<uint16_t>
93UOFileReader::GetArtPixels(uint16_t id, CIndexObject &io, bool run, short &width, short &height)
94{
95 uint16_t *P = (uint16_t *)io.Address;
96 uint16_t color = io.Color;
97 std::vector<uint16_t> pixels;
98 if (!run) //raw tile
99 {
100 width = 44;
101 height = 44;
102 pixels.resize(44 * 44, 0);
103 for (int i = 0; i < 22; i++)
104 {
105 int start = (22 - ((int)i + 1));
106 int pos = (int)i * 44 + start;
107 int end = start + ((int)i + 1) * 2;
108 for (int j = start; j < end; j++)
109 {
110 uint16_t val = *P++;
111 if ((color != 0u) && (val != 0u))
112 {
113 val = g_ColorManager.GetColor16(val, color);
114 }
115
116 if (val != 0u)
117 {
118 val = 0x8000 | val;
119 }
120 pixels[pos++] = val;
121 }
122 }
123
124 for (int i = 0; i < 22; i++)
125 {
126 int pos = ((int)i + 22) * 44 + (int)i;
127 int end = (int)i + (22 - (int)i) * 2;
128 for (int j = i; j < end; j++)
129 {
130 uint16_t val = *P++;
131 if ((color != 0u) && (val != 0u))
132 {
133 val = g_ColorManager.GetColor16(val, color);
134 }
135
136 if (val != 0u)
137 {
138 val = 0x8000 | val;
139 }
140 pixels[pos++] = val;
141 }
142 }
143 }
144 else //run tile
145 {
146 int stumpIndex = 0;
147 if (g_Game.IsTreeTile(id, stumpIndex))
148 {
149 uint16_t *ptr = nullptr;

Callers 1

UpdateContentMethod · 0.80

Calls 6

resizeMethod · 0.80
GetColor16Method · 0.80
IsTreeTileMethod · 0.80
IsCaveTileMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected