MCPcopy Create free account
hub / github.com/WallBreaker2/op / PackMeta

Function PackMeta

libop/input/mouse/CursorShape.cpp:181–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181std::uint64_t PackMeta(const CursorShapeInfo &info, bool valid) {
182 std::uint64_t meta = valid ? 1ull : 0ull;
183 meta |= (info.visible ? 1ull : 0ull) << 1;
184 meta |= (static_cast<std::uint64_t>(info.width) & 0xFFFFull) << 2;
185 meta |= (static_cast<std::uint64_t>(info.height) & 0xFFFFull) << 18;
186 meta |= (static_cast<std::uint64_t>(info.hot_x) & 0x7FFFull) << 34;
187 meta |= (static_cast<std::uint64_t>(info.hot_y) & 0x7FFFull) << 49;
188 return meta;
189}
190
191bool UnpackMeta(std::uint64_t meta, std::uint64_t hash, CursorShapeInfo &info) {
192 if ((meta & 1ull) == 0)

Callers 1

updateCursorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected