Fix whitespace

develop
lethosor 2015-09-02 15:53:13 -04:00
parent 44a670db4d
commit 1ea2da511b
1 changed files with 52 additions and 52 deletions

@ -146,9 +146,9 @@ DFhackCExport RPCService *plugin_rpcconnect(color_ostream &)
svc->addFunction("GetItemList", GetItemList);
svc->addFunction("GetBuildingDefList", GetBuildingDefList);
svc->addFunction("GetWorldMap", GetWorldMap);
svc->addFunction("GetRegionMaps", GetRegionMaps);
svc->addFunction("GetCreatureRaws", GetCreatureRaws);
return svc;
svc->addFunction("GetRegionMaps", GetRegionMaps);
svc->addFunction("GetCreatureRaws", GetCreatureRaws);
return svc;
}
// This is called right before the plugin library is removed from memory.
@ -181,16 +181,16 @@ uint16_t fletcher16(uint8_t const *data, size_t bytes)
void ConvertDfColor(int16_t in[3], RemoteFortressReader::ColorDefinition * out)
{
if (!df::global::enabler)
return;
if (!df::global::enabler)
return;
auto enabler = df::global::enabler;
auto enabler = df::global::enabler;
int index = in[0] + 8 * in[1];
int index = in[0] + 8 * in[1];
out->set_red((int)(enabler->ccolor[index][0] * 255));
out->set_green((int)(enabler->ccolor[index][1] * 255));
out->set_blue((int)(enabler->ccolor[index][2] * 255));
out->set_red((int)(enabler->ccolor[index][0] * 255));
out->set_green((int)(enabler->ccolor[index][1] * 255));
out->set_blue((int)(enabler->ccolor[index][2] * 255));
}
RemoteFortressReader::TiletypeMaterial TranslateMaterial(df::tiletype_material material)
@ -953,9 +953,9 @@ static command_result GetUnitList(color_ostream &stream, const EmptyMessage *in,
send_unit->set_pos_x(unit->pos.x);
send_unit->set_pos_y(unit->pos.y);
send_unit->set_pos_z(unit->pos.z);
send_unit->mutable_race()->set_mat_type(unit->race);
send_unit->mutable_race()->set_mat_index(unit->caste);
}
send_unit->mutable_race()->set_mat_type(unit->race);
send_unit->mutable_race()->set_mat_index(unit->caste);
}
return CR_OK;
}
@ -1374,58 +1374,58 @@ static command_result GetRegionMaps(color_ostream &stream, const EmptyMessage *i
static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage *in, CreatureRawList *out)
{
if (!df::global::world)
return CR_FAILURE;
if (!df::global::world)
return CR_FAILURE;
df::world * world = df::global::world;
df::world * world = df::global::world;
for (int i = 0; i < world->raws.creatures.all.size(); i++)
{
df::creature_raw * orig_creature = world->raws.creatures.all[i];
for (int i = 0; i < world->raws.creatures.all.size(); i++)
{
df::creature_raw * orig_creature = world->raws.creatures.all[i];
auto send_creature = out->add_creature_raws();
auto send_creature = out->add_creature_raws();
send_creature->set_index(i);
send_creature->set_creature_id(orig_creature->creature_id);
send_creature->add_name(orig_creature->name[0]);
send_creature->add_name(orig_creature->name[1]);
send_creature->add_name(orig_creature->name[2]);
send_creature->set_index(i);
send_creature->set_creature_id(orig_creature->creature_id);
send_creature->add_name(orig_creature->name[0]);
send_creature->add_name(orig_creature->name[1]);
send_creature->add_name(orig_creature->name[2]);
send_creature->add_general_baby_name(orig_creature->general_baby_name[0]);
send_creature->add_general_baby_name(orig_creature->general_baby_name[1]);
send_creature->add_general_baby_name(orig_creature->general_baby_name[0]);
send_creature->add_general_baby_name(orig_creature->general_baby_name[1]);
send_creature->add_general_child_name(orig_creature->general_child_name[0]);
send_creature->add_general_child_name(orig_creature->general_child_name[1]);
send_creature->add_general_child_name(orig_creature->general_child_name[0]);
send_creature->add_general_child_name(orig_creature->general_child_name[1]);
send_creature->set_creature_tile(orig_creature->creature_tile);
send_creature->set_creature_soldier_tile(orig_creature->creature_soldier_tile);
send_creature->set_creature_tile(orig_creature->creature_tile);
send_creature->set_creature_soldier_tile(orig_creature->creature_soldier_tile);
ConvertDfColor(orig_creature->color, send_creature->mutable_color());
ConvertDfColor(orig_creature->color, send_creature->mutable_color());
send_creature->set_adultsize(orig_creature->adultsize);
send_creature->set_adultsize(orig_creature->adultsize);
for (int j = 0; j < orig_creature->caste.size(); j++)
{
auto orig_caste = orig_creature->caste[j];
if (!orig_caste)
continue;
auto send_caste = send_creature->add_caste();
for (int j = 0; j < orig_creature->caste.size(); j++)
{
auto orig_caste = orig_creature->caste[j];
if (!orig_caste)
continue;
auto send_caste = send_creature->add_caste();
send_caste->set_index(j);
send_caste->set_index(j);
send_caste->set_caste_id(orig_caste->caste_id);
send_caste->set_caste_id(orig_caste->caste_id);
send_caste->add_caste_name(orig_caste->caste_name[0]);
send_caste->add_caste_name(orig_caste->caste_name[1]);
send_caste->add_caste_name(orig_caste->caste_name[2]);
send_caste->add_caste_name(orig_caste->caste_name[0]);
send_caste->add_caste_name(orig_caste->caste_name[1]);
send_caste->add_caste_name(orig_caste->caste_name[2]);
send_caste->add_baby_name(orig_caste->baby_name[0]);
send_caste->add_baby_name(orig_caste->baby_name[1]);
send_caste->add_baby_name(orig_caste->baby_name[0]);
send_caste->add_baby_name(orig_caste->baby_name[1]);
send_caste->add_child_name(orig_caste->child_name[0]);
send_caste->add_child_name(orig_caste->child_name[1]);
}
}
send_caste->add_child_name(orig_caste->child_name[0]);
send_caste->add_child_name(orig_caste->child_name[1]);
}
}
return CR_OK;
return CR_OK;
}