|
|
@ -280,6 +280,7 @@ main(int argc, char *argv[])
|
|
|
|
vector<DFHack::t_matgloss> stonetypes;
|
|
|
|
vector<DFHack::t_matgloss> stonetypes;
|
|
|
|
vector< vector <uint16_t> > layerassign;
|
|
|
|
vector< vector <uint16_t> > layerassign;
|
|
|
|
vector<t_vein> veinVector;
|
|
|
|
vector<t_vein> veinVector;
|
|
|
|
|
|
|
|
vector<t_frozenliquidvein> IceVeinVector;
|
|
|
|
|
|
|
|
|
|
|
|
// init the API
|
|
|
|
// init the API
|
|
|
|
DFHack::API DF("Memory.xml");
|
|
|
|
DFHack::API DF("Memory.xml");
|
|
|
@ -449,7 +450,8 @@ main(int argc, char *argv[])
|
|
|
|
DF.WriteDirtyBit(cursorX+i,cursorY+j,cursorZ,dirtybit);
|
|
|
|
DF.WriteDirtyBit(cursorX+i,cursorY+j,cursorZ,dirtybit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
veinVector.clear();
|
|
|
|
veinVector.clear();
|
|
|
|
DF.ReadVeins(cursorX+i,cursorY+j,cursorZ,veinVector);
|
|
|
|
IceVeinVector.clear();
|
|
|
|
|
|
|
|
DF.ReadVeins(cursorX+i,cursorY+j,cursorZ,veinVector,IceVeinVector);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -459,37 +461,20 @@ main(int argc, char *argv[])
|
|
|
|
gotoxy(0,49);
|
|
|
|
gotoxy(0,49);
|
|
|
|
cprintf("+,- = switch vein");
|
|
|
|
cprintf("+,- = switch vein");
|
|
|
|
gotoxy(0,50);
|
|
|
|
gotoxy(0,50);
|
|
|
|
if(vein == veinVector.size()) vein = veinVector.size() - 1;
|
|
|
|
uint32_t mineralsize = veinVector.size();
|
|
|
|
|
|
|
|
uint32_t icesize = IceVeinVector.size();
|
|
|
|
|
|
|
|
uint32_t totalVeinSize = mineralsize+ icesize;
|
|
|
|
|
|
|
|
if(vein == totalVeinSize) vein = totalVeinSize - 1;
|
|
|
|
if(vein < -1) vein = -1;
|
|
|
|
if(vein < -1) vein = -1;
|
|
|
|
cprintf("X %d/%d, Y %d/%d, Z %d/%d. Vein %d of %d",cursorX+1,x_max,cursorY+1,y_max,cursorZ,z_max,vein+1,veinVector.size());
|
|
|
|
cprintf("X %d/%d, Y %d/%d, Z %d/%d. Vein %d of %d",cursorX+1,x_max,cursorY+1,y_max,cursorZ,z_max,vein+1,totalVeinSize);
|
|
|
|
if(!veinVector.empty())
|
|
|
|
if(!veinVector.empty() || !IceVeinVector.empty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(vein != -1 && vein < veinVector.size())
|
|
|
|
if(vein != -1 && vein < totalVeinSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//string str = getGCCClassName(p, veinVector[vein].vtable);
|
|
|
|
uint32_t realvein = 0;
|
|
|
|
string className = p->readClassName(veinVector[vein].vtable);
|
|
|
|
if(vein < mineralsize)
|
|
|
|
//string str = "34block_square_event_frozen_liquidst";
|
|
|
|
|
|
|
|
if(className == "block_square_event_frozen_liquid")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
t_frozenliquidvein frozen;
|
|
|
|
|
|
|
|
uint32_t size = sizeof(t_frozenliquidvein);
|
|
|
|
|
|
|
|
p->read(veinVector[vein].address_of,size,(uint8_t *)&frozen);
|
|
|
|
|
|
|
|
for(uint32_t i = 0;i<16;i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (uint32_t j = 0; j< 16;j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int color = COLOR_BLACK;
|
|
|
|
|
|
|
|
int tile = frozen.tiles[i][j];
|
|
|
|
|
|
|
|
color = pickColor(tile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attron(A_STANDOUT);
|
|
|
|
|
|
|
|
puttile(i+16,j+16,tile, color);
|
|
|
|
|
|
|
|
attroff(A_STANDOUT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (className == "block_square_event_mineral")
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
realvein = vein;
|
|
|
|
//iterate through vein rows
|
|
|
|
//iterate through vein rows
|
|
|
|
for(uint32_t j = 0;j<16;j++)
|
|
|
|
for(uint32_t j = 0;j<16;j++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -497,31 +482,45 @@ main(int argc, char *argv[])
|
|
|
|
for (uint32_t k = 0; k< 16;k++)
|
|
|
|
for (uint32_t k = 0; k< 16;k++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// and the bit array with a one-bit mask, check if the bit is set
|
|
|
|
// and the bit array with a one-bit mask, check if the bit is set
|
|
|
|
bool set = !!(((1 << k) & veinVector[vein].assignment[j]) >> k);
|
|
|
|
bool set = !!(((1 << k) & veinVector[realvein].assignment[j]) >> k);
|
|
|
|
if(set)
|
|
|
|
if(set)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
putch(k+16,j+16,'$',COLOR_RED);
|
|
|
|
putch(k+16,j+16,'$',COLOR_RED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gotoxy(0,53);
|
|
|
|
|
|
|
|
cprintf("%s",stonetypes[veinVector[vein].type].name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gotoxy(0,51);
|
|
|
|
gotoxy(0,51);
|
|
|
|
cprintf("%s, addr 0x%x, vptr 0x%x",className.c_str(),veinVector[vein].address_of, veinVector[vein].vtable);
|
|
|
|
cprintf("Mineral: %s",stonetypes[veinVector[vein].type].name);
|
|
|
|
gotoxy(0,52);
|
|
|
|
}
|
|
|
|
int32_t classID;
|
|
|
|
else
|
|
|
|
if(p->getDescriptor()->resolveClassId(veinVector[vein].address_of,classID))
|
|
|
|
{
|
|
|
|
|
|
|
|
realvein = vein - mineralsize;
|
|
|
|
|
|
|
|
t_frozenliquidvein &frozen = IceVeinVector[realvein];
|
|
|
|
|
|
|
|
for(uint32_t i = 0;i<16;i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (uint32_t j = 0; j< 16;j++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cprintf("mxml: %s",classes[classID].c_str());
|
|
|
|
int color = COLOR_BLACK;
|
|
|
|
|
|
|
|
int tile = frozen.tiles[i][j];
|
|
|
|
|
|
|
|
color = pickColor(tile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attron(A_STANDOUT);
|
|
|
|
|
|
|
|
puttile(i+16,j+16,tile, color);
|
|
|
|
|
|
|
|
attroff(A_STANDOUT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gotoxy(0,51);
|
|
|
|
|
|
|
|
cprintf("ICE");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint32_t sptr = blockaddr + p->getDescriptor()->getOffset("block_flags");
|
|
|
|
uint32_t sptr = blockaddr + p->getDescriptor()->getOffset("block_flags");
|
|
|
|
gotoxy (0,54);
|
|
|
|
gotoxy (0,52);
|
|
|
|
cprintf("block address 0x%x",blockaddr);
|
|
|
|
cprintf("block address 0x%x",blockaddr);
|
|
|
|
gotoxy (0,55);
|
|
|
|
gotoxy (0,53);
|
|
|
|
cprintf("dirty bit: %d",dirtybit);
|
|
|
|
cprintf("dirty bit: %d",dirtybit);
|
|
|
|
|
|
|
|
gotoxy (0,54);
|
|
|
|
|
|
|
|
cprintf ("d - dig veins, o - dump map block, z - toggle dirty bit");
|
|
|
|
wrefresh(stdscr);
|
|
|
|
wrefresh(stdscr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pDF = 0;
|
|
|
|
pDF = 0;
|
|
|
|