|
|
|
@ -11,6 +11,7 @@
|
|
|
|
|
#define DFHACK_WANT_MISCUTILS 1
|
|
|
|
|
#define DFHACK_WANT_TILETYPES 1
|
|
|
|
|
#include <DFHack.h>
|
|
|
|
|
#include <dfhack/extra/MapExtras.h>
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
|
int main (int numargs, const char ** args)
|
|
|
|
@ -39,6 +40,15 @@ int main (int numargs, const char ** args)
|
|
|
|
|
DFHack::VersionInfo* mem = DF->getMemoryInfo();
|
|
|
|
|
DFHack::Maps *Maps = DF->getMaps();
|
|
|
|
|
DFHack::Process * p = DF->getProcess();
|
|
|
|
|
|
|
|
|
|
if(!Maps->Start())
|
|
|
|
|
{
|
|
|
|
|
cerr << "Unable to access map data!" << endl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MapExtras::MapCache mc (Maps);
|
|
|
|
|
|
|
|
|
|
OffsetGroup *mapsg = mem->getGroup("Maps");
|
|
|
|
|
OffsetGroup *mapblockg = mapsg->getGroup("block");
|
|
|
|
|
|
|
|
|
@ -57,8 +67,6 @@ int main (int numargs, const char ** args)
|
|
|
|
|
p->readDWord (region_y_offset, (uint32_t &)regionY);
|
|
|
|
|
p->readDWord (region_z_offset, (uint32_t &)regionZ);
|
|
|
|
|
|
|
|
|
|
Maps->Start();
|
|
|
|
|
|
|
|
|
|
vector<DFHack::t_feature> global_features;
|
|
|
|
|
std::map <DFHack::DFCoord, std::vector<DFHack::t_feature *> > local_features;
|
|
|
|
|
|
|
|
|
@ -69,23 +77,28 @@ int main (int numargs, const char ** args)
|
|
|
|
|
Gui->getCursorCoords(cursorX,cursorY,cursorZ);
|
|
|
|
|
if(cursorX != -30000)
|
|
|
|
|
{
|
|
|
|
|
DFCoord cursor (cursorX,cursorY,cursorZ);
|
|
|
|
|
|
|
|
|
|
uint32_t blockX = cursorX / 16;
|
|
|
|
|
uint32_t tileX = cursorX % 16;
|
|
|
|
|
uint32_t blockY = cursorY / 16;
|
|
|
|
|
uint32_t tileY = cursorY % 16;
|
|
|
|
|
t_temperatures tmpb1, tmpb2;
|
|
|
|
|
mapblock40d block;
|
|
|
|
|
if(Maps->ReadBlock40d(blockX,blockY,cursorZ,&block))
|
|
|
|
|
|
|
|
|
|
MapExtras::Block * b = mc.BlockAt(cursor/16);
|
|
|
|
|
mapblock40d & block = b->raw;
|
|
|
|
|
if(b)
|
|
|
|
|
{
|
|
|
|
|
Maps->ReadTemperatures(blockX,blockY,cursorZ,&tmpb1, &tmpb2);
|
|
|
|
|
printf("block addr: 0x%x\n", block.origin);
|
|
|
|
|
int16_t tiletype = block.tiletypes[tileX][tileY];
|
|
|
|
|
int16_t tiletype = mc.tiletypeAt(cursor);
|
|
|
|
|
naked_designation &des = block.designation[tileX][tileY].bits;
|
|
|
|
|
|
|
|
|
|
uint32_t designato = block.origin + designatus + (tileX * 16 + tileY) * sizeof(t_designation);
|
|
|
|
|
uint32_t occupr = block.origin + occup + (tileX * 16 + tileY) * sizeof(t_occupancy);
|
|
|
|
|
|
|
|
|
|
printf("designation offset: 0x%x\n", designato);
|
|
|
|
|
print_bits<uint32_t>(block.designation[tileX][tileY].whole,std::cout);
|
|
|
|
|
std::cout << endl;
|
|
|
|
|
|
|
|
|
|
printf("occupancy offset: 0x%x\n", occupr);
|
|
|
|
|
print_bits<uint32_t>(block.occupancy[tileX][tileY].whole,std::cout);
|
|
|
|
|
std::cout << endl;
|
|
|
|
@ -103,8 +116,8 @@ int main (int numargs, const char ** args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
std::cout <<"temperature1: " << tmpb1[tileX][tileY] << " U" << std::endl;
|
|
|
|
|
std::cout <<"temperature2: " << tmpb2[tileX][tileY] << " U" << std::endl;
|
|
|
|
|
std::cout <<"temperature1: " << mc.temperature1At(cursor) << " U" << std::endl;
|
|
|
|
|
std::cout <<"temperature2: " << mc.temperature2At(cursor) << " U" << std::endl;
|
|
|
|
|
|
|
|
|
|
// biome, geolayer
|
|
|
|
|
std::cout << "biome: " << des.biome << std::endl;
|
|
|
|
@ -148,7 +161,6 @@ int main (int numargs, const char ** args)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PRINT_FLAG( feature_global );
|
|
|
|
|
|
|
|
|
|
if( des.feature_global && have_global )
|
|
|
|
@ -166,6 +178,7 @@ int main (int numargs, const char ** args)
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DF->Detach();
|
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
|
std::cout << "Press any key to refresh..." << std::endl;
|
|
|
|
|