本文整理汇总了C++中dfhack::Maps::getBlockPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Maps::getBlockPtr方法的具体用法?C++ Maps::getBlockPtr怎么用?C++ Maps::getBlockPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dfhack::Maps
的用法示例。
在下文中一共展示了Maps::getBlockPtr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
Mats->ReadOrganicMaterials();
}
if(hasCreatureMats)
{
Mats->ReadCreatureTypes();
}
}
/*
if(DF.InitReadEffects(effectnum))
{
for(uint32_t i = 0; i < effectnum;i++)
{
t_effect_df40d effect;
DF.ReadEffect(i,effect);
effects.push_back(effect);
}
}
*/
for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++)
{
mapblock40d * Block = &blocks[i+1][j+1];
if(Maps->isValidBlock(cursorX+i,cursorY+j,cursorZ))
{
Maps->ReadBlock40d(cursorX+i,cursorY+j,cursorZ, Block);
// extra processing of the block in the middle
if(i == 0 && j == 0)
{
if(hasInorgMats)
do_features(DF, Block, cursorX, cursorY, 50,10, Mats->inorganic);
// read veins
Maps->ReadVeins(cursorX+i,cursorY+j,cursorZ,&veinVector,&IceVeinVector,&splatter,&grass, &wconstructs);
// get pointer to block
blockaddr = Maps->getBlockPtr(cursorX+i,cursorY+j,cursorZ);
blockaddr2 = Block->origin;
// dig all veins and trees
if(dig)
{
for(int x = 0; x < 16; x++) for(int y = 0; y < 16; y++)
{
int16_t tiletype = Block->tiletypes[x][y];
TileShape tc = tileShape(tiletype);
TileMaterial tm = tileMaterial(tiletype);
if( tc == WALL && tm == VEIN || tc == TREE_OK || tc == TREE_DEAD)
{
Block->designation[x][y].bits.dig = designation_default;
}
}
Maps->WriteDesignations(cursorX+i,cursorY+j,cursorZ, &(Block->designation));
}
// read temperature data
Maps->ReadTemperatures(cursorX+i,cursorY+j,cursorZ,&b_temp1, &b_temp2 );
if(dotwiddle)
{
bitset<32> bs = Block->designation[0][0].whole;
bs.flip(twiddle);
Block->designation[0][0].whole = bs.to_ulong();
Maps->WriteDesignations(cursorX+i,cursorY+j,cursorZ, &(Block->designation));
dotwiddle = false;
}
// do a dump of the block data
if(dump)
{