diff --git a/CMake/DownloadFile.cmake b/CMake/DownloadFile.cmake index 1a8a40562..8f9938f90 100644 --- a/CMake/DownloadFile.cmake +++ b/CMake/DownloadFile.cmake @@ -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() diff --git a/CMakeLists.txt b/CMakeLists.txt index d25404e27..1cae58c8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/NEWS.rst b/NEWS.rst index 0715ccae4..dd16cef7d 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -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 diff --git a/depends/gunzip.pl b/depends/gunzip.pl new file mode 100755 index 000000000..4a21daafd --- /dev/null +++ b/depends/gunzip.pl @@ -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"; diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 7746b8b51..90533aa96 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -818,6 +818,12 @@ Examples: ``autolabor CUTWOOD disable`` Turn off autolabor for wood cutting. +.. _labormanager: + +labormanager +============ +A more advanced alternative to `autolabor`. + .. _autohauler: autohauler diff --git a/library/include/LuaTools.h b/library/include/LuaTools.h index c8237eb56..e1d828271 100644 --- a/library/include/LuaTools.h +++ b/library/include/LuaTools.h @@ -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 + 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); diff --git a/library/include/modules/MapCache.h b/library/include/modules/MapCache.h index b1d411ab8..b64cc7859 100644 --- a/library/include/modules/MapCache.h +++ b/library/include/modules/MapCache.h @@ -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 blocks; }; } -#endif \ No newline at end of file +#endif diff --git a/plugins/Brushes.h b/plugins/Brushes.h index 99e9e4125..eaf4240ea 100644 --- a/plugins/Brushes.h +++ b/plugins/Brushes.h @@ -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 to_flood; @@ -198,19 +199,21 @@ public: return "flood"; } private: - void maybeFlood(DFCoord c, std::stack &to_flood, MapExtras::MapCache &mc) { + void maybeFlood(DFHack::DFCoord c, std::stack &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 & 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) diff --git a/plugins/confirm.cpp b/plugins/confirm.cpp index 3ea5d540c..b9927f4ea 100644 --- a/plugins/confirm.cpp +++ b/plugins/confirm.cpp @@ -176,19 +176,12 @@ namespace conf_lua { { Lua::Push(l_state, val); } - template - 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; diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 8e2a88611..2c78c0854 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -187,14 +187,6 @@ namespace dm_lua { return safe_call(nargs); } - template - 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; diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index f0fc57a6b..3ca15e0ec 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -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; } - + diff --git a/scripts b/scripts index 352dc4ac8..de9962079 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 352dc4ac8a169bf4789448f01d5121c740669400 +Subproject commit de996207994e4ce3e221c010c9cc042b06620a2e