First pass for 0.40 compatibility; still lots left to do, but this will at least build

develop
Quietust 2014-07-21 13:18:29 -05:00
parent b598cbb0dd
commit 97de21357c
19 changed files with 76 additions and 88 deletions

@ -58,8 +58,8 @@ if (NOT EXISTS ${dfhack_SOURCE_DIR}/library/xml/codegen.pl OR NOT EXISTS ${dfhac
endif()
# set up versioning.
set(DF_VERSION "0.34.11")
SET(DFHACK_RELEASE "r5" CACHE STRING "Current release revision.")
set(DF_VERSION "0.40.04")
SET(DFHACK_RELEASE "r0" CACHE STRING "Current release revision.")
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")
add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}")

@ -1158,7 +1158,6 @@ int Items::getItemBaseValue(int16_t item_type, int16_t item_subtype, int16_t mat
case item_type::MEAT:
case item_type::PLANT:
case item_type::LEAVES:
case item_type::CHEESE:
value = 2;
break;

@ -845,15 +845,6 @@ t_matpair MapExtras::BlockInfo::getBaseMaterial(df::tiletype tt, df::coord2d pos
case ROOT:
case TREE:
case PLANT:
rv.mat_type = MaterialInfo::PLANT_BASE;
if (auto plant = plants[block->map_pos + df::coord(x,y,0)])
{
if (auto raw = df::plant_raw::find(plant->material))
{
rv.mat_type = raw->material_defs.type_basic_mat;
rv.mat_index = raw->material_defs.idx_basic_mat;
}
}
break;
case GRASS_LIGHT:

@ -253,7 +253,7 @@ void Maps::enableBlockUpdates(df::map_block *blk, bool flow, bool temperature)
blk->flags.bits.update_liquid_twice = true;
}
auto z_flags = world->map.z_level_flags;
auto z_flags = world->map_extras.z_level_flags;
int z_level = blk->map_pos.z;
if (z_flags && z_level >= 0 && z_level < world->map.z_count_block)

@ -479,7 +479,6 @@ void MaterialInfo::getMatchBits(df::job_item_flags1 &ok, df::job_item_flags1 &ma
TEST(extract_bearing_fish, false);
TEST(extract_bearing_vermin, false);
TEST(processable_to_vial, structural && FLAG(plant, plant_raw_flags::EXTRACT_VIAL));
TEST(processable_to_bag, structural && FLAG(plant, plant_raw_flags::LEAVES));
TEST(processable_to_barrel, structural && FLAG(plant, plant_raw_flags::EXTRACT_BARREL));
TEST(solid, !(MAT_FLAG(ALCOHOL_PLANT) ||
MAT_FLAG(ALCOHOL_CREATURE) ||

@ -153,7 +153,7 @@ string Translation::TranslateName(const df::language_name * name, bool inEnglish
if (!name->nickname.empty())
{
word = "`" + name->nickname + "'";
switch (d_init ? d_init->nickname_dwarf : d_init_nickname::CENTRALIZE)
switch (d_init ? d_init->nickname[*df::global::gametype] : d_init_nickname::CENTRALIZE)
{
case d_init_nickname::REPLACE_ALL:
out = word;

@ -1 +1 @@
Subproject commit c66ab33071842bcfb7d37c3993f6a024923ca358
Subproject commit ad20c0e2598df0599954c0ff09df982d60c006dd

@ -38,12 +38,12 @@ endif()
OPTION(BUILD_MAPEXPORT "Build map exporter." ON)
if (BUILD_MAPEXPORT)
add_subdirectory (mapexport)
# add_subdirectory (mapexport)
endif()
OPTION(BUILD_DWARFEXPORT "Build dwarf exporter." ON)
if (BUILD_DWARFEXPORT)
add_subdirectory (dwarfexport)
# add_subdirectory (dwarfexport)
endif()
OPTION(BUILD_RUBY "Build ruby binding." ON)
@ -84,7 +84,7 @@ OPTION(BUILD_SUPPORTED "Build the supported plugins (reveal, probe, etc.)." ON)
if (BUILD_SUPPORTED)
DFHACK_PLUGIN(3dveins 3dveins.cpp)
DFHACK_PLUGIN(add-spatter add-spatter.cpp)
DFHACK_PLUGIN(advtools advtools.cpp)
# DFHACK_PLUGIN(advtools advtools.cpp)
DFHACK_PLUGIN(autodump autodump.cpp)
DFHACK_PLUGIN(autolabor autolabor.cpp)
DFHACK_PLUGIN(automaterial automaterial.cpp)
@ -104,23 +104,23 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(createitem createitem.cpp)
DFHACK_PLUGIN(cursecheck cursecheck.cpp)
DFHACK_PLUGIN(deramp deramp.cpp)
DFHACK_PLUGIN(dig dig.cpp)
# DFHACK_PLUGIN(dig dig.cpp)
DFHACK_PLUGIN(digFlood digFlood.cpp)
add_subdirectory(diggingInvaders)
# add_subdirectory(diggingInvaders)
DFHACK_PLUGIN(drybuckets drybuckets.cpp)
DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp)
# DFHACK_PLUGIN(dwarfmonitor dwarfmonitor.cpp)
DFHACK_PLUGIN(embark-tools embark-tools.cpp)
DFHACK_PLUGIN(eventful eventful.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(fastdwarf fastdwarf.cpp)
DFHACK_PLUGIN(feature feature.cpp)
DFHACK_PLUGIN(filltraffic filltraffic.cpp)
DFHACK_PLUGIN(fix-armory fix-armory.cpp)
# DFHACK_PLUGIN(fix-armory fix-armory.cpp)
DFHACK_PLUGIN(fixpositions fixpositions.cpp)
DFHACK_PLUGIN(fixveins fixveins.cpp)
DFHACK_PLUGIN(flows flows.cpp)
DFHACK_PLUGIN(follow follow.cpp)
DFHACK_PLUGIN(forceequip forceequip.cpp)
DFHACK_PLUGIN(getplants getplants.cpp)
# DFHACK_PLUGIN(getplants getplants.cpp)
DFHACK_PLUGIN(infiniteSky infiniteSky.cpp)
DFHACK_PLUGIN(initflags initflags.cpp)
DFHACK_PLUGIN(isoworldremote isoworldremote.cpp PROTOBUFS isoworldremote)
@ -132,20 +132,20 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(misery misery.cpp)
DFHACK_PLUGIN(mousequery mousequery.cpp)
DFHACK_PLUGIN(petcapRemover petcapRemover.cpp)
DFHACK_PLUGIN(plants plants.cpp)
# DFHACK_PLUGIN(plants plants.cpp)
DFHACK_PLUGIN(probe probe.cpp)
DFHACK_PLUGIN(prospector prospector.cpp)
# DFHACK_PLUGIN(prospector prospector.cpp)
DFHACK_PLUGIN(power-meter power-meter.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(regrass regrass.cpp)
DFHACK_PLUGIN(remotefortressreader remotefortressreader.cpp PROTOBUFS RemoteFortressReader)
DFHACK_PLUGIN(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
add_subdirectory(rendermax)
# add_subdirectory(rendermax)
DFHACK_PLUGIN(resume resume.cpp)
DFHACK_PLUGIN(reveal reveal.cpp)
DFHACK_PLUGIN(search search.cpp)
DFHACK_PLUGIN(seedwatch seedwatch.cpp)
DFHACK_PLUGIN(showmood showmood.cpp)
DFHACK_PLUGIN(siege-engine siege-engine.cpp LINK_LIBRARIES lua)
# DFHACK_PLUGIN(siege-engine siege-engine.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(sort sort.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(steam-engine steam-engine.cpp)
DFHACK_PLUGIN(stockflow stockflow.cpp LINK_LIBRARIES lua)
@ -153,7 +153,7 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(stocks stocks.cpp)
DFHACK_PLUGIN(strangemood strangemood.cpp)
DFHACK_PLUGIN(tiletypes tiletypes.cpp Brushes.h)
DFHACK_PLUGIN(treefarm treefarm.cpp)
# DFHACK_PLUGIN(treefarm treefarm.cpp)
DFHACK_PLUGIN(tubefill tubefill.cpp)
DFHACK_PLUGIN(tweak tweak.cpp)
DFHACK_PLUGIN(weather weather.cpp)

@ -476,9 +476,6 @@ static bool is_valid_building_site(building_site &site, bool orthogonal_check, b
return false;
}
if (shape == tiletype_shape::TREE)
return false;
if (material == tiletype_material::FIRE ||
material == tiletype_material::POOL ||
material == tiletype_material::BROOK ||

@ -231,7 +231,7 @@ command_result df_dumpmats (color_ostream &out, vector<string> &parameters)
for (int i = 0; i < mat->reaction_class.size(); i++)
out.print("\t[REACTION_CLASS:%s]\n", mat->reaction_class[i]->c_str());
for (int i = 0; i < mat->reaction_product.id.size(); i++)
out.print("\t[MATERIAL_REACTION_PRODUCT:%s:%s:%s%s%s]\n", mat->reaction_product.id[i]->c_str(), mat->reaction_product.str[0][i]->c_str(), mat->reaction_product.str[1][i]->c_str(), mat->reaction_product.str[2][i]->size() ? ":" : "", mat->reaction_product.str[2][i]->c_str());
out.print("\t[MATERIAL_REACTION_PRODUCT:%s:%s:%s%s%s]\n", mat->reaction_product.id[i]->c_str(), mat->reaction_product.str[2][i]->c_str(), mat->reaction_product.str[3][i]->c_str(), mat->reaction_product.str[4][i]->size() ? ":" : "", mat->reaction_product.str[4][i]->c_str());
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());

@ -106,7 +106,7 @@ public:
void update_embark_sidebar (df::viewscreen_choose_start_sitest * screen)
{
bool is_top = false;
if (screen->embark_pos_min.y == 0)
if (screen->location.embark_pos_min.y == 0)
is_top = true;
std::set<df::interface_key> keys;
keys.insert(df::interface_key::SETUP_LOCAL_Y_MUP);
@ -123,10 +123,10 @@ void resize_embark (df::viewscreen_choose_start_sitest * screen, int dx, int dy)
/* Reproduces DF's embark resizing functionality
* Local area resizes up and to the right, unless it's already touching the edge
*/
int x1 = screen->embark_pos_min.x,
x2 = screen->embark_pos_max.x,
y1 = screen->embark_pos_min.y,
y2 = screen->embark_pos_max.y,
int x1 = screen->location.embark_pos_min.x,
x2 = screen->location.embark_pos_max.x,
y1 = screen->location.embark_pos_min.y,
y2 = screen->location.embark_pos_max.y,
width = x2 - x1 + dx,
height = y2 - y1 + dy;
if (x1 == x2 && dx == -1)
@ -150,10 +150,10 @@ void resize_embark (df::viewscreen_choose_start_sitest * screen, int dx, int dy)
}
y2 = std::min(15, y2);
screen->embark_pos_min.x = x1;
screen->embark_pos_max.x = x2;
screen->embark_pos_min.y = y1;
screen->embark_pos_max.y = y2;
screen->location.embark_pos_min.x = x1;
screen->location.embark_pos_max.x = x2;
screen->location.embark_pos_min.y = y1;
screen->location.embark_pos_max.y = y2;
update_embark_sidebar(screen);
}
@ -183,10 +183,10 @@ int sticky_pos[] = {0, 0, 3, 3};
bool sticky_moved = false;
void sticky_save (df::viewscreen_choose_start_sitest * screen)
{
sticky_pos[0] = screen->embark_pos_min.x;
sticky_pos[1] = screen->embark_pos_max.x;
sticky_pos[2] = screen->embark_pos_min.y;
sticky_pos[3] = screen->embark_pos_max.y;
sticky_pos[0] = screen->location.embark_pos_min.x;
sticky_pos[1] = screen->location.embark_pos_max.x;
sticky_pos[2] = screen->location.embark_pos_min.y;
sticky_pos[3] = screen->location.embark_pos_max.y;
}
void sticky_apply (df::viewscreen_choose_start_sitest * screen)
@ -196,10 +196,10 @@ void sticky_apply (df::viewscreen_choose_start_sitest * screen)
// Site finder is active - don't override default local position
return;
}
screen->embark_pos_min.x = sticky_pos[0];
screen->embark_pos_max.x = sticky_pos[1];
screen->embark_pos_min.y = sticky_pos[2];
screen->embark_pos_max.y = sticky_pos[3];
screen->location.embark_pos_min.x = sticky_pos[0];
screen->location.embark_pos_max.x = sticky_pos[1];
screen->location.embark_pos_min.y = sticky_pos[2];
screen->location.embark_pos_max.y = sticky_pos[3];
update_embark_sidebar(screen);
}

@ -33,9 +33,9 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
{
if (parameters.size() != 1)
return CR_WRONG_USAGE;
for (size_t i = 0; i < world->cur_savegame.map_features.size(); i++)
for (size_t i = 0; i < world->features.map_features.size(); i++)
{
df::feature_init *feature_init = world->cur_savegame.map_features[i];
df::feature_init *feature_init = world->features.map_features[i];
string name;
feature_init->getName(&name);
out.print("Feature #%i (\"%s\", type %s) is %s\n",
@ -48,12 +48,12 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
if (parameters.size() != 2)
return CR_WRONG_USAGE;
size_t i = atoi(parameters[1].c_str());
if ((i < 0) || (i >= world->cur_savegame.map_features.size()))
if ((i < 0) || (i >= world->features.map_features.size()))
{
out.print("No such feature!\n");
return CR_FAILURE;
}
df::feature_init *feature_init = world->cur_savegame.map_features[i];
df::feature_init *feature_init = world->features.map_features[i];
if (feature_init->flags.is_set(feature_init_flags::Discovered))
{
out.print("Selected feature is already discovered!\n");
@ -70,12 +70,12 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
if (parameters.size() != 2)
return CR_WRONG_USAGE;
size_t i = atoi(parameters[1].c_str());
if ((i < 0) || (i >= world->cur_savegame.map_features.size()))
if ((i < 0) || (i >= world->features.map_features.size()))
{
out.print("No such feature!\n");
return CR_FAILURE;
}
df::feature_init *feature_init = world->cur_savegame.map_features[i];
df::feature_init *feature_init = world->features.map_features[i];
if (!feature_init->flags.is_set(feature_init_flags::Discovered))
{
out.print("Selected feature is already hidden!\n");

@ -144,13 +144,13 @@ void doInfiniteSky(color_ostream& out, int32_t howMany) {
}
}
df::z_level_flags* flags = new df::z_level_flags[z_count_block+1];
memcpy(flags, world->map.z_level_flags, z_count_block*sizeof(df::z_level_flags));
memcpy(flags, world->map_extras.z_level_flags, z_count_block*sizeof(df::z_level_flags));
flags[z_count_block].whole = 0;
flags[z_count_block].bits.update = 1;
world->map.z_count_block++;
world->map.z_count++;
delete[] world->map.z_level_flags;
world->map.z_level_flags = flags;
delete[] world->map_extras.z_level_flags;
world->map_extras.z_level_flags = flags;
}
}

@ -180,7 +180,7 @@ const SkillColumn columns[] = {
{11, 3, profession::NONE, unit_labor::HAUL_REFUSE, job_skill::NONE, "Re"},
{11, 3, profession::NONE, unit_labor::HAUL_FURNITURE, job_skill::NONE, "Fu"},
{11, 3, profession::NONE, unit_labor::HAUL_ANIMAL, job_skill::NONE, "An"},
{11, 3, profession::NONE, unit_labor::PUSH_HAUL_VEHICLE, job_skill::NONE, "Ve"},
{11, 3, profession::NONE, unit_labor::HANDLE_VEHICLES, job_skill::NONE, "Ve"},
// Other Jobs
{12, 4, profession::ARCHITECT, unit_labor::ARCHITECT, job_skill::DESIGNBUILDING, "Ar"},
{12, 4, profession::ALCHEMIST, unit_labor::ALCHEMIST, job_skill::ALCHEMY, "Al"},
@ -217,6 +217,7 @@ const SkillColumn columns[] = {
{15, 8, profession::NONE, unit_labor::NONE, job_skill::SITUATIONAL_AWARENESS, "Ob"},
{15, 8, profession::NONE, unit_labor::NONE, job_skill::COORDINATION, "Cr"},
{15, 8, profession::NONE, unit_labor::NONE, job_skill::BALANCE, "Ba"},
{15, 8, profession::NONE, unit_labor::NONE, job_skill::CLIMBING, "Cl"},
// Social
{16, 3, profession::NONE, unit_labor::NONE, job_skill::PERSUASION, "Pe"},
{16, 3, profession::NONE, unit_labor::NONE, job_skill::NEGOTIATION, "Ne"},

@ -489,7 +489,7 @@ static command_result embark_prospector(color_ostream &out, df::viewscreen_choos
}
df::world_data *data = world->world_data;
coord2d cur_region = screen->region_pos;
coord2d cur_region = screen->location.region_pos;
auto cur_details = get_details(data, cur_region);
if (!cur_details)
@ -512,9 +512,9 @@ static command_result embark_prospector(color_ostream &out, df::viewscreen_choos
biomes[screen->biome_rgn[screen->biome_idx]]++;
}*/
for (int x = screen->embark_pos_min.x; x <= screen->embark_pos_max.x; x++)
for (int x = screen->location.embark_pos_min.x; x <= screen->location.embark_pos_max.x; x++)
{
for (int y = screen->embark_pos_min.y; y <= screen->embark_pos_max.y; y++)
for (int y = screen->location.embark_pos_min.y; y <= screen->location.embark_pos_max.y; y++)
{
EmbarkTileLayout tile;
if (!estimate_underground(out, tile, cur_details, x, y) ||

@ -147,8 +147,8 @@ void revealAdventure(color_ostream &out)
{
df::map_block *block = world->map.map_blocks[i];
// in 'no-hell'/'safe' mode, don't reveal blocks with hell and adamantine
if (!isSafe(block->map_pos))
continue;
// if (!isSafe(block->map_pos))
// continue;
designations40d & designations = block->designation;
// for each tile in block
for (uint32_t x = 0; x < 16; x++) for (uint32_t y = 0; y < 16; y++)
@ -430,7 +430,9 @@ command_result revflood(color_ostream &out, vector<string> & params)
case tiletype_shape::STAIR_UP:
case tiletype_shape::RAMP:
case tiletype_shape::FLOOR:
case tiletype_shape::TREE:
case tiletype_shape::BRANCH:
case tiletype_shape::TRUNK_BRANCH:
case tiletype_shape::TWIG:
case tiletype_shape::SAPLING:
case tiletype_shape::SHRUB:
case tiletype_shape::BOULDER:
@ -442,6 +444,12 @@ command_result revflood(color_ostream &out, vector<string> & params)
above = sides = true;
break;
}
if (tileMaterial(tt) == tiletype_material::PLANT || tileMaterial(tt) == tiletype_material::MUSHROOM)
{
if(from_below)
unhide = 0;
above = sides = true;
}
if(unhide)
{
des.bits.hidden = false;

@ -741,7 +741,6 @@ private:
virtual void do_post_init()
{
is_vermin = &viewscreen->is_vermin;
pet_info = &viewscreen->pet_info;
is_tame = &viewscreen->is_tame;
is_adopting = &viewscreen->is_adopting;
}
@ -764,7 +763,6 @@ private:
void save_secondary_values()
{
is_vermin_s = *is_vermin;
pet_info_s = *pet_info;
is_tame_s = *is_tame;
is_adopting_s = *is_adopting;
}
@ -772,7 +770,6 @@ private:
void reset_secondary_viewscreen_vectors()
{
is_vermin = NULL;
pet_info = NULL;
is_tame = NULL;
is_adopting = NULL;
}
@ -780,7 +777,6 @@ private:
void update_saved_secondary_list_item(size_t i, size_t j)
{
is_vermin_s[i] = (*is_vermin)[j];
pet_info_s[i] = (*pet_info)[j];
is_tame_s[i] = (*is_tame)[j];
is_adopting_s[i] = (*is_adopting)[j];
}
@ -788,7 +784,6 @@ private:
void clear_secondary_viewscreen_vectors()
{
is_vermin->clear();
pet_info->clear();
is_tame->clear();
is_adopting->clear();
}
@ -796,7 +791,6 @@ private:
void add_to_filtered_secondary_lists(size_t i)
{
is_vermin->push_back(is_vermin_s[i]);
pet_info->push_back(pet_info_s[i]);
is_tame->push_back(is_tame_s[i]);
is_adopting->push_back(is_adopting_s[i]);
}
@ -804,7 +798,6 @@ private:
void clear_secondary_saved_lists()
{
is_vermin_s.clear();
pet_info_s.clear();
is_tame_s.clear();
is_adopting_s.clear();
}
@ -812,7 +805,6 @@ private:
void restore_secondary_values()
{
*is_vermin = is_vermin_s;
*pet_info = pet_info_s;
*is_tame = is_tame_s;
*is_adopting = is_adopting_s;
}
@ -834,7 +826,6 @@ private:
}
std::vector<char > *is_vermin, is_vermin_s;
std::vector<df::pet_info* > *pet_info, pet_info_s;
std::vector<char > *is_tame, is_tame_s;
std::vector<char > *is_adopting, is_adopting_s;
};

@ -363,7 +363,6 @@ DEFINE_SORT_HANDLER(unit_sorters, pet, "/List", animals)
reorder_cursor(&animals->cursor, order);
reorder_vector(&animals->animal, order);
reorder_vector(&animals->is_vermin, order);
reorder_vector(&animals->pet_info, order);
reorder_vector(&animals->is_tame, order);
reorder_vector(&animals->is_adopting, order);
}

@ -980,6 +980,7 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
}
};
/*
IMPLEMENT_VMETHOD_INTERPOSE(military_training_ct_hook, process);
struct military_training_sd_hook : df::activity_event_skill_demonstrationst {
@ -1040,6 +1041,7 @@ struct military_training_id_hook : df::activity_event_individual_skill_drillst {
};
IMPLEMENT_VMETHOD_INTERPOSE(military_training_id_hook, process);
*/
struct hive_crash_hook : df::building_hivest {
typedef df::building_hivest interpose_base;
@ -1357,13 +1359,14 @@ static command_result tweak(color_ostream &out, vector <string> &parameters)
{
enable_hook(out, INTERPOSE_HOOK(military_assign_hook, render), parameters);
}
/*
else if (cmd == "military-training")
{
enable_hook(out, INTERPOSE_HOOK(military_training_ct_hook, process), parameters);
enable_hook(out, INTERPOSE_HOOK(military_training_sd_hook, process), parameters);
enable_hook(out, INTERPOSE_HOOK(military_training_sp_hook, process), parameters);
enable_hook(out, INTERPOSE_HOOK(military_training_id_hook, process), parameters);
}
}*/
else if (cmd == "hive-crash")
{
enable_hook(out, INTERPOSE_HOOK(hive_crash_hook, updateAction), parameters);