MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getForColour

Function getForColour

src/OpenLoco/src/Graphics/PaletteMap.cpp:197–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195 }
196
197 std::optional<View> getForColour(ExtColour paletteId)
198 {
199 auto g1Index = getPaletteG1Index(paletteId);
200 if (g1Index)
201 {
202 auto g1 = getG1Element(*g1Index);
203 if (g1 != nullptr)
204 {
205 const size_t length = g1->width * g1->height;
206
207 // Palette maps must be of 256 entries per row.
208 assert((length % kDefaultSize) == 0);
209
210 return View(std::span{ g1->offset, length });
211 }
212 }
213 return std::nullopt;
214 }
215
216 std::optional<View> getForImage(const ImageId image)
217 {

Callers 4

getForImageFunction · 0.85
initColourMapFunction · 0.85
drawRectImplFunction · 0.85
isSpriteInteractedWithFunction · 0.85

Calls 2

getPaletteG1IndexFunction · 0.85
getG1ElementFunction · 0.85

Tested by

no test coverage detected