Naming consistency

develop
Quietust 2012-11-16 15:35:34 -06:00
parent e2b9b703a0
commit 3f2e583746
6 changed files with 30 additions and 30 deletions

@ -111,8 +111,8 @@ public:
{ {
if (!basemats) init_tiles(true); if (!basemats) init_tiles(true);
return t_matpair( return t_matpair(
index_tile<int16_t>(basemats->mattype,p), index_tile<int16_t>(basemats->mat_type,p),
index_tile<int16_t>(basemats->matindex,p) index_tile<int16_t>(basemats->mat_index,p)
); );
} }
bool isVeinAt(df::coord2d p) bool isVeinAt(df::coord2d p)
@ -151,8 +151,8 @@ public:
if (!basemats) init_tiles(true); if (!basemats) init_tiles(true);
if (tiles->con_info) if (tiles->con_info)
return t_matpair( return t_matpair(
index_tile<int16_t>(tiles->con_info->mattype,p), index_tile<int16_t>(tiles->con_info->mat_type,p),
index_tile<int16_t>(tiles->con_info->matindex,p) index_tile<int16_t>(tiles->con_info->mat_index,p)
); );
return baseMaterialAt(p); return baseMaterialAt(p);
} }
@ -284,8 +284,8 @@ private:
struct ConInfo { struct ConInfo {
df::tile_bitmask constructed; df::tile_bitmask constructed;
df::tiletype tiles[16][16]; df::tiletype tiles[16][16];
t_blockmaterials mattype; t_blockmaterials mat_type;
t_blockmaterials matindex; t_blockmaterials mat_index;
}; };
struct TileInfo { struct TileInfo {
df::tile_bitmask frozen; df::tile_bitmask frozen;
@ -304,8 +304,8 @@ private:
}; };
struct BasematInfo { struct BasematInfo {
df::tile_bitmask dirty; df::tile_bitmask dirty;
t_blockmaterials mattype; t_blockmaterials mat_type;
t_blockmaterials matindex; t_blockmaterials mat_index;
t_blockmaterials layermat; t_blockmaterials layermat;
BasematInfo(); BasematInfo();

@ -338,10 +338,10 @@ namespace DFHack
*/ */
struct t_material struct t_material
{ {
t_itemType itemType; t_itemType item_type;
t_itemSubtype subType; t_itemSubtype item_subtype;
t_materialType material; t_materialType mat_type;
t_materialIndex index; t_materialIndex mat_index;
uint32_t flags; uint32_t flags;
}; };
/** /**

@ -495,10 +495,10 @@ bool Items::copyItem(df::item * itembase, DFHack::dfh_item &item)
item.id = itreal->id; item.id = itreal->id;
item.age = itreal->age; item.age = itreal->age;
item.flags = itreal->flags; item.flags = itreal->flags;
item.matdesc.itemType = itreal->getType(); item.matdesc.item_type = itreal->getType();
item.matdesc.subType = itreal->getSubtype(); item.matdesc.item_subtype = itreal->getSubtype();
item.matdesc.material = itreal->getMaterial(); item.matdesc.mat_type = itreal->getMaterial();
item.matdesc.index = itreal->getMaterialIndex(); item.matdesc.mat_index = itreal->getMaterialIndex();
item.wear_level = itreal->getWear(); item.wear_level = itreal->getWear();
item.quality = itreal->getQuality(); item.quality = itreal->getQuality();
item.quantity = itreal->getStackSize(); item.quantity = itreal->getStackSize();

@ -650,15 +650,15 @@ void MapExtras::Block::TileInfo::init_coninfo()
con_info = new ConInfo(); con_info = new ConInfo();
con_info->constructed.clear(); con_info->constructed.clear();
COPY(con_info->tiles, base_tiles); COPY(con_info->tiles, base_tiles);
memset(con_info->mattype, -1, sizeof(con_info->mattype)); memset(con_info->mat_type, -1, sizeof(con_info->mat_type));
memset(con_info->matindex, -1, sizeof(con_info->matindex)); memset(con_info->mat_index, -1, sizeof(con_info->mat_index));
} }
MapExtras::Block::BasematInfo::BasematInfo() MapExtras::Block::BasematInfo::BasematInfo()
{ {
dirty.clear(); dirty.clear();
memset(mattype,0,sizeof(mattype)); memset(mat_type,0,sizeof(mat_type));
memset(matindex,-1,sizeof(matindex)); memset(mat_index,-1,sizeof(mat_index));
memset(layermat,-1,sizeof(layermat)); memset(layermat,-1,sizeof(layermat));
} }
@ -719,8 +719,8 @@ void MapExtras::Block::ParseTiles(TileInfo *tiles)
is_con = true; is_con = true;
tiles->con_info->constructed.setassignment(x,y,true); tiles->con_info->constructed.setassignment(x,y,true);
tiles->con_info->tiles[x][y] = tt; tiles->con_info->tiles[x][y] = tt;
tiles->con_info->mattype[x][y] = con->mat_type; tiles->con_info->mat_type[x][y] = con->mat_type;
tiles->con_info->matindex[x][y] = con->mat_index; tiles->con_info->mat_index[x][y] = con->mat_index;
tt = con->original_tile; tt = con->original_tile;
} }
@ -753,14 +753,14 @@ void MapExtras::Block::ParseBasemats(TileInfo *tiles, BasematInfo *bmats)
auto tt = tiles->base_tiles[x][y]; auto tt = tiles->base_tiles[x][y];
auto mat = info.getBaseMaterial(tt, df::coord2d(x,y)); auto mat = info.getBaseMaterial(tt, df::coord2d(x,y));
bmats->mattype[x][y] = mat.mat_type; bmats->mat_type[x][y] = mat.mat_type;
bmats->matindex[x][y] = mat.mat_index; bmats->mat_index[x][y] = mat.mat_index;
// Copy base info back to construction layer // Copy base info back to construction layer
if (tiles->con_info && !tiles->con_info->constructed.getassignment(x,y)) if (tiles->con_info && !tiles->con_info->constructed.getassignment(x,y))
{ {
tiles->con_info->mattype[x][y] = mat.mat_type; tiles->con_info->mat_type[x][y] = mat.mat_type;
tiles->con_info->matindex[x][y] = mat.mat_index; tiles->con_info->mat_index[x][y] = mat.mat_index;
} }
} }
} }

@ -840,7 +840,7 @@ bool Materials::ReadAllMaterials(void)
std::string Materials::getDescription(const t_material & mat) std::string Materials::getDescription(const t_material & mat)
{ {
MaterialInfo mi(mat.material, mat.index); MaterialInfo mi(mat.mat_type, mat.mat_index);
if (mi.creature) if (mi.creature)
return mi.creature->creature_id + " " + mi.material->id; return mi.creature->creature_id + " " + mi.material->id;
else if (mi.plant) else if (mi.plant)
@ -853,7 +853,7 @@ std::string Materials::getDescription(const t_material & mat)
// This is completely worthless now // This is completely worthless now
std::string Materials::getType(const t_material & mat) std::string Materials::getType(const t_material & mat)
{ {
MaterialInfo mi(mat.material, mat.index); MaterialInfo mi(mat.mat_type, mat.mat_index);
switch (mi.mode) switch (mi.mode)
{ {
case MaterialInfo::Builtin: case MaterialInfo::Builtin:

@ -405,7 +405,7 @@ bool Creatures::WriteJob(const t_creature * furball, std::vector<t_material> con
for(i=0;i<cmats.size();i++) for(i=0;i<cmats.size();i++)
{ {
p->writeWord(cmats[i] + off.job_material_itemtype_o, mat[i].itemType); p->writeWord(cmats[i] + off.job_material_itemtype_o, mat[i].itemType);
p->writeWord(cmats[i] + off.job_material_subtype_o, mat[i].subType); p->writeWord(cmats[i] + off.job_material_subtype_o, mat[i].itemSubtype);
p->writeWord(cmats[i] + off.job_material_subindex_o, mat[i].subIndex); p->writeWord(cmats[i] + off.job_material_subindex_o, mat[i].subIndex);
p->writeDWord(cmats[i] + off.job_material_index_o, mat[i].index); p->writeDWord(cmats[i] + off.job_material_index_o, mat[i].index);
p->writeDWord(cmats[i] + off.job_material_flags_o, mat[i].flags); p->writeDWord(cmats[i] + off.job_material_flags_o, mat[i].flags);
@ -475,7 +475,7 @@ bool Creatures::ReadJob(const t_creature * furball, vector<t_material> & mat)
for(i=0;i<cmats.size();i++) for(i=0;i<cmats.size();i++)
{ {
mat[i].itemType = p->readWord(cmats[i] + off.job_material_itemtype_o); mat[i].itemType = p->readWord(cmats[i] + off.job_material_itemtype_o);
mat[i].subType = p->readWord(cmats[i] + off.job_material_subtype_o); mat[i].itemSubtype = p->readWord(cmats[i] + off.job_material_subtype_o);
mat[i].subIndex = p->readWord(cmats[i] + off.job_material_subindex_o); mat[i].subIndex = p->readWord(cmats[i] + off.job_material_subindex_o);
mat[i].index = p->readDWord(cmats[i] + off.job_material_index_o); mat[i].index = p->readDWord(cmats[i] + off.job_material_index_o);
mat[i].flags = p->readDWord(cmats[i] + off.job_material_flags_o); mat[i].flags = p->readDWord(cmats[i] + off.job_material_flags_o);