diff --git a/library/include/modules/MapCache.h b/library/include/modules/MapCache.h index c1c478bc6..2a6aebf73 100644 --- a/library/include/modules/MapCache.h +++ b/library/include/modules/MapCache.h @@ -111,8 +111,8 @@ public: { if (!basemats) init_tiles(true); return t_matpair( - index_tile(basemats->mattype,p), - index_tile(basemats->matindex,p) + index_tile(basemats->mat_type,p), + index_tile(basemats->mat_index,p) ); } bool isVeinAt(df::coord2d p) @@ -151,8 +151,8 @@ public: if (!basemats) init_tiles(true); if (tiles->con_info) return t_matpair( - index_tile(tiles->con_info->mattype,p), - index_tile(tiles->con_info->matindex,p) + index_tile(tiles->con_info->mat_type,p), + index_tile(tiles->con_info->mat_index,p) ); return baseMaterialAt(p); } @@ -284,8 +284,8 @@ private: struct ConInfo { df::tile_bitmask constructed; df::tiletype tiles[16][16]; - t_blockmaterials mattype; - t_blockmaterials matindex; + t_blockmaterials mat_type; + t_blockmaterials mat_index; }; struct TileInfo { df::tile_bitmask frozen; @@ -304,8 +304,8 @@ private: }; struct BasematInfo { df::tile_bitmask dirty; - t_blockmaterials mattype; - t_blockmaterials matindex; + t_blockmaterials mat_type; + t_blockmaterials mat_index; t_blockmaterials layermat; BasematInfo(); diff --git a/library/include/modules/Materials.h b/library/include/modules/Materials.h index e44ca89ed..86814898f 100644 --- a/library/include/modules/Materials.h +++ b/library/include/modules/Materials.h @@ -338,10 +338,10 @@ namespace DFHack */ struct t_material { - t_itemType itemType; - t_itemSubtype subType; - t_materialType material; - t_materialIndex index; + t_itemType item_type; + t_itemSubtype item_subtype; + t_materialType mat_type; + t_materialIndex mat_index; uint32_t flags; }; /** diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 91448ab3f..ec01b3f61 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -495,10 +495,10 @@ bool Items::copyItem(df::item * itembase, DFHack::dfh_item &item) item.id = itreal->id; item.age = itreal->age; item.flags = itreal->flags; - item.matdesc.itemType = itreal->getType(); - item.matdesc.subType = itreal->getSubtype(); - item.matdesc.material = itreal->getMaterial(); - item.matdesc.index = itreal->getMaterialIndex(); + item.matdesc.item_type = itreal->getType(); + item.matdesc.item_subtype = itreal->getSubtype(); + item.matdesc.mat_type = itreal->getMaterial(); + item.matdesc.mat_index = itreal->getMaterialIndex(); item.wear_level = itreal->getWear(); item.quality = itreal->getQuality(); item.quantity = itreal->getStackSize(); diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index 482b950ba..363de8064 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -650,15 +650,15 @@ void MapExtras::Block::TileInfo::init_coninfo() con_info = new ConInfo(); con_info->constructed.clear(); COPY(con_info->tiles, base_tiles); - memset(con_info->mattype, -1, sizeof(con_info->mattype)); - memset(con_info->matindex, -1, sizeof(con_info->matindex)); + memset(con_info->mat_type, -1, sizeof(con_info->mat_type)); + memset(con_info->mat_index, -1, sizeof(con_info->mat_index)); } MapExtras::Block::BasematInfo::BasematInfo() { dirty.clear(); - memset(mattype,0,sizeof(mattype)); - memset(matindex,-1,sizeof(matindex)); + memset(mat_type,0,sizeof(mat_type)); + memset(mat_index,-1,sizeof(mat_index)); memset(layermat,-1,sizeof(layermat)); } @@ -719,8 +719,8 @@ void MapExtras::Block::ParseTiles(TileInfo *tiles) is_con = true; tiles->con_info->constructed.setassignment(x,y,true); tiles->con_info->tiles[x][y] = tt; - tiles->con_info->mattype[x][y] = con->mat_type; - tiles->con_info->matindex[x][y] = con->mat_index; + tiles->con_info->mat_type[x][y] = con->mat_type; + tiles->con_info->mat_index[x][y] = con->mat_index; tt = con->original_tile; } @@ -753,14 +753,14 @@ void MapExtras::Block::ParseBasemats(TileInfo *tiles, BasematInfo *bmats) auto tt = tiles->base_tiles[x][y]; auto mat = info.getBaseMaterial(tt, df::coord2d(x,y)); - bmats->mattype[x][y] = mat.mat_type; - bmats->matindex[x][y] = mat.mat_index; + bmats->mat_type[x][y] = mat.mat_type; + bmats->mat_index[x][y] = mat.mat_index; // Copy base info back to construction layer if (tiles->con_info && !tiles->con_info->constructed.getassignment(x,y)) { - tiles->con_info->mattype[x][y] = mat.mat_type; - tiles->con_info->matindex[x][y] = mat.mat_index; + tiles->con_info->mat_type[x][y] = mat.mat_type; + tiles->con_info->mat_index[x][y] = mat.mat_index; } } } diff --git a/library/modules/Materials.cpp b/library/modules/Materials.cpp index 4da484ade..e15e7e83d 100644 --- a/library/modules/Materials.cpp +++ b/library/modules/Materials.cpp @@ -840,7 +840,7 @@ bool Materials::ReadAllMaterials(void) 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) return mi.creature->creature_id + " " + mi.material->id; else if (mi.plant) @@ -853,7 +853,7 @@ std::string Materials::getDescription(const t_material & mat) // This is completely worthless now 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) { case MaterialInfo::Builtin: diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index b19399c6c..a603226e8 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -405,7 +405,7 @@ bool Creatures::WriteJob(const t_creature * furball, std::vector con for(i=0;iwriteWord(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->writeDWord(cmats[i] + off.job_material_index_o, mat[i].index); p->writeDWord(cmats[i] + off.job_material_flags_o, mat[i].flags); @@ -475,7 +475,7 @@ bool Creatures::ReadJob(const t_creature * furball, vector & mat) for(i=0;ireadWord(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].index = p->readDWord(cmats[i] + off.job_material_index_o); mat[i].flags = p->readDWord(cmats[i] + off.job_material_flags_o);