Skip to content

Commit

Permalink
updates for the great reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Feb 8, 2025
1 parent 9d851db commit c349156
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 21 deletions.
1 change: 0 additions & 1 deletion ContentBuildingReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "df/building_def.h"
#include "df/world.h"
#include "df/world_raws.h"

using std::string;

Expand Down
3 changes: 1 addition & 2 deletions ContentLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "df/material.h"
#include "df/tissue_style_raw.h"
#include "df/world.h"
#include "df/world_raws.h"

using std::vector;
using std::string;
Expand Down Expand Up @@ -705,7 +704,7 @@ void ContentLoader::flushCreatureConfig()
style_indices.clear();
}

void ContentLoader::gatherStyleIndices(df::world_raws * raws)
void ContentLoader::gatherStyleIndices(df::world::T_raws * raws)
{
for(size_t creatureIndex = 0; creatureIndex < raws->creatures.all.size(); creatureIndex++)
{
Expand Down
6 changes: 1 addition & 5 deletions ContentLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
#include "ItemConfiguration.h"
#include "common.h"

namespace df {
struct world_raws;
}

class ContentLoader
{
private:
Expand All @@ -38,7 +34,7 @@ class ContentLoader

bool translationComplete = false;

void gatherStyleIndices(df::world_raws * raws);
void gatherStyleIndices(df::world::T_raws * raws);
public:
ContentLoader(void);
~ContentLoader(void);
Expand Down
6 changes: 3 additions & 3 deletions Creatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ void ReadCreaturesToSegment( DFHack::Core& DF, WorldSegment* segment)
}

// skip if not weapon or worn item
if(itemslot->mode != df::unit_inventory_item::T_mode::Weapon &&
itemslot->mode != df::unit_inventory_item::T_mode::Worn &&
itemslot->mode != df::unit_inventory_item::T_mode::Piercing) {
if(itemslot->mode != df::inv_item_role_type::Weapon &&
itemslot->mode != df::inv_item_role_type::Worn &&
itemslot->mode != df::inv_item_role_type::Piercing) {
continue;
}

Expand Down
3 changes: 1 addition & 2 deletions DumpInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ be intended for use by people not interested in development.
#include "df/itemdef_glovesst.h"
#include "df/itemdef_pantsst.h"
#include "df/world.h"
#include "df/world_raws.h"

//FIXME: filled with black magic
void dumpSegment()
Expand Down Expand Up @@ -153,7 +152,7 @@ void dumpSegment()

void DumpItemNamesToDisk(const char* filename)
{
df::world_raws::T_itemdefs &defs = df::global::world->raws.itemdefs;
auto &defs = df::global::world->raws.itemdefs;
FILE* fp = fopen(filename, "w");
if(!fp) {
return;
Expand Down
10 changes: 5 additions & 5 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,14 @@ namespace
{
draw_textf_border(font, uiColor(1), 2, (i++ * fontHeight), 0,
"tree name:%s type:%i", lookupTreeName(b->tree.index), b->tree.type);
uint16_t branches_dir = b->tree_tile.bits.branches_dir;
auto & tree_tile = b->tree_tile;
draw_textf_border(font, uiColor(1), 2, (i++ * fontHeight), 0,
"tree tile:%s%s%s%s%s%s%s",
b->tree_tile.bits.trunk ? " trunk" : "",
(branches_dir & 0x1) ? " >" : "",
(branches_dir & 0x2) ? " v" : "",
(branches_dir & 0x4) ? " <" : "",
(branches_dir & 0x8) ? " ^" : "",
tree_tile.bits.branch_w ? " >" : "",
tree_tile.bits.branch_n ? " v" : "",
tree_tile.bits.branch_e ? " <" : "",
tree_tile.bits.branch_s ? " ^" : "",
b->tree_tile.bits.branches ? " branches" : "",
b->tree_tile.bits.leaves ? " leaves" : ""
);
Expand Down
1 change: 1 addition & 0 deletions GameBuildings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "df/buildings_other_id.h"
#include "df/building_wellst.h"
#include "df/buildingitemst.h"
#include "df/item_constructed.h"
#include "df/item_slabst.h"
#include "df/itemimprovement.h"
Expand Down
2 changes: 1 addition & 1 deletion MaterialMatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void MaterialMatcher<T>::set_material(T input, std::string token)
// Only scan inorganics if the token looks like it's actually pointing at one
if ((tokens[0] == "INORGANIC") || contains_wildcard(tokens[0]))
{
for (size_t i = 0; i < world->raws.inorganics.size(); i++)
for (size_t i = 0; i < world->raws.inorganics.all.size(); i++)
{
mat.decode(0, i);
check_match(input, token, mat.getToken(), 0, i);
Expand Down
3 changes: 1 addition & 2 deletions SpriteObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "df/material.h"
#include "df/unit.h"
#include "df/world.h"
#include "df/world_raws.h"

constexpr auto ALL_BORDERS = 255;

Expand Down Expand Up @@ -702,7 +701,7 @@ void c_sprite::set_by_xml(TiXmlElement *elemSprite)
} else if(!strcmp(equipsindexstr, "NONE")) {
itemsubtype = INVALID_INDEX;
} else {
df::world_raws::T_itemdefs &defs = df::global::world->raws.itemdefs;
auto &defs = df::global::world->raws.itemdefs;
switch(itemtype) {
using df::item_type;
case item_type::WEAPON:
Expand Down

0 comments on commit c349156

Please sign in to comment.