MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getBit

Method getBit

library/voxel.cpp:8–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6VoxelSlice::VoxelSlice(Vec2<int> size) : size(size), bits(size.x * size.y) {}
7
8bool VoxelSlice::getBit(Vec2<int> pos) const
9{
10 if (pos.x < 0 || pos.x >= this->size.x || pos.y < 0 || pos.y >= this->size.y)
11 {
12 return false;
13 }
14
15 return this->bits[pos.y * this->size.x + pos.x];
16}
17
18void VoxelSlice::setBit(Vec2<int> pos, bool b)
19{

Callers 5

findCollisionMethod · 0.80
readBattleMapPartsMethod · 0.80
loadImageMethod · 0.80
check_voxelFunction · 0.80
check_sliceFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 2

check_voxelFunction · 0.64
check_sliceFunction · 0.64