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

Function isPixelPresentBMP

src/OpenLoco/src/Paint/Paint.cpp:1113–1130  ·  view source on GitHub ↗

0x00447C21

Source from the content-addressed store, hash-verified

1111
1112 // 0x00447C21
1113 static bool isPixelPresentBMP(
1114 const ImageId image, const Gfx::G1Element& g1, const Ui::Point& coords, const Gfx::PaletteMap::View paletteMap)
1115 {
1116 const auto* index = g1.offset + (coords.y * g1.width) + coords.x;
1117
1118 // Needs investigation as it has no consideration for pure BMP maps.
1119 if (!g1.hasFlags(Gfx::G1ElementFlags::hasTransparency))
1120 {
1121 return false;
1122 }
1123
1124 if (image.hasPrimary())
1125 {
1126 return paletteMap[*index] != 0;
1127 }
1128
1129 return (*index != 0);
1130 }
1131
1132 // 0x00447D26
1133 static bool isPixelPresentRLE(const Gfx::G1Element& g1, const Ui::Point& coords)

Callers 1

Calls 2

hasPrimaryMethod · 0.80
hasFlagsMethod · 0.45

Tested by

no test coverage detected