diff --git a/Memory.xml b/Memory.xml
index bf7507cb4..5417f68ce 100644
--- a/Memory.xml
+++ b/Memory.xml
@@ -2074,8 +2074,8 @@
- maybe
- maybe
+
+
@@ -2123,7 +2123,6 @@
- -->
@@ -2653,6 +2652,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ one of those:
+ 0x944c3c8
+ 0x944c3d4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/library/VersionInfo.cpp b/library/VersionInfo.cpp
index bea8fa016..794ed095b 100644
--- a/library/VersionInfo.cpp
+++ b/library/VersionInfo.cpp
@@ -26,12 +26,34 @@ distribution.
#include "dfhack/VersionInfo.h"
#include "dfhack/DFError.h"
#include "dfhack/DFProcess.h"
+#include
//Inital amount of space in levels vector (since we usually know the number, efficient!)
#define NUM_RESERVE_LVLS 20
#define NUM_RESERVE_MOODS 6
using namespace DFHack;
+//FIXME: put those in some shared file
+template class P = std::less >
+struct compare_pair_first
+{
+ template
+ bool operator()(const std::pair& left, const std::pair& right)
+ {
+ return P()(left.first, right.first);
+ }
+};
+
+template class P = std::less >
+struct compare_pair_second
+{
+ template
+ bool operator()(const std::pair& left, const std::pair& right)
+ {
+ return P()(left.second, right.second);
+ }
+};
+
/*
* Common data types
*/
@@ -421,31 +443,59 @@ std::string OffsetGroup::PrintOffsets(int indentation)
uint32_Iter iter;
ostringstream ss;
indentr i(indentation);
+ typedef pair > horrible;
+ vector < horrible > addrsorter;
for(iter = OGd->addresses.begin(); iter != OGd->addresses.end(); iter++)
{
- ss << i << "";
- if((*iter).second.first == IS_INVALID)
- ss << " INVALID!";
if(!(*iter).second.first)
- ss << " MISSING!";
+ addrsorter.push_back( make_pair( 0, *iter ) );
+ else
+ {
+ addrsorter.push_back( make_pair( (*iter).second.second, *iter ) );
+ }
+ }
+ std::sort(addrsorter.begin(), addrsorter.end(), compare_pair_first<>());
+ for(int idx = 0; idx < addrsorter.size();idx++)
+ {
+ horrible & h = addrsorter[idx];
+ ss << i << "";
+ if(h.second.second.first == NOT_SET)
+ ss << " NOT SET!";
ss << endl;
}
+
+ typedef pair > terrible;
+ vector < terrible > offsorter;
int32_Iter iter2;
for(iter2 = OGd->offsets.begin(); iter2 != OGd->offsets.end(); iter2++)
{
- ss << i << "";
- if((*iter2).second.first == IS_INVALID)
- ss << " INVALID!";
if(!(*iter2).second.first)
- ss << " MISSING!";
+ offsorter.push_back( make_pair( 0, *iter2 ) );
+ else
+ {
+ offsorter.push_back( make_pair( (*iter2).second.second, *iter2 ) );
+ }
+ }
+ std::sort(offsorter.begin(), offsorter.end(), compare_pair_first<>());
+ for(int idx = 0; idx < offsorter.size();idx++)
+ {
+ terrible & h = offsorter[idx];
+ ss << i << "";
+ if(h.second.second.first == NOT_SET)
+ ss << " NOT SET!";
ss << endl;
}
+
for(iter = OGd->hexvals.begin(); iter != OGd->hexvals.end(); iter++)
{
ss << i << "readSTLString (p_bodypart[k] + bodypart_category_offset, part.category, sizeof(part.category));
caste.bodypart.push_back(part);
}
- p->read(caste_start + caste_attributes_offset, sizeof(t_attrib) * (6+11), (uint8_t *)&caste.strength);
+ p->read(caste_start + caste_attributes_offset, sizeof(t_attrib) * NUM_CREAT_ATTRIBS, (uint8_t *)&caste.strength);
+ }
+ else
+ {
+ memset(&caste.strength, 0, sizeof(t_attrib) * NUM_CREAT_ATTRIBS);
}
mat.castes.push_back(caste);
}