MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / setTileCullingFlags

Method setTileCullingFlags

source/entities/Tile.cpp:1961–1980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1959}
1960
1961void Tile::setTileCullingFlags(uint32_t mask, bool value)
1962{
1963 // We save the current state. If the result is different, we refresh culling
1964 mTileCulling = (value ? mTileCulling | mask : mTileCulling & ~mask);
1965
1966 if(mTileCulling == CullingType::HIDE)
1967 {
1968 // We cull the tile
1969 setParentNodeDetachFlags(EntityParentNodeAttach::DETACH_CULLING, true);
1970 for(GameEntity* entity : mEntitiesInTile)
1971 entity->setParentNodeDetachFlags(EntityParentNodeAttach::DETACH_CULLING, true);
1972 }
1973 else
1974 {
1975 // Here, we want to show the tile
1976 setParentNodeDetachFlags(EntityParentNodeAttach::DETACH_CULLING, false);
1977 for(GameEntity* entity : mEntitiesInTile)
1978 entity->setParentNodeDetachFlags(EntityParentNodeAttach::DETACH_CULLING, false);
1979 }
1980}
1981
1982bool Tile::addTileStateListener(TileStateListener& listener)
1983{

Callers 3

hideAllTilesMethod · 0.80
showAllTilesMethod · 0.80
newBashAndSplashTilesMethod · 0.80

Calls 1

Tested by

no test coverage detected