本文整理汇总了C++中dfhack::Maps::ReadDirtyBit方法的典型用法代码示例。如果您正苦于以下问题:C++ Maps::ReadDirtyBit方法的具体用法?C++ Maps::ReadDirtyBit怎么用?C++ Maps::ReadDirtyBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dfhack::Maps
的用法示例。
在下文中一共展示了Maps::ReadDirtyBit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
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)
{
hexdump(DF,blockaddr,0x1E00,filenum);
filenum++;
}
// read/write dirty bit of the block
Maps->ReadDirtyBit(cursorX+i,cursorY+j,cursorZ,dirtybit);
Maps->ReadBlockFlags(cursorX+i,cursorY+j,cursorZ,bflags);
if(digbit)
{
dirtybit = !dirtybit;
Maps->WriteDirtyBit(cursorX+i,cursorY+j,cursorZ,dirtybit);
}
}
}
}
// Resume, print stuff to the terminal
DF->Resume();
for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++)
{
mapblock40d * Block = &blocks[i+1][j+1];
for(int x = 0; x < 16; x++) for(int y = 0; y < 16; y++)
{
int color = COLOR_BLACK;
color = pickColor(Block->tiletypes[x][y]);
/*
if(!Block->designation[x][y].bits.hidden)
{
puttile(x+(i+1)*16,y+(j+1)*16,Block->tiletypes[x][y], color);
}
else*/
{
attron(A_STANDOUT);
puttile(x+(i+1)*16,y+(j+1)*16,Block->tiletypes[x][y], color);
attroff(A_STANDOUT);
}
}