From dc862e28d469dfb9b6c344751a69a71e4c1e63d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 22 May 2010 13:20:58 +0200 Subject: [PATCH] Local, global features --- dfhack/modules/Maps.cpp | 8 ++++---- examples/veinlook.cpp | 2 +- output/Memory.xml | 23 +++++++++++++++-------- tools/prospector.cpp | 4 ++-- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/dfhack/modules/Maps.cpp b/dfhack/modules/Maps.cpp index 6b8a7c51a..5eca4065d 100644 --- a/dfhack/modules/Maps.cpp +++ b/dfhack/modules/Maps.cpp @@ -707,8 +707,8 @@ bool Maps::ReadLocalFeatures( std::map > & uint32_t sizeof_vec = mem->getHexValue("sizeof_vector"); const uint32_t sizeof_elem = 16; const uint32_t offset_elem = 4; - const uint32_t main_mat_offset = 0x30; - const uint32_t sub_mat_offset = 0x34; + const uint32_t main_mat_offset = mem->getOffset("local_feature_mat"); // 0x30 + const uint32_t sub_mat_offset = mem->getOffset("local_feature_submat"); // 0x34 local_features.clear(); @@ -801,8 +801,8 @@ bool Maps::ReadGlobalFeatures( std::vector & features) uint32_t global_feature_vector = mem->getAddress("global_feature_vector"); uint32_t global_feature_funcptr = mem->getOffset("global_feature_funcptr_"); - const uint32_t main_mat_offset = 0x34; - const uint32_t sub_mat_offset = 0x38; + const uint32_t main_mat_offset = mem->getOffset("global_feature_mat"); // 0x34 + const uint32_t sub_mat_offset = mem->getOffset("global_feature_submat"); // 0x38 DfVector p_features (p,global_feature_vector); features.clear(); diff --git a/examples/veinlook.cpp b/examples/veinlook.cpp index a51c9899d..2682b6117 100644 --- a/examples/veinlook.cpp +++ b/examples/veinlook.cpp @@ -587,7 +587,7 @@ main(int argc, char *argv[]) pDF = 0; finish(0); } - + /* if(!Mats->ReadCreatureTypes()) { error = "Can't read stone types."; diff --git a/output/Memory.xml b/output/Memory.xml index f6e1e4f4a..104dc30f7 100755 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -1069,9 +1069,12 @@ size=212 WORLD + 0x54374
0x16AF4FC
0x100 + 0x34 + 0x38 WORLD + 0x54440
0x16AF5C8
- + 0x30 + 0x34 -
0x0
0x0165B188 +
0x92D00C0
0x0165B188 Position and window dimensions ============================== @@ -1656,7 +1659,7 @@ map_data_1b60_offset 0x1B9c --> Map stuff ========= -
0x9322d20
+
0x9322d20
WORLD + 0x52C60 0x08 0x20 0x24 @@ -1670,11 +1673,15 @@ map_data_1b60_offset 0x1B9c Map Features ============ - WORLD + 0x54374 -
0x16AF4FC
- 0x100 - WORLD + 0x54440 -
0x16AF5C8
+ WORLD + 0x5487C +
0x932493C
+ 0x94 + 0x28 + 0x2C + WORLD + 0x548F4 +
0x93249B4
+ 0x24 + 0x28 * map size in blocks *
0x9322d34
0x016ad738 diff --git a/tools/prospector.cpp b/tools/prospector.cpp index f20339cb0..8628705f6 100644 --- a/tools/prospector.cpp +++ b/tools/prospector.cpp @@ -90,7 +90,7 @@ int main (int argc, const char* argv[]) return 1; } Maps->getSize(x_max,y_max,z_max); - /* + if(!Maps->ReadGlobalFeatures(global_features)) { cerr << "Can't get global features." << endl; @@ -107,7 +107,7 @@ int main (int argc, const char* argv[]) cin.ignore(); #endif return 1; - }*/ + } // get stone matgloss mapping if(!Mats->ReadInorganicMaterials()) {