Merge remote-tracking branch 'dscorbett/bitfield-constructors' into develop

develop
lethosor 2016-12-11 17:52:00 -05:00
commit 9e0221a44e
7 changed files with 15 additions and 13 deletions

@ -542,7 +542,7 @@ class DFHACK_EXPORT MapCache
df::tile_designation designationAt (DFCoord tilecoord) df::tile_designation designationAt (DFCoord tilecoord)
{ {
Block * b= BlockAtTile(tilecoord); Block * b= BlockAtTile(tilecoord);
return b ? b->DesignationAt(tilecoord) : df::tile_designation(0); return b ? b->DesignationAt(tilecoord) : df::tile_designation();
} }
bool setDesignationAt (DFCoord tilecoord, df::tile_designation des) bool setDesignationAt (DFCoord tilecoord, df::tile_designation des)
{ {
@ -554,7 +554,7 @@ class DFHACK_EXPORT MapCache
df::tile_occupancy occupancyAt (DFCoord tilecoord) df::tile_occupancy occupancyAt (DFCoord tilecoord)
{ {
Block * b= BlockAtTile(tilecoord); Block * b= BlockAtTile(tilecoord);
return b ? b->OccupancyAt(tilecoord) : df::tile_occupancy(0); return b ? b->OccupancyAt(tilecoord) : df::tile_occupancy();
} }
bool setOccupancyAt (DFCoord tilecoord, df::tile_occupancy occ) bool setOccupancyAt (DFCoord tilecoord, df::tile_occupancy occ)
{ {

@ -1303,16 +1303,16 @@ bool Gui::addCombatReportAuto(df::unit *unit, df::announcement_flags mode, int r
void Gui::showAnnouncement(std::string message, int color, bool bright) void Gui::showAnnouncement(std::string message, int color, bool bright)
{ {
df::announcement_flags mode(0); df::announcement_flags mode;
mode.bits.D_DISPLAY = mode.bits.A_DISPLAY = true; mode.bits.D_DISPLAY = mode.bits.A_DISPLAY = true;
makeAnnouncement(df::announcement_type(0), mode, df::coord(), message, color, bright); makeAnnouncement(df::announcement_type(), mode, df::coord(), message, color, bright);
} }
void Gui::showZoomAnnouncement( void Gui::showZoomAnnouncement(
df::announcement_type type, df::coord pos, std::string message, int color, bool bright df::announcement_type type, df::coord pos, std::string message, int color, bool bright
) { ) {
df::announcement_flags mode(0); df::announcement_flags mode;
mode.bits.D_DISPLAY = mode.bits.A_DISPLAY = true; mode.bits.D_DISPLAY = mode.bits.A_DISPLAY = true;
makeAnnouncement(type, mode, pos, message, color, bright); makeAnnouncement(type, mode, pos, message, color, bright);
@ -1335,7 +1335,7 @@ void Gui::showAutoAnnouncement(
) { ) {
using df::global::announcements; using df::global::announcements;
df::announcement_flags flags(0); df::announcement_flags flags;
flags.bits.D_DISPLAY = flags.bits.A_DISPLAY = true; flags.bits.D_DISPLAY = flags.bits.A_DISPLAY = true;
if (is_valid_enum_item(type) && announcements) if (is_valid_enum_item(type) && announcements)

@ -195,7 +195,7 @@ df::map_block *Maps::ensureTileBlock (int32_t x, int32_t y, int32_t z)
slot->map_pos.z = z; slot->map_pos.z = z;
// Assume sky // Assume sky
df::tile_designation dsgn(0); df::tile_designation dsgn;
dsgn.bits.light = true; dsgn.bits.light = true;
dsgn.bits.outside = true; dsgn.bits.outside = true;

@ -391,7 +391,9 @@ static int addBuilding(lua_State* L)
int y=lua_tonumber(L,-1); int y=lua_tonumber(L,-1);
lua_pop(L,1); lua_pop(L,1);
newDefinition.connections.can_connect.push_back(-1);//TODO add this too... df::machine_conn_modes modes;
modes.whole = -1;
newDefinition.connections.can_connect.push_back(modes);//TODO add this too...
newDefinition.connections.tiles.push_back(df::coord(x,y,0)); newDefinition.connections.tiles.push_back(df::coord(x,y,0));
lua_pop(L,1); lua_pop(L,1);

@ -547,8 +547,8 @@ static bool setTilesByKeyword(df::burrow *target, std::string name, bool enable)
{ {
CHECK_NULL_POINTER(target); CHECK_NULL_POINTER(target);
df::tile_designation mask(0); df::tile_designation mask;
df::tile_designation value(0); df::tile_designation value;
if (name == "ABOVE_GROUND") if (name == "ABOVE_GROUND")
mask.bits.subterranean = true; mask.bits.subterranean = true;

@ -1198,7 +1198,7 @@ private:
if (state_to_apply == -1) if (state_to_apply == -1)
state_to_apply = (item->flags.whole & flags.whole) ? 0 : 1; state_to_apply = (item->flags.whole & flags.whole) ? 0 : 1;
grouped_entry->setFlags(flags.whole, state_to_apply); grouped_entry->setFlags(flags, state_to_apply);
} }
} }

@ -793,7 +793,7 @@ static ItemConstraint *get_constraint(color_ostream &out, const std::string &str
if (item.subtype >= 0) if (item.subtype >= 0)
weight += 10000; weight += 10000;
df::dfhack_material_category mat_mask(0); df::dfhack_material_category mat_mask;
std::string maskstr = vector_get(tokens,1); std::string maskstr = vector_get(tokens,1);
if (!maskstr.empty() && !parseJobMaterialCategory(&mat_mask, maskstr)) { if (!maskstr.empty() && !parseJobMaterialCategory(&mat_mask, maskstr)) {
out.printerr("Cannot decode material mask: %s\n", maskstr.c_str()); out.printerr("Cannot decode material mask: %s\n", maskstr.c_str());
@ -1031,7 +1031,7 @@ static int cbEnumJobOutputs(lua_State *L)
lua_settop(L, 6); lua_settop(L, 6);
df::dfhack_material_category mat_mask(0); df::dfhack_material_category mat_mask;
if (!lua_isnil(L, 3)) if (!lua_isnil(L, 3))
Lua::CheckDFAssign(L, &mat_mask, 3); Lua::CheckDFAssign(L, &mat_mask, 3);