2010-04-02 19:52:46 -06:00
|
|
|
// Just show some position data
|
|
|
|
|
2009-11-02 05:53:39 -07:00
|
|
|
#include <iostream>
|
|
|
|
#include <climits>
|
|
|
|
#include <vector>
|
2010-04-02 19:52:46 -06:00
|
|
|
#include <sstream>
|
2009-11-02 05:53:39 -07:00
|
|
|
#include <ctime>
|
|
|
|
using namespace std;
|
|
|
|
|
2010-05-25 22:48:23 -06:00
|
|
|
#include <DFHack.h>
|
2009-11-02 05:53:39 -07:00
|
|
|
|
2010-04-02 19:52:46 -06:00
|
|
|
int main (int numargs, const char ** args)
|
|
|
|
{
|
|
|
|
uint32_t addr;
|
|
|
|
if (numargs == 2)
|
|
|
|
{
|
|
|
|
istringstream input (args[1],istringstream::in);
|
|
|
|
input >> std::hex >> addr;
|
|
|
|
}
|
2010-05-23 15:06:10 -06:00
|
|
|
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::Context * DF;
|
2010-03-26 06:01:46 -06:00
|
|
|
try
|
2009-11-02 05:53:39 -07:00
|
|
|
{
|
2010-05-23 15:06:10 -06:00
|
|
|
DF = DFMgr.getSingleContext();
|
|
|
|
DF->Attach();
|
2010-03-26 06:01:46 -06:00
|
|
|
}
|
|
|
|
catch (exception& e)
|
|
|
|
{
|
|
|
|
cerr << e.what() << endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cin.ignore();
|
|
|
|
#endif
|
2009-11-02 05:53:39 -07:00
|
|
|
return 1;
|
|
|
|
}
|
2010-03-26 06:01:46 -06:00
|
|
|
|
2010-05-23 15:06:10 -06:00
|
|
|
DFHack::Process* p = DF->getProcess();
|
2010-08-20 06:10:05 -06:00
|
|
|
DFHack::VersionInfo* mem = DF->getMemoryInfo();
|
2010-05-23 15:06:10 -06:00
|
|
|
DFHack::Materials *Materials = DF->getMaterials();
|
2010-04-04 16:48:19 -06:00
|
|
|
|
2010-04-04 02:10:00 -06:00
|
|
|
cout << "----==== Inorganic ====----" << endl;
|
2010-04-28 10:09:32 -06:00
|
|
|
Materials->ReadInorganicMaterials ();
|
|
|
|
for(uint32_t i = 0; i < Materials->inorganic.size();i++)
|
2010-04-04 02:10:00 -06:00
|
|
|
{
|
2010-04-28 10:09:32 -06:00
|
|
|
cout << i << ": " << Materials->inorganic[i].id << endl;
|
2010-04-04 02:10:00 -06:00
|
|
|
}
|
2009-11-02 05:53:39 -07:00
|
|
|
|
2010-04-04 02:10:00 -06:00
|
|
|
cout << endl << "----==== Organic ====----" << endl;
|
2010-04-28 10:09:32 -06:00
|
|
|
Materials->ReadOrganicMaterials ();
|
|
|
|
for(uint32_t i = 0; i < Materials->organic.size();i++)
|
2010-04-04 02:10:00 -06:00
|
|
|
{
|
2010-04-28 10:09:32 -06:00
|
|
|
cout << i << ": " << Materials->organic[i].id << endl;
|
2010-04-04 02:10:00 -06:00
|
|
|
}
|
2010-04-14 04:16:56 -06:00
|
|
|
cout << endl << "----==== Organic - trees ====----" << endl;
|
2010-04-28 10:09:32 -06:00
|
|
|
Materials->ReadWoodMaterials ();
|
|
|
|
for(uint32_t i = 0; i < Materials->tree.size();i++)
|
2010-04-14 04:16:56 -06:00
|
|
|
{
|
2010-04-28 10:09:32 -06:00
|
|
|
cout << i << ": " << Materials->tree[i].id << endl;
|
2010-04-14 04:16:56 -06:00
|
|
|
}
|
|
|
|
cout << endl << "----==== Organic - plants ====----" << endl;
|
2010-04-28 10:09:32 -06:00
|
|
|
Materials->ReadPlantMaterials ();
|
|
|
|
for(uint32_t i = 0; i < Materials->plant.size();i++)
|
2010-04-14 04:16:56 -06:00
|
|
|
{
|
2010-04-28 10:09:32 -06:00
|
|
|
cout << i << ": " << Materials->plant[i].id << endl;
|
2010-04-14 04:16:56 -06:00
|
|
|
}
|
2010-05-05 04:57:05 -06:00
|
|
|
cout << endl << "----==== Color descriptors ====----" << endl;
|
|
|
|
Materials->ReadDescriptorColors();
|
|
|
|
for(uint32_t i = 0; i < Materials->color.size();i++)
|
|
|
|
{
|
|
|
|
cout << i << ": " << Materials->color[i].id << " - " << Materials->color[i].name << "["
|
2011-05-06 19:48:41 -06:00
|
|
|
<< (unsigned int) (Materials->color[i].red*255) << ":"
|
|
|
|
<< (unsigned int) (Materials->color[i].green*255) << ":"
|
|
|
|
<< (unsigned int) (Materials->color[i].blue*255)
|
2010-05-05 04:57:05 -06:00
|
|
|
<< "]" << endl;
|
|
|
|
}
|
|
|
|
cout << endl << "----==== All descriptors ====----" << endl;
|
|
|
|
Materials->ReadDescriptorColors();
|
|
|
|
for(uint32_t i = 0; i < Materials->alldesc.size();i++)
|
|
|
|
{
|
|
|
|
cout << i << ": " << Materials->alldesc[i].id << endl;
|
|
|
|
}
|
|
|
|
|
2010-04-04 02:10:00 -06:00
|
|
|
cout << endl << "----==== Creature types ====----" << endl;
|
2010-04-28 10:09:32 -06:00
|
|
|
Materials->ReadCreatureTypesEx ();
|
|
|
|
for(uint32_t i = 0; i < Materials->raceEx.size();i++)
|
2010-04-04 02:10:00 -06:00
|
|
|
{
|
2010-04-28 10:09:32 -06:00
|
|
|
cout << i << ": " << Materials->raceEx[i].rawname << endl;
|
|
|
|
vector<DFHack::t_creaturecaste> & castes = Materials->raceEx[i].castes;
|
2010-04-14 14:12:02 -06:00
|
|
|
for(uint32_t j = 0; j < castes.size();j++)
|
|
|
|
{
|
|
|
|
cout << " ["
|
|
|
|
<< castes[j].rawname << ":"
|
|
|
|
<< castes[j].singular << ":"
|
|
|
|
<< castes[j].plural << ":"
|
2010-05-10 05:11:46 -06:00
|
|
|
<< castes[j].adjective << "] ["
|
|
|
|
<< "st:" << castes[j].strength.level << "/"
|
|
|
|
<< "ag:" << castes[j].agility.level << "/"
|
|
|
|
<< "to:" << castes[j].toughness.level << "/"
|
|
|
|
<< "en:" << castes[j].endurance.level << "/"
|
|
|
|
<< "re:" << castes[j].recuperation.level << "/"
|
|
|
|
<< "di:" << castes[j].disease_resistance.level << "/"
|
|
|
|
<< "an:" << castes[j].analytical_ability.level << "/"
|
|
|
|
<< "fo:" << castes[j].focus.level << "/"
|
|
|
|
<< "wi:" << castes[j].willpower.level << "/"
|
|
|
|
<< "cr:" << castes[j].creativity.level << "/"
|
|
|
|
<< "in:" << castes[j].intuition.level << "/"
|
|
|
|
<< "pa:" << castes[j].patience.level << "/"
|
|
|
|
<< "me:" << castes[j].memory.level << "/"
|
|
|
|
<< "li:" << castes[j].linguistic_ability.level << "/"
|
|
|
|
<< "sp:" << castes[j].spatial_sense.level << "/"
|
|
|
|
<< "mu:" << castes[j].musicality.level << "/"
|
|
|
|
<< "ki:" << castes[j].kinesthetic_sense.level << "]";
|
2010-04-14 14:12:02 -06:00
|
|
|
cout << endl;
|
2010-05-05 03:17:40 -06:00
|
|
|
for(uint32_t k = 0; k < castes[j].ColorModifier.size(); k++)
|
|
|
|
{
|
2010-05-12 06:21:31 -06:00
|
|
|
cout << " colormod[" << castes[j].ColorModifier[k].part;
|
|
|
|
if(castes[j].ColorModifier[k].startdate>0)
|
|
|
|
cout << " start:" << castes[j].ColorModifier[k].startdate << " days, end:" << castes[j].ColorModifier[k].enddate << " days";
|
|
|
|
cout << "] ";
|
2010-05-05 05:48:01 -06:00
|
|
|
for(uint32_t l = 0; l < castes[j].ColorModifier[k].colorlist.size(); l++)
|
2010-05-05 04:57:05 -06:00
|
|
|
{
|
2010-05-05 05:48:01 -06:00
|
|
|
if( castes[j].ColorModifier[k].colorlist[l] < Materials->color.size() )
|
|
|
|
cout << Materials->color[castes[j].ColorModifier[k].colorlist[l]].name << " ";
|
2010-05-05 04:57:05 -06:00
|
|
|
else
|
2010-05-05 05:48:01 -06:00
|
|
|
cout << Materials->alldesc[castes[j].ColorModifier[k].colorlist[l]].id << " ";
|
2010-05-05 04:57:05 -06:00
|
|
|
}
|
2010-05-05 03:17:40 -06:00
|
|
|
cout << endl;
|
|
|
|
}
|
2010-05-05 05:48:01 -06:00
|
|
|
cout << " body: ";
|
|
|
|
for(uint32_t k = 0; k < castes[j].bodypart.size(); k++)
|
|
|
|
{
|
|
|
|
cout << castes[j].bodypart[k].category << " ";
|
|
|
|
}
|
|
|
|
cout << endl;
|
2010-04-14 14:12:02 -06:00
|
|
|
}
|
|
|
|
cout << endl;
|
2010-04-04 02:10:00 -06:00
|
|
|
}
|
2011-03-31 20:20:49 -06:00
|
|
|
cout << endl << "----==== Other ====----" << endl;
|
|
|
|
Materials->ReadOthers ();
|
|
|
|
for(uint32_t i = 0; i < Materials->other.size();i++)
|
|
|
|
{
|
|
|
|
cout << i << ": " << Materials->other[i].rawname << endl;
|
|
|
|
}
|
2009-11-05 18:04:17 -07:00
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
2009-11-02 05:53:39 -07:00
|
|
|
cin.ignore();
|
2009-11-05 18:04:17 -07:00
|
|
|
#endif
|
2009-11-02 05:53:39 -07:00
|
|
|
return 0;
|
2009-12-13 14:03:19 -07:00
|
|
|
}
|