Eyes color are now decoded

develop
simon 2010-05-05 12:57:05 +02:00
parent 99b0d7dc1e
commit 0c0eaa66d8
4 changed files with 28 additions and 13 deletions

@ -95,6 +95,7 @@ namespace DFHack
std::vector<t_creaturetype> raceEx;
std::vector<t_descriptor_color> color;
std::vector<t_matglossOther> other;
std::vector<t_matgloss> alldesc;
bool ReadInorganicMaterials (void);
bool ReadOrganicMaterials (void);

@ -282,6 +282,7 @@ bool Materials::ReadDescriptorColors (void)
col.b = p->readFloat( p_colors[i] + p->getDescriptor()->getOffset ("descriptor_color_b") );
color.push_back(col);
}
return ReadNamesOnly(d->owner, d->owner->getDescriptor()->getAddress ("descriptor_all_colors"), alldesc );
return true;
}

@ -67,6 +67,23 @@ int main (int numargs, const char ** args)
{
cout << i << ": " << Materials->plant[i].id << endl;
}
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 << "["
<< (unsigned int) (Materials->color[i].r*255) << ":"
<< (unsigned int) (Materials->color[i].v*255) << ":"
<< (unsigned int) (Materials->color[i].b*255) << ":"
<< "]" << 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;
}
cout << endl << "----==== Creature types ====----" << endl;
Materials->ReadCreatureTypesEx ();
for(uint32_t i = 0; i < Materials->raceEx.size();i++)
@ -85,22 +102,17 @@ int main (int numargs, const char ** args)
{
cout << " colormod[" << k << "] ";
for(uint32_t l = 0; l < castes[j].ColorModifier[k].size(); l++)
cout << castes[j].ColorModifier[k][l] << " ";
{
if( castes[j].ColorModifier[k][l] < Materials->color.size() )
cout << Materials->color[castes[j].ColorModifier[k][l]].name << " ";
else
cout << Materials->alldesc[castes[j].ColorModifier[k][l]].id << " ";
}
cout << endl;
}
}
cout << endl;
}
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 << "["
<< (unsigned int) (Materials->color[i].r*255) << ":"
<< (unsigned int) (Materials->color[i].v*255) << ":"
<< (unsigned int) (Materials->color[i].b*255) << ":"
<< "]" << endl;
}
#ifndef LINUX_BUILD
cout << "Done. Press any key to continue" << endl;
cin.ignore();

@ -1498,13 +1498,14 @@ map_data_1b60_offset 0x1B9c
Descriptor colors
=================
<Address name="descriptor_shape_vector">0x16B9780</Address>
<Address name="descriptor_vectors_start">0x16B9780</Address>
<Offset name="descriptor_rawname">0x0</Offset>
<Offset name="descriptor_name">0x4C</Offset>
<Address name="descriptor_colors_vector">0x16B9768</Address>
<Address name="descriptor_colors_vector">0x16B9768</Address> this includes RVB
<Offset name="descriptor_color_r">0x6C</Offset> floats !
<Offset name="descriptor_color_v">0x70</Offset>
<Offset name="descriptor_color_b">0x74</Offset>
<Address name="descriptor_all_colors">0x16B9798</Address> A list of all colors, including eyes and stuff
Items
=====