Support for the TLCM_TIMING attribute in color descriptors

develop
simon 2010-05-12 14:21:31 +02:00
parent bb4d9e760c
commit 76dddb8419
4 changed files with 12 additions and 1 deletions

@ -50,6 +50,8 @@ namespace DFHack
{ {
char part[128]; char part[128];
std::vector<uint32_t> colorlist; std::vector<uint32_t> colorlist;
uint32_t startdate; /* in days */
uint32_t enddate; /* in days */
}; };
struct t_creaturecaste struct t_creaturecaste

@ -304,6 +304,8 @@ bool Materials::ReadCreatureTypesEx (void)
uint32_t bodypart_singular_offset = mem->getOffset ("bodypart_singular_vector"); uint32_t bodypart_singular_offset = mem->getOffset ("bodypart_singular_vector");
uint32_t bodypart_plural_offset = mem->getOffset ("bodypart_plural_vector"); uint32_t bodypart_plural_offset = mem->getOffset ("bodypart_plural_vector");
uint32_t color_modifier_part_offset = mem->getOffset ("color_modifier_part"); uint32_t color_modifier_part_offset = mem->getOffset ("color_modifier_part");
uint32_t color_modifier_startdate_offset = mem->getOffset ("color_modifier_startdate");
uint32_t color_modifier_enddate_offset = mem->getOffset ("color_modifier_enddate");
uint32_t size = p_races.size(); uint32_t size = p_races.size();
uint32_t sizecas = 0; uint32_t sizecas = 0;
uint32_t sizecolormod; uint32_t sizecolormod;
@ -341,6 +343,8 @@ bool Materials::ReadCreatureTypesEx (void)
for(uint32_t l = 0; l < sizecolorlist; l++) for(uint32_t l = 0; l < sizecolorlist; l++)
caste.ColorModifier[k].colorlist[l] = p_colorlist[l]; caste.ColorModifier[k].colorlist[l] = p_colorlist[l];
p->readSTLString( p_colormod[k] + color_modifier_part_offset, caste.ColorModifier[k].part, sizeof(caste.ColorModifier[k].part)); p->readSTLString( p_colormod[k] + color_modifier_part_offset, caste.ColorModifier[k].part, sizeof(caste.ColorModifier[k].part));
caste.ColorModifier[k].startdate = p->readDWord( p_colormod[k] + color_modifier_startdate_offset );
caste.ColorModifier[k].enddate = p->readDWord( p_colormod[k] + color_modifier_enddate_offset );
} }
/* body parts */ /* body parts */

@ -117,7 +117,10 @@ int main (int numargs, const char ** args)
cout << endl; cout << endl;
for(uint32_t k = 0; k < castes[j].ColorModifier.size(); k++) for(uint32_t k = 0; k < castes[j].ColorModifier.size(); k++)
{ {
cout << " colormod[" << castes[j].ColorModifier[k].part << "] "; 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 << "] ";
for(uint32_t l = 0; l < castes[j].ColorModifier[k].colorlist.size(); l++) for(uint32_t l = 0; l < castes[j].ColorModifier[k].colorlist.size(); l++)
{ {
if( castes[j].ColorModifier[k].colorlist[l] < Materials->color.size() ) if( castes[j].ColorModifier[k].colorlist[l] < Materials->color.size() )

@ -1445,6 +1445,8 @@ map_data_1b60_offset 0x1B9c
Castes Castes
====== ======
<Offset name="color_modifier_part">0x70</Offset> <Offset name="color_modifier_part">0x70</Offset>
<Offset name="color_modifier_startdate">0x64</Offset>
<Offset name="color_modifier_enddate">0x68</Offset>
<Offset name="caste_bodypart_vector">0x51C</Offset> <Offset name="caste_bodypart_vector">0x51C</Offset>
<Offset name="caste_color_modifiers">0xACC</Offset> <Offset name="caste_color_modifiers">0xACC</Offset>
<Offset name="caste_attributes">0x654</Offset> <Offset name="caste_attributes">0x654</Offset>