Merge branch 'develop' of https://github.com/DFHack/dfhack into develop

develop
Japa 2016-10-16 06:33:04 +05:30
commit 84ea03f68c
12 changed files with 113 additions and 56 deletions

@ -31,7 +31,9 @@ function(download_file_unzip URL ZIP_TYPE ZIP_DEST ZIP_MD5 UNZIP_DEST UNZIP_MD5)
if(EXISTS "${ZIP_DEST}")
message("* Decompressing ${FILENAME}")
if("${ZIP_TYPE}" STREQUAL "gz")
execute_process(COMMAND gunzip --force "${ZIP_DEST}")
execute_process(COMMAND
"${PERL_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/depends/gunzip.pl"
"${ZIP_DEST}" --force)
else()
message(SEND_ERROR "Unknown ZIP_TYPE: ${ZIP_TYPE}")
endif()

@ -137,8 +137,8 @@ endif()
# set up versioning.
set(DF_VERSION "0.43.05")
SET(DFHACK_RELEASE "alpha0")
SET(DFHACK_PRERELEASE FALSE)
SET(DFHACK_RELEASE "alpha1")
SET(DFHACK_PRERELEASE TRUE)
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

@ -33,8 +33,31 @@ Changelog
DFHack future
=============
Internals
---------
- 64-bit support on all platforms
- Visual Studio 2015 now required on Windows instead of 2010
- GCC 4.8 recommended on Linux and OS X (and now supported on OS X)
- Several structure fixes to match 64-bit DF's memory layout
Lua
---
- Lua has been updated to 5.3 - see http://www.lua.org/manual/5.3/readme.html for details
- Floats are no longer implicitly converted to integers in DFHack API calls
- ``df.new()`` supports more types: ``char``, ``intptr_t``, ``uintptr_t``, ``long``, ``unsigned long``
- String representations of vectors and a few other containers now include their lengths
Ruby
----
- Added support for loading ruby 2.x libraries
- Fixed some layouts on x64 (incomplete)
New Plugins
-----------
- `dwarfvet` enables animal caretaking
- `labormanager` (formerly autolabor2): a more advanced alternative to `autolabor`
- `title-folder`: shows DF folder name in window title bar when enabled
New Scripts
@ -43,7 +66,20 @@ New Scripts
Fixes
-----
- The DF path on OS X can now contain spaces and ``:`` characters
- Buildings::setOwner() changes now persist properly when saved
- `devel/find-offsets`: fixed a crash when vtables used by globals aren't available
Misc Improvements
-----------------
- `lua` and `gui/gm-editor` now support the same aliases (``scr``, ``unit``, etc.)
- `remotefortressreader`: Added support for
- world map snow coverage
- spatters
- wall info
- site towers, world buildings
- surface material
DFHack 0.43.03-r1
=================
@ -52,10 +88,6 @@ Lua
---
- Label widgets can now easily register handlers for mouse clicks
New Plugins
-----------
- `dwarfvet` enables animal caretaking.
New Features
------------
- `add-thought`: allow syndrome name as ``-thought`` argument

@ -0,0 +1,21 @@
#!/usr/bin/perl
use strict;
use warnings;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
my %args = map { $_ => 1 } @ARGV;
my $in_file = $ARGV[0] or die "no input file";
# remove extension
(my $out_file = $in_file) =~ s{\.[^.]+$}{};
if (! -f $in_file) {
die "input file does not exist: \"$in_file\"\n";
}
if (-f $out_file and !exists($args{'--force'})) {
die "output file exists, not overwriting: \"$out_file\"";
}
gunzip $in_file => $out_file or die "gunzip failed: $GunzipError\n";

@ -818,6 +818,12 @@ Examples:
``autolabor CUTWOOD disable``
Turn off autolabor for wood cutting.
.. _labormanager:
labormanager
============
A more advanced alternative to `autolabor`.
.. _autohauler:
autohauler

@ -341,6 +341,14 @@ namespace DFHack {namespace Lua {
DFHACK_EXPORT int PushPosXYZ(lua_State *state, df::coord pos);
DFHACK_EXPORT int PushPosXY(lua_State *state, df::coord2d pos);
template <typename T_Key, typename T_Value>
inline void TableInsert(lua_State *state, T_Key key, T_Value value)
{
Lua::Push(state, key);
Lua::Push(state, value);
lua_settable(state, -3);
}
DFHACK_EXPORT void CheckPen(lua_State *L, Screen::Pen *pen, int index, bool allow_nil = false, bool allow_color = true);
DFHACK_EXPORT bool IsCoreContext(lua_State *state);

@ -38,8 +38,6 @@ distribution.
#include "df/item.h"
#include "df/inclusion_type.h"
using namespace DFHack;
namespace df {
struct world_region_details;
}
@ -47,6 +45,8 @@ namespace df {
namespace MapExtras
{
using namespace DFHack;
class DFHACK_EXPORT MapCache;
class Block;
@ -626,4 +626,4 @@ private:
std::map<DFCoord, Block *> blocks;
};
}
#endif
#endif

@ -152,10 +152,11 @@ public:
class FloodBrush : public Brush
{
public:
FloodBrush(Core *c){c_ = c;};
FloodBrush(DFHack::Core *c){c_ = c;};
~FloodBrush(){};
coord_vec points(MapExtras::MapCache & mc, DFHack::DFCoord start)
{
using namespace DFHack;
coord_vec v;
std::stack<DFCoord> to_flood;
@ -198,19 +199,21 @@ public:
return "flood";
}
private:
void maybeFlood(DFCoord c, std::stack<DFCoord> &to_flood, MapExtras::MapCache &mc) {
void maybeFlood(DFHack::DFCoord c, std::stack<DFHack::DFCoord> &to_flood,
MapExtras::MapCache &mc) {
if (mc.testCoord(c)) {
to_flood.push(c);
}
}
Core *c_;
DFHack::Core *c_;
};
command_result parseRectangle(color_ostream & out,
DFHack::command_result parseRectangle(DFHack::color_ostream & out,
vector<string> & input, int start, int end,
int & width, int & height, int & zLevels,
bool hasConsole = true)
{
using namespace DFHack;
int newWidth = 0, newHeight = 0, newZLevels = 0;
if (end > start + 1)

@ -176,19 +176,12 @@ namespace conf_lua {
{
Lua::Push(l_state, val);
}
template <typename KeyType, typename ValueType>
void table_set (lua_State *L, KeyType k, ValueType v)
{
Lua::Push(L, k);
Lua::Push(L, v);
lua_settable(L, -3);
}
namespace api {
int get_ids (lua_State *L)
{
lua_newtable(L);
for (auto it = confirmations.begin(); it != confirmations.end(); ++it)
table_set(L, it->first, true);
Lua::TableInsert(L, it->first, true);
return 1;
}
int get_conf_data (lua_State *L)
@ -199,8 +192,8 @@ namespace conf_lua {
{
Lua::Push(L, i++);
lua_newtable(L);
table_set(L, "id", it->first);
table_set(L, "enabled", it->second->is_enabled());
Lua::TableInsert(L, "id", it->first);
Lua::TableInsert(L, "enabled", it->second->is_enabled());
lua_settable(L, -3);
}
return 1;

@ -187,14 +187,6 @@ namespace dm_lua {
return safe_call(nargs);
}
template <typename KeyType, typename ValueType>
void table_set (lua_State *L, KeyType k, ValueType v)
{
Lua::Push(L, k);
Lua::Push(L, v);
lua_settable(L, -3);
}
namespace api {
int monitor_state (lua_State *L)
{
@ -229,7 +221,7 @@ namespace dm_lua {
}
}
lua_newtable(L);
#define WTYPE(type, name) dm_lua::table_set(L, #type, type);
#define WTYPE(type, name) Lua::TableInsert(L, #type, type);
WEATHER_TYPES
#undef WTYPE
#undef WEATHER_TYPES
@ -242,9 +234,9 @@ namespace dm_lua {
{
Lua::Push(L, i);
lua_newtable(L);
dm_lua::table_set(L, "value", misery[i]);
dm_lua::table_set(L, "color", monitor_colors[i]);
dm_lua::table_set(L, "last", (i == 6));
Lua::TableInsert(L, "value", misery[i]);
Lua::TableInsert(L, "color", monitor_colors[i]);
Lua::TableInsert(L, "last", (i == 6));
lua_settable(L, -3);
}
return 1;

@ -188,15 +188,15 @@ enum MatterState
message Spatter
{
optional MatPair material = 1;
optional int32 amount = 2;
optional MatterState state = 3;
optional MatPair item = 4;
optional MatPair material = 1;
optional int32 amount = 2;
optional MatterState state = 3;
optional MatPair item = 4;
}
message SpatterPile
{
repeated Spatter spatters = 1;
repeated Spatter spatters = 1;
}
message MapBlock
@ -225,7 +225,7 @@ message MapBlock
repeated int32 tree_y = 22;
repeated int32 tree_z = 23;
repeated TileDigDesignation tile_dig_designation = 24;
repeated SpatterPile spatterPile = 25;
repeated SpatterPile spatterPile = 25;
}
message MatPair {
@ -475,21 +475,21 @@ message SiteRealizationBuildingWall
message SiteRealizationBuildingTower
{
optional int32 roof_z = 1;
optional bool round = 2;
optional bool goblin = 3;
optional bool round = 2;
optional bool goblin = 3;
}
message TrenchSpoke
{
optional int32 mound_start = 1;
optional int32 trench_start = 2;
optional int32 trench_end = 3;
optional int32 mound_end = 4;
optional int32 mound_start = 1;
optional int32 trench_start = 2;
optional int32 trench_end = 3;
optional int32 mound_end = 4;
}
message SiteRealizationBuildingTrenches
{
repeated TrenchSpoke spokes = 1;
repeated TrenchSpoke spokes = 1;
}
message SiteRealizationBuilding
@ -503,7 +503,7 @@ message SiteRealizationBuilding
optional MatPair material = 7;
optional SiteRealizationBuildingWall wall_info = 8;
optional SiteRealizationBuildingTower tower_info = 9;
optional SiteRealizationBuildingTrenches trench_info = 10;
optional SiteRealizationBuildingTrenches trench_info = 10;
}
message RegionTile
@ -519,11 +519,11 @@ message RegionTile
optional int32 salinity = 9;
optional RiverTile river_tiles = 10;
optional int32 water_elevation = 11;
optional MatPair surface_material = 12;
repeated MatPair plant_materials = 13;
optional MatPair surface_material = 12;
repeated MatPair plant_materials = 13;
repeated SiteRealizationBuilding buildings = 14;
repeated MatPair stone_materials = 15;
repeated MatPair tree_materials = 16;
repeated MatPair stone_materials = 15;
repeated MatPair tree_materials = 16;
optional int32 snow = 17;
}
@ -725,4 +725,4 @@ message KeyboardEvent
optional uint32 mod = 6;
optional uint32 unicode = 7;
}

@ -1 +1 @@
Subproject commit 352dc4ac8a169bf4789448f01d5121c740669400
Subproject commit de996207994e4ce3e221c010c9cc042b06620a2e