diff --git a/CMakeLists.txt b/CMakeLists.txt index 58be5dff1..848b3eee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,5 @@ # main project file. use it from a build sub-folder, see COMPILE for details -# prevent CMake warnings about INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES -IF(CMAKE_VERSION VERSION_GREATER "2.8.12") - CMAKE_POLICY(SET CMP0022 OLD) -ENDIF() - # Set up build types if(CMAKE_CONFIGURATION_TYPES) SET(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo) @@ -18,7 +13,7 @@ endif(CMAKE_CONFIGURATION_TYPES) OPTION(BUILD_DOCS "Choose whether to build the documentation (requires python and Sphinx)." OFF) ## some generic CMake magic -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) project(dfhack) macro(CHECK_GCC COMPILER_PATH) @@ -140,12 +135,14 @@ if (NOT EXISTS ${dfhack_SOURCE_DIR}/library/xml/codegen.pl OR NOT EXISTS ${dfhac endif() # set up versioning. -set(DF_VERSION "0.44.05") -set(DFHACK_RELEASE "r2") -set(DFHACK_PRERELEASE FALSE) +set(DF_VERSION "0.44.07") +set(DFHACK_RELEASE "alpha1") +set(DFHACK_PRERELEASE TRUE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") +set(DFHACK_ABI_VERSION 1) + ## where to install things (after the build is done, classic 'make install' or package structure) # the dfhack libraries will be installed here: IF(UNIX) @@ -187,6 +184,7 @@ IF(UNIX) # ensure compatibility with older CPUs # enable C++11 features add_definitions(-DLINUX_BUILD) + add_definitions(-D_GLIBCXX_USE_C99) SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -Wall -Wno-unused-variable") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -mtune=generic -std=c++0x") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -mtune=generic") diff --git a/depends/jsoncpp/jsoncpp.cpp b/depends/jsoncpp/jsoncpp.cpp index eb38217ef..009d04e7a 100644 --- a/depends/jsoncpp/jsoncpp.cpp +++ b/depends/jsoncpp/jsoncpp.cpp @@ -3922,8 +3922,10 @@ Value& Path::make(Value& root) const { #define isfinite finite #else #include +#ifndef isfinite // fix isfinite on Ubuntu 18.04 #define isfinite std::isfinite #endif +#endif #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below #define snprintf _snprintf diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 4d4a4e9f1..0b28d4463 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,10 +1,8 @@ PROJECT (dfapi) -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) # prevent CMake warnings about INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES -IF(CMAKE_VERSION VERSION_GREATER "2.8.12") - CMAKE_POLICY(SET CMP0022 OLD) -ENDIF() +CMAKE_POLICY(SET CMP0022 NEW) ## build options OPTION(BUILD_DEVEL "Install/package files required for development (For SDK)." OFF) @@ -301,6 +299,7 @@ SET_PROPERTY(TARGET dfhack-version APPEND PROPERTY COMPILE_DEFINITIONS DFHACK_VERSION="${DFHACK_VERSION}" DF_VERSION="${DF_VERSION}" DFHACK_RELEASE="${DFHACK_RELEASE}" + DFHACK_ABI_VERSION=${DFHACK_ABI_VERSION} ) IF(DFHACK_PRERELEASE) SET_PROPERTY(TARGET dfhack-version APPEND PROPERTY COMPILE_DEFINITIONS @@ -365,7 +364,7 @@ IF(APPLE) ENDIF() TARGET_LINK_LIBRARIES(dfhack protobuf-lite clsocket lua jsoncpp dfhack-version ${PROJECT_LIBS}) -SET_TARGET_PROPERTIES(dfhack PROPERTIES LINK_INTERFACE_LIBRARIES "") +SET_TARGET_PROPERTIES(dfhack PROPERTIES INTERFACE_LINK_LIBRARIES "") TARGET_LINK_LIBRARIES(dfhack-client protobuf-lite clsocket) TARGET_LINK_LIBRARIES(dfhack-run dfhack-client) diff --git a/library/DFHackVersion.cpp b/library/DFHackVersion.cpp index 9d367ae64..f4f0cf242 100644 --- a/library/DFHackVersion.cpp +++ b/library/DFHackVersion.cpp @@ -3,6 +3,10 @@ #include "git-describe.h" namespace DFHack { namespace Version { + int dfhack_abi_version() + { + return DFHACK_ABI_VERSION; + } const char *dfhack_version() { return DFHACK_VERSION; diff --git a/library/MiscUtils.cpp b/library/MiscUtils.cpp index e350cb9ec..91a860991 100644 --- a/library/MiscUtils.cpp +++ b/library/MiscUtils.cpp @@ -36,6 +36,7 @@ distribution. #include #include #include +#include #include #include diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp index b6d1dcc92..8e3f436cb 100644 --- a/library/PluginManager.cpp +++ b/library/PluginManager.cpp @@ -276,6 +276,7 @@ bool Plugin::load(color_ostream &con) plugin_check_symbol("plugin_name") plugin_check_symbol("plugin_version") + plugin_check_symbol("plugin_abi_version") plugin_check_symbol("plugin_self") plugin_check_symbol("plugin_init") plugin_check_symbol("plugin_globals") @@ -287,11 +288,19 @@ bool Plugin::load(color_ostream &con) return false; } const char ** plug_version =(const char ** ) LookupPlugin(plug, "plugin_version"); + const int *plugin_abi_version = (int*) LookupPlugin(plug, "plugin_abi_version"); const char ** plug_git_desc_ptr = (const char**) LookupPlugin(plug, "plugin_git_description"); Plugin **plug_self = (Plugin**)LookupPlugin(plug, "plugin_self"); const char *dfhack_version = Version::dfhack_version(); const char *dfhack_git_desc = Version::git_description(); const char *plug_git_desc = plug_git_desc_ptr ? *plug_git_desc_ptr : "unknown"; + if (*plugin_abi_version != Version::dfhack_abi_version()) + { + con.printerr("Plugin %s: ABI version mismatch (Plugin: %i, DFHack: %i)\n", + *plug_name, *plugin_abi_version, Version::dfhack_abi_version()); + plugin_abort_load; + return false; + } if (strcmp(dfhack_version, *plug_version) != 0) { con.printerr("Plugin %s was not built for this version of DFHack.\n" diff --git a/library/git-describe.cmake b/library/git-describe.cmake index bdde32ef9..f19b556d2 100644 --- a/library/git-describe.cmake +++ b/library/git-describe.cmake @@ -7,7 +7,8 @@ set(git_describe_h ${dfhack_SOURCE_DIR}/library/include/git-describe.h) if(EXISTS ${git_describe_tmp_h} AND NOT(${dfhack_SOURCE_DIR}/.git/index IS_NEWER_THAN ${git_describe_tmp_h}) AND - NOT(${dfhack_SOURCE_DIR}/.git/modules/library/xml/index IS_NEWER_THAN ${git_describe_tmp_h})) + NOT(${dfhack_SOURCE_DIR}/.git/modules/library/xml/index IS_NEWER_THAN ${git_describe_tmp_h}) AND + NOT(${dfhack_SOURCE_DIR}/library/git-describe.cmake IS_NEWER_THAN ${git_describe_tmp_h})) return() endif() diff --git a/library/include/DFHackVersion.h b/library/include/DFHackVersion.h index afe8a03a0..c89b94ba5 100644 --- a/library/include/DFHackVersion.h +++ b/library/include/DFHackVersion.h @@ -4,6 +4,7 @@ namespace DFHack { const char *dfhack_version(); const char *df_version(); const char *dfhack_release(); + int dfhack_abi_version(); const char *git_description(); const char *git_commit(); const char *git_xml_commit(); @@ -18,6 +19,7 @@ namespace DFHack { #define DF_VERSION (DFHack::Version::df_version()) #define DFHACK_RELEASE (DFHack::Version::dfhack_release()) #define DFHACK_VERSION (DFHack::Version::dfhack_version()) + #define DFHACK_ABI_VERSION (DFHack::Version::dfhack_abi_version()) #define DFHACK_GIT_DESCRIPTION (DFHack::Version::git_description()) #define DFHACK_GIT_COMMIT (DFHack::Version::git_commit()) #define DFHACK_GIT_XML_COMMIT (DFHack::Version::git_xml_commit()) diff --git a/library/include/PluginManager.h b/library/include/PluginManager.h index f7a8a7d87..c8776d8ed 100644 --- a/library/include/PluginManager.h +++ b/library/include/PluginManager.h @@ -61,6 +61,7 @@ namespace DFHack namespace Version { const char *dfhack_version(); const char *git_description(); + int dfhack_abi_version(); } // anon type, pretty much @@ -296,6 +297,7 @@ namespace DFHack DFhackDataExport const char * plugin_name = m_plugin_name;\ DFhackDataExport const char * plugin_version = DFHack::Version::dfhack_version();\ DFhackDataExport const char * plugin_git_description = DFHack::Version::git_description();\ + DFhackDataExport int plugin_abi_version = DFHack::Version::dfhack_abi_version();\ DFhackDataExport DFHack::Plugin *plugin_self = NULL;\ std::vector _plugin_globals;\ DFhackDataExport std::vector* plugin_globals = &_plugin_globals; \ diff --git a/library/include/df/custom/creature_handler.methods.inc b/library/include/df/custom/creature_handler.methods.inc new file mode 100644 index 000000000..811128d05 --- /dev/null +++ b/library/include/df/custom/creature_handler.methods.inc @@ -0,0 +1 @@ +friend struct world_raws; diff --git a/library/lua/dfhack/workshops.lua b/library/lua/dfhack/workshops.lua index 09268ff38..a09849a57 100644 --- a/library/lua/dfhack/workshops.lua +++ b/library/lua/dfhack/workshops.lua @@ -476,7 +476,7 @@ local function matchIds(bid1,wid1,cid1,bid2,wid2,cid2) end local function scanRawsReaction(buildingId,workshopId,customId) local ret={} - for idx,reaction in ipairs(df.global.world.raws.reactions) do + for idx,reaction in ipairs(df.global.world.raws.reactions.reactions) do for k,v in pairs(reaction.building.type) do if matchIds(buildingId,workshopId,customId,v,reaction.building.subtype[k],reaction.building.custom[k]) then table.insert(ret,reaction) @@ -575,4 +575,4 @@ function getJobs(buildingId,workshopId,customId) --get jobs, add in from raws return ret end -return _ENV \ No newline at end of file +return _ENV diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 3a829c529..fb125e690 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -105,7 +105,7 @@ local function parse_inset(inset) l = inset or 0 t,r,b = l,l,l end - return l,r,t,b + return l,t,r,b end function inset_frame(rect, inset, gap) diff --git a/library/modules/Materials.cpp b/library/modules/Materials.cpp index 219932657..a8f10d7d2 100644 --- a/library/modules/Materials.cpp +++ b/library/modules/Materials.cpp @@ -733,7 +733,7 @@ bool Materials::ReadOthers(void) bool Materials::ReadDescriptorColors (void) { - size_t size = world->raws.language.colors.size(); + size_t size = world->raws.descriptors.colors.size(); color.clear(); if(size == 0) @@ -741,7 +741,7 @@ bool Materials::ReadDescriptorColors (void) color.reserve(size); for (size_t i = 0; i < size;i++) { - df::descriptor_color *c = world->raws.language.colors[i]; + df::descriptor_color *c = world->raws.descriptors.colors[i]; t_descriptor_color col; col.id = c->id; col.name = c->name; @@ -751,13 +751,13 @@ bool Materials::ReadDescriptorColors (void) color.push_back(col); } - size = world->raws.language.patterns.size(); + size = world->raws.descriptors.patterns.size(); alldesc.clear(); alldesc.reserve(size); for (size_t i = 0; i < size;i++) { t_matgloss mat; - mat.id = world->raws.language.patterns[i]->id; + mat.id = world->raws.descriptors.patterns[i]->id; alldesc.push_back(mat); } return true; diff --git a/library/xml b/library/xml index 5fea1ef62..dd558ca1e 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 5fea1ef62a040d24a9efa31a9a6dfd8eb1eea3f6 +Subproject commit dd558ca1ea4645f14a7e5b83329d4f59d8414496 diff --git a/plugins/add-spatter.cpp b/plugins/add-spatter.cpp index 1e835b8b6..3d2d89dd1 100644 --- a/plugins/add-spatter.cpp +++ b/plugins/add-spatter.cpp @@ -356,7 +356,7 @@ static bool find_reactions(color_ostream &out) reactions.clear(); products.clear(); - auto &rlist = world->raws.reactions; + auto &rlist = df::reaction::get_vector(); for (size_t i = 0; i < rlist.size(); i++) { diff --git a/plugins/devel/dumpmats.cpp b/plugins/devel/dumpmats.cpp index e50771a9f..23c7be4e1 100644 --- a/plugins/devel/dumpmats.cpp +++ b/plugins/devel/dumpmats.cpp @@ -59,10 +59,10 @@ command_result df_dumpmats (color_ostream &out, vector ¶meters) { def_color[matter_state::Liquid] = solid_color; def_color[matter_state::Gas] = solid_color; - out.print("\t[STATE_COLOR:ALL:%s]\n", world->raws.language.colors[solid_color]->id.c_str()); + out.print("\t[STATE_COLOR:ALL:%s]\n", world->raws.descriptors.colors[solid_color]->id.c_str()); } else - out.print("\t[STATE_COLOR:ALL_SOLID:%s]\n", world->raws.language.colors[solid_color]->id.c_str()); + out.print("\t[STATE_COLOR:ALL_SOLID:%s]\n", world->raws.descriptors.colors[solid_color]->id.c_str()); } string solid_name = mat->state_name[matter_state::Solid]; @@ -141,7 +141,7 @@ command_result df_dumpmats (color_ostream &out, vector ¶meters) FOR_ENUM_ITEMS(matter_state, state) { if (mat->state_color[state] != -1 && mat->state_color[state] != def_color[state]) - out.print("\t[STATE_COLOR:%s:%s]\n", state_names[state], world->raws.language.colors[mat->state_color[state]]->id.c_str()); + out.print("\t[STATE_COLOR:%s:%s]\n", state_names[state], world->raws.descriptors.colors[mat->state_color[state]]->id.c_str()); if (mat->state_name[state] == mat->state_adj[state]) { if (mat->state_name[state].size() && mat->state_name[state] != def_name[state] || mat->state_adj[state].size() && mat->state_adj[state] != def_adj[state]) @@ -241,7 +241,7 @@ command_result df_dumpmats (color_ostream &out, vector ¶meters) if (mat->hardens_with_water.mat_type != -1) out.print("\t[HARDENS_WITH_WATER:%s:%s%s%s]\n", mat->hardens_with_water.str[0].c_str(), mat->hardens_with_water.str[1].c_str(), mat->hardens_with_water.str[2].size() ? ":" : "", mat->hardens_with_water.str[2].c_str()); if (mat->powder_dye != -1) - out.print("\t[POWDER_DYE:%s]\n", world->raws.language.colors[mat->powder_dye]->id.c_str()); + out.print("\t[POWDER_DYE:%s]\n", world->raws.descriptors.colors[mat->powder_dye]->id.c_str()); if (mat->soap_level != -0) out.print("\t[SOAP_LEVEL:%o]\n", mat->soap_level); @@ -262,4 +262,4 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector DFhackCExport command_result plugin_shutdown ( Core * c ) { return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index bf7c02efc..56ca53091 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1303,7 +1303,7 @@ struct preference_map } case (T_type::LikeShape): - label += "Shape :" + raws.language.shapes[pref.shape_id]->name_plural; + label += "Shape :" + raws.descriptors.shapes[pref.shape_id]->name_plural; break; case (T_type::LikeTree): @@ -1314,7 +1314,7 @@ struct preference_map } case (T_type::LikeColor): - label += "Color :" + raws.language.colors[pref.color_id]->name; + label += "Color :" + raws.descriptors.colors[pref.color_id]->name; break; case (T_type::LikePoeticForm): diff --git a/plugins/embark-assistant/survey.cpp b/plugins/embark-assistant/survey.cpp index 6583d2479..5df070303 100644 --- a/plugins/embark-assistant/survey.cpp +++ b/plugins/embark-assistant/survey.cpp @@ -74,7 +74,7 @@ namespace embark_assist { bool geo_survey(embark_assist::defs::geo_data *geo_summary) { color_ostream_proxy out(Core::getInstance().getConsole()); df::world_data *world_data = world->world_data; - auto reactions = world->raws.reactions; + auto reactions = df::reaction::get_vector(); bool non_soil_found; uint16_t size; diff --git a/plugins/eventful.cpp b/plugins/eventful.cpp index 365542314..f4056a3d5 100644 --- a/plugins/eventful.cpp +++ b/plugins/eventful.cpp @@ -397,7 +397,7 @@ static bool find_reactions(color_ostream &out) { reactions.clear(); - auto &rlist = world->raws.reactions; + auto &rlist = df::reaction::get_vector(); for (size_t i = 0; i < rlist.size(); i++) { diff --git a/plugins/isoworld b/plugins/isoworld index 3ff3f05da..fbbf9e464 160000 --- a/plugins/isoworld +++ b/plugins/isoworld @@ -1 +1 @@ -Subproject commit 3ff3f05da53077dd9e67c1eef672427a2bfd95ea +Subproject commit fbbf9e46458e41707c27f2a4438452a579490db1 diff --git a/plugins/labormanager/joblabormapper.cpp b/plugins/labormanager/joblabormapper.cpp index 779839e99..f47077134 100644 --- a/plugins/labormanager/joblabormapper.cpp +++ b/plugins/labormanager/joblabormapper.cpp @@ -583,11 +583,11 @@ class jlfunc_custom : public jlfunc public: df::unit_labor get_labor(df::job* j) { - for (auto r = world->raws.reactions.begin(); r != world->raws.reactions.end(); r++) + for (auto r : df::reaction::get_vector()) { - if ((*r)->code == j->reaction_name) + if (r->code == j->reaction_name) { - df::job_skill skill = (*r)->skill; + df::job_skill skill = r->skill; df::unit_labor labor = ENUM_ATTR(job_skill, labor, skill); return labor; } @@ -894,11 +894,11 @@ df::unit_labor JobLaborMapper::find_job_labor(df::job* j) { if (j->job_type == df::job_type::CustomReaction) { - for (auto r = world->raws.reactions.begin(); r != world->raws.reactions.end(); r++) + for (auto r : df::reaction::get_vector()) { - if ((*r)->code == j->reaction_name) + if (r->code == j->reaction_name) { - df::job_skill skill = (*r)->skill; + df::job_skill skill = r->skill; return ENUM_ATTR(job_skill, labor, skill); } } diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index fcaca0ecd..ca484d831 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -416,13 +416,13 @@ function collect_reactions() end for _, reaction_id in ipairs(entity.entity_raw.workshops.permitted_reaction_id) do - local reaction = df.global.world.raws.reactions[reaction_id] + local reaction = df.global.world.raws.reactions.reactions[reaction_id] local name = string.gsub(reaction.name, "^.", string.upper) reaction_entry(result, job_types.CustomReaction, {reaction_name = reaction.code}, name) end -- Reactions generated by the game. - for _, reaction in ipairs(df.global.world.raws.reactions) do + for _, reaction in ipairs(df.global.world.raws.reactions.reactions) do if reaction.source_enid == entity.id then local name = string.gsub(reaction.name, "^.", string.upper) reaction_entry(result, job_types.CustomReaction, {reaction_name = reaction.code}, name) diff --git a/plugins/lua/workflow.lua b/plugins/lua/workflow.lua index dcec1248d..6c4230a51 100644 --- a/plugins/lua/workflow.lua +++ b/plugins/lua/workflow.lua @@ -29,7 +29,7 @@ end local function get_reaction(name) if not reaction_id_cache then reaction_id_cache = {} - for i,v in ipairs(df.global.world.raws.reactions) do + for i,v in ipairs(df.global.world.raws.reactions.reactions) do reaction_id_cache[v.code] = i end end diff --git a/plugins/remotefortressreader/item_reader.cpp b/plugins/remotefortressreader/item_reader.cpp index eb4fb549c..c0170f2c4 100644 --- a/plugins/remotefortressreader/item_reader.cpp +++ b/plugins/remotefortressreader/item_reader.cpp @@ -227,7 +227,7 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem) case df::enums::item_type::STATUE: { VIRTUAL_CAST_VAR(statue, df::item_statuest, DfItem); - + df::art_image_chunk * chunk = NULL; GET_ART_IMAGE_CHUNK GetArtImageChunk = reinterpret_cast(Core::getInstance().vinfo->getAddress("get_art_image_chunk")); if (GetArtImageChunk) @@ -528,9 +528,9 @@ DFHack::command_result GetItemList(DFHack::color_ostream &stream, const DFHack:: case df::enums::item_type::GEM: case df::enums::item_type::SMALLGEM: { - for (int i = 0; i < world->raws.language.shapes.size(); i++) + for (int i = 0; i < world->raws.descriptors.shapes.size(); i++) { - auto shape = world->raws.language.shapes[i]; + auto shape = world->raws.descriptors.shapes[i]; if (shape->gems_use.whole == 0) continue; mat_def = out->add_material_list(); diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index d30b0a67e..e1282d600 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -388,7 +388,7 @@ void ConvertDfColor(int16_t in[3], RemoteFortressReader::ColorDefinition * out) void ConvertDFColorDescriptor(int16_t index, RemoteFortressReader::ColorDefinition * out) { - df::descriptor_color *color = world->raws.language.colors[index]; + df::descriptor_color *color = world->raws.descriptors.colors[index]; out->set_red(color->red * 255); out->set_green(color->green * 255); out->set_blue(color->blue * 255); @@ -871,7 +871,7 @@ static command_result GetMaterialList(color_ostream &stream, const EmptyMessage mat_def->mutable_mat_pair()->set_mat_index(i); mat_def->set_id(mat.getToken()); mat_def->set_name(mat.toString()); //find the name at cave temperature; - if (raws->inorganics[i]->material.state_color[GetState(&raws->inorganics[i]->material)] < raws->language.colors.size()) + if (raws->inorganics[i]->material.state_color[GetState(&raws->inorganics[i]->material)] < raws->descriptors.colors.size()) { ConvertDFColorDescriptor(raws->inorganics[i]->material.state_color[GetState(&raws->inorganics[i]->material)], mat_def->mutable_state_color()); } @@ -889,7 +889,7 @@ static command_result GetMaterialList(color_ostream &stream, const EmptyMessage mat_def->mutable_mat_pair()->set_mat_index(j); mat_def->set_id(mat.getToken()); mat_def->set_name(mat.toString()); //find the name at cave temperature; - if (raws->mat_table.builtin[i]->state_color[GetState(raws->mat_table.builtin[i])] < raws->language.colors.size()) + if (raws->mat_table.builtin[i]->state_color[GetState(raws->mat_table.builtin[i])] < raws->descriptors.colors.size()) { ConvertDFColorDescriptor(raws->mat_table.builtin[i]->state_color[GetState(raws->mat_table.builtin[i])], mat_def->mutable_state_color()); } @@ -906,7 +906,7 @@ static command_result GetMaterialList(color_ostream &stream, const EmptyMessage mat_def->mutable_mat_pair()->set_mat_index(i); mat_def->set_id(mat.getToken()); mat_def->set_name(mat.toString()); //find the name at cave temperature; - if (creature->material[j]->state_color[GetState(creature->material[j])] < raws->language.colors.size()) + if (creature->material[j]->state_color[GetState(creature->material[j])] < raws->descriptors.colors.size()) { ConvertDFColorDescriptor(creature->material[j]->state_color[GetState(creature->material[j])], mat_def->mutable_state_color()); } @@ -928,9 +928,9 @@ static command_result GetMaterialList(color_ostream &stream, const EmptyMessage // id << "HF" << i << mat.getToken(); // mat_def->set_id(id.str()); // mat_def->set_name(mat.toString()); //find the name at cave temperature; - // if (creature->material[j]->state_color[GetState(creature->material[j])] < raws->language.colors.size()) + // if (creature->material[j]->state_color[GetState(creature->material[j])] < raws->descriptors.colors.size()) // { - // df::descriptor_color *color = raws->language.colors[creature->material[j]->state_color[GetState(creature->material[j])]]; + // df::descriptor_color *color = raws->descriptors.colors[creature->material[j]->state_color[GetState(creature->material[j])]]; // mat_def->mutable_state_color()->set_red(color->red * 255); // mat_def->mutable_state_color()->set_green(color->green * 255); // mat_def->mutable_state_color()->set_blue(color->blue * 255); @@ -948,7 +948,7 @@ static command_result GetMaterialList(color_ostream &stream, const EmptyMessage mat_def->mutable_mat_pair()->set_mat_index(i); mat_def->set_id(mat.getToken()); mat_def->set_name(mat.toString()); //find the name at cave temperature; - if (plant->material[j]->state_color[GetState(plant->material[j])] < raws->language.colors.size()) + if (plant->material[j]->state_color[GetState(plant->material[j])] < raws->descriptors.colors.size()) { ConvertDFColorDescriptor(plant->material[j]->state_color[GetState(plant->material[j])], mat_def->mutable_state_color()); } @@ -2753,13 +2753,13 @@ static command_result GetPartialCreatureRaws(color_ostream &stream, const ListRe for (int l = 0; l < orig_mod->pattern_index.size(); l++) { - auto orig_pattern = world->raws.language.patterns[orig_mod->pattern_index[l]]; + auto orig_pattern = world->raws.descriptors.patterns[orig_mod->pattern_index[l]]; auto send_pattern = send_mod->add_patterns(); for (int m = 0; m < orig_pattern->colors.size(); m++) { auto send_color = send_pattern->add_colors(); - auto orig_color = world->raws.language.colors[orig_pattern->colors[m]]; + auto orig_color = world->raws.descriptors.colors[orig_pattern->colors[m]]; send_color->set_red(orig_color->red * 255.0); send_color->set_green(orig_color->green * 255.0); send_color->set_blue(orig_color->blue * 255.0); @@ -3050,9 +3050,9 @@ static command_result GetLanguage(color_ostream & stream, const EmptyMessage * i if (!world) return CR_FAILURE; - for (int i = 0; i < world->raws.language.shapes.size(); i++) + for (int i = 0; i < world->raws.descriptors.shapes.size(); i++) { - auto shape = world->raws.language.shapes[i]; + auto shape = world->raws.descriptors.shapes[i]; auto netShape = out->add_shapes(); netShape->set_id(shape->id); netShape->set_tile(shape->tile); diff --git a/plugins/stonesense b/plugins/stonesense index da3065a35..4c3728880 160000 --- a/plugins/stonesense +++ b/plugins/stonesense @@ -1 +1 @@ -Subproject commit da3065a35362a8ae3190234792c8cd14fffac9dd +Subproject commit 4c3728880a1b8d94046283be28d2078aac9fbe05 diff --git a/scripts b/scripts index 9d8f2096f..be21a2a52 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 9d8f2096fc4c247299cbc94c6a8d756f31690a4b +Subproject commit be21a2a52084e838e4b5eb1f296a03d5592389f8