Fix color variable naming in t_descriptor_color

develop
Petr Mrázek 2011-05-07 03:48:41 +02:00
parent fc0f6f1e48
commit 97af676bdb
4 changed files with 12 additions and 12 deletions

@ -27,9 +27,9 @@ namespace DFHack
struct t_descriptor_color
{
char id[128]; // id in the raws
float r;
float v;
float b;
float red;
float green;
float blue;
char name[128]; //displayed name
};
/**

@ -325,9 +325,9 @@ bool Materials::ReadDescriptorColors (void)
t_descriptor_color col;
p->readSTLString (p_colors[i] + OG_Descriptors->getOffset ("rawname"), col.id, 128);
p->readSTLString (p_colors[i] + OG_Descriptors->getOffset ("name"), col.name, 128);
col.r = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_r") );
col.v = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_v") );
col.b = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_b") );
col.red = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_r") );
col.green = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_v") );
col.blue = p->readFloat( p_colors[i] + OG_Descriptors->getOffset ("color_b") );
color.push_back(col);
}
return ReadNamesOnly(d->owner, OG_Descriptors->getAddress ("all_colors_vector"), alldesc );

@ -214,9 +214,9 @@ void printCreature(DFHack::Context * DF, const DFHack::t_creature & creature)
if(color<Materials->color.size())
{
cout << Materials->color[color].name << "["
<< (unsigned int) (Materials->color[color].r*255) << ":"
<< (unsigned int) (Materials->color[color].v*255) << ":"
<< (unsigned int) (Materials->color[color].b*255) << "]";
<< (unsigned int) (Materials->color[color].red*255) << ":"
<< (unsigned int) (Materials->color[color].green*255) << ":"
<< (unsigned int) (Materials->color[color].blue*255) << "]";
}
else if (color < Materials->alldesc.size())
{

@ -68,9 +68,9 @@ int main (int numargs, const char ** args)
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)
<< (unsigned int) (Materials->color[i].red*255) << ":"
<< (unsigned int) (Materials->color[i].green*255) << ":"
<< (unsigned int) (Materials->color[i].blue*255)
<< "]" << endl;
}
cout << endl << "----==== All descriptors ====----" << endl;