Color modifiers are now decoded for castes

develop
simon 2010-05-05 11:17:40 +02:00
parent 2356e49768
commit 99b0d7dc1e
4 changed files with 31 additions and 0 deletions

@ -44,6 +44,7 @@ namespace DFHack
char singular[128]; char singular[128];
char plural[128]; char plural[128];
char adjective[128]; char adjective[128];
std::vector<std::vector<uint32_t> > ColorModifier;
}; };
struct t_matglossOther struct t_matglossOther

@ -293,8 +293,11 @@ bool Materials::ReadCreatureTypesEx (void)
uint32_t castes_vector_offset = mem->getOffset ("creature_type_caste_vector"); uint32_t castes_vector_offset = mem->getOffset ("creature_type_caste_vector");
uint32_t extract_vector_offset = mem->getOffset ("creature_type_extract_vector"); uint32_t extract_vector_offset = mem->getOffset ("creature_type_extract_vector");
uint32_t sizeof_string = mem->getHexValue ("sizeof_string"); uint32_t sizeof_string = mem->getHexValue ("sizeof_string");
uint32_t caste_colormod_offset = mem->getOffset ("caste_color_modifiers");
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 sizecolorlist;
uint32_t tile_offset = mem->getOffset ("creature_tile"); uint32_t tile_offset = mem->getOffset ("creature_tile");
uint32_t tile_color_offset = mem->getOffset ("creature_tile_color"); uint32_t tile_color_offset = mem->getOffset ("creature_tile_color");
raceEx.clear(); raceEx.clear();
@ -313,6 +316,18 @@ bool Materials::ReadCreatureTypesEx (void)
p->readSTLString (caste_start + sizeof_string, caste.singular, sizeof(caste.singular)); p->readSTLString (caste_start + sizeof_string, caste.singular, sizeof(caste.singular));
p->readSTLString (caste_start + 2 * sizeof_string, caste.plural, sizeof(caste.plural)); p->readSTLString (caste_start + 2 * sizeof_string, caste.plural, sizeof(caste.plural));
p->readSTLString (caste_start + 3 * sizeof_string, caste.adjective, sizeof(caste.adjective)); p->readSTLString (caste_start + 3 * sizeof_string, caste.adjective, sizeof(caste.adjective));
DfVector <uint32_t> p_colormod(p, caste_start + caste_colormod_offset);
sizecolormod = p_colormod.size();
caste.ColorModifier.resize(sizecolormod);
for(uint32_t k = 0; k < sizecolormod;k++)
{
DfVector <uint32_t> p_colorlist(p, p_colormod[k]);
sizecolorlist = p_colorlist.size();
caste.ColorModifier[k].resize(sizecolorlist);
for(uint32_t l = 0; l < sizecolorlist; l++)
caste.ColorModifier[k][l] = p_colorlist[l];
}
mat.castes.push_back(caste); mat.castes.push_back(caste);
} }
mat.tile_character = p->readByte( p_races[i] + tile_offset ); mat.tile_character = p->readByte( p_races[i] + tile_offset );
@ -327,6 +342,8 @@ bool Materials::ReadCreatureTypesEx (void)
p->readSTLString( p_extract[j], extract.rawname, sizeof(extract.rawname)); p->readSTLString( p_extract[j], extract.rawname, sizeof(extract.rawname));
mat.extract.push_back(extract); mat.extract.push_back(extract);
} }
raceEx.push_back(mat); raceEx.push_back(mat);
} }
return true; return true;

@ -81,6 +81,13 @@ int main (int numargs, const char ** args)
<< castes[j].plural << ":" << castes[j].plural << ":"
<< castes[j].adjective << "] "; << castes[j].adjective << "] ";
cout << endl; cout << endl;
for(uint32_t k = 0; k < castes[j].ColorModifier.size(); k++)
{
cout << " colormod[" << k << "] ";
for(uint32_t l = 0; l < castes[j].ColorModifier[k].size(); l++)
cout << castes[j].ColorModifier[k][l] << " ";
cout << endl;
}
} }
cout << endl; cout << endl;
} }

@ -1422,6 +1422,8 @@ map_data_1b60_offset 0x1B9c
<!--<Offset name="creature_mood">0x238</Offset>--> <!--<Offset name="creature_mood">0x238</Offset>-->
<Offset name="creature_mood">0x288</Offset> <Offset name="creature_mood">0x288</Offset>
<Offset name="creature_birth_year">0x298</Offset>
<Offset name="creature_birth_month">0x29C</Offset>
<Offset name="creature_physical">0x464</Offset> <Offset name="creature_physical">0x464</Offset>
<!-- <!--
<Offset name="creature_strength">0x464</Offset> <Offset name="creature_strength">0x464</Offset>
@ -1440,6 +1442,10 @@ map_data_1b60_offset 0x1B9c
<Offset name="creature_default_soul">0x0758</Offset> <Offset name="creature_default_soul">0x0758</Offset>
<Offset name="creature_happiness">0x834</Offset> <Offset name="creature_happiness">0x834</Offset>
Castes
======
<Offset name="caste_color_modifiers">0xACC</Offset>
Materials Materials
========= =========
soil, stone, metal soil, stone, metal