|
|
@ -105,20 +105,24 @@ class Block
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return raw.designation[p.x][p.y];
|
|
|
|
return raw.designation[p.x][p.y];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DFHack::t_designation setDesignationAt(Point p, DFHack::t_designation des)
|
|
|
|
bool setDesignationAt(Point p, DFHack::t_designation des)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!valid) return false;
|
|
|
|
dirty = true;
|
|
|
|
dirty = true;
|
|
|
|
//printf("setting block %d/%d/%d , %d %d\n",x,y,z, p.x, p.y);
|
|
|
|
//printf("setting block %d/%d/%d , %d %d\n",x,y,z, p.x, p.y);
|
|
|
|
raw.designation[p.x][p.y] = des;
|
|
|
|
raw.designation[p.x][p.y] = des;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool WriteDesignations ()
|
|
|
|
bool WriteDesignations ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!valid) return false;
|
|
|
|
if(dirty)
|
|
|
|
if(dirty)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//printf("writing %d/%d/%d\n",x,y,z);
|
|
|
|
//printf("writing %d/%d/%d\n",x,y,z);
|
|
|
|
m->WriteDesignations(x,y,z, &raw.designation);
|
|
|
|
m->WriteDesignations(x,y,z, &raw.designation);
|
|
|
|
m->WriteDirtyBit(x,y,z,true);
|
|
|
|
m->WriteDirtyBit(x,y,z,true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool valid;
|
|
|
|
bool valid;
|
|
|
|
bool dirty;
|
|
|
|
bool dirty;
|
|
|
@ -171,6 +175,7 @@ class Layer
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Block * nblo = new Block(Maps,blockcoord.x,blockcoord.y,z);
|
|
|
|
Block * nblo = new Block(Maps,blockcoord.x,blockcoord.y,z);
|
|
|
|
blocks[blockcoord] = nblo;
|
|
|
|
blocks[blockcoord] = nblo;
|
|
|
|
|
|
|
|
return nblo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -234,6 +239,7 @@ class Layer
|
|
|
|
p->second->WriteDesignations();
|
|
|
|
p->second->WriteDesignations();
|
|
|
|
//cout << stonetypes[p->first].id << " : " << p->second << endl;
|
|
|
|
//cout << stonetypes[p->first].id << " : " << p->second << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
bool valid;
|
|
|
|
bool valid;
|
|
|
|