Merge upstream/master

develop
Mike Stewart 2012-01-28 13:32:48 -08:00
commit b07d3b25b5
30 changed files with 534 additions and 749 deletions

@ -653,6 +653,7 @@ bool Console::init(bool sharing)
FD_SET(STDIN_FILENO, &d->descriptor_set);
FD_SET(d->exit_pipe[0], &d->descriptor_set);
inited = true;
return true;
}
bool Console::shutdown(void)

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -629,7 +629,7 @@ bool Core::Init()
// init the console.
Gui * g = getGui();
bool is_text_mode = false;
if(g->init && g->init->graphics.flags.is_set(GRAPHICS_TEXT))
if(df::global::init && df::global::init->display.flag.is_set(df::enums::init_display_flags::TEXT))
{
is_text_mode = true;
}
@ -843,19 +843,18 @@ bool Core::ncurses_wgetch(int in, int & out)
int idx = in - KEY_F(1);
// FIXME: copypasta, push into a method!
Gui * g = getGui();
if(g->hotkeys && g->df_interface && g->df_menu_state)
if(df::global::ui && df::global::gview && g->df_menu_state)
{
t_viewscreen * ws = g->GetCurrentScreen();
df::viewscreen * ws = g->GetCurrentScreen();
// FIXME: put hardcoded values into memory.xml
if(ws->getClassName() == "viewscreen_dwarfmodest" && *g->df_menu_state == 0x23)
if(((t_virtual *)ws)->getClassName() == "viewscreen_dwarfmodest" && *g->df_menu_state == 0x23)
{
out = in;
return true;
}
else
{
t_hotkey & hotkey = (*g->hotkeys)[idx];
setHotkeyCmd(hotkey.name);
setHotkeyCmd(df::global::ui->main.hotkeys[idx].name);
return false;
}
}
@ -1091,6 +1090,5 @@ TYPE * Core::get##TYPE() \
MODULE_GETTER(Gui);
MODULE_GETTER(World);
MODULE_GETTER(Materials);
MODULE_GETTER(Constructions);
MODULE_GETTER(Notes);
MODULE_GETTER(Graphic);

@ -30,45 +30,45 @@ namespace DFHack
{
const TileRow tileTypeTable[TILE_TYPE_ARRAY_LENGTH] =
{
// 0
// 0x000
{"void",tileshape_invalid, tilematerial_invalid, VAR_1},
{"ramp top",RAMP_TOP, AIR, VAR_1},
{"pool",POOL, SOIL, VAR_1},
{"murky pool",POOL, SOIL, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
// 10
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x010
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{0, tileshape_invalid, tilematerial_invalid, VAR_1},
{"driftwood stack",FLOOR, DRIFTWOOD, VAR_1},
// 20
{"driftwood",FLOOR, DRIFTWOOD, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"tree",TREE_OK, SOIL, VAR_1},
{"ice stair up/down",STAIR_UPDOWN, ICE, VAR_1},
{"ice stair down",STAIR_DOWN, ICE, VAR_1},
{"ice stair up",STAIR_UP, ICE, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 30
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x020
{"empty space",EMPTY, AIR, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"shrub",SHRUB_OK, SOIL, VAR_1},
@ -77,46 +77,44 @@ namespace DFHack
{"obsidian stair down",STAIR_DOWN, OBSIDIAN, VAR_1},
{"obsidian stair up",STAIR_UP, OBSIDIAN, VAR_1},
{"soil stair up/down",STAIR_UPDOWN, SOIL, VAR_1},
// 40
{"soil stair down",STAIR_DOWN, SOIL, VAR_1},
{"soil stair up",STAIR_UP, SOIL, VAR_1},
{"eerie pit",ENDLESS_PIT, HFS, VAR_1},
{"smooth stone floor",FLOOR, STONE, VAR_1 , TILE_SMOOTH },
{"smooth obsidian floor",FLOOR, OBSIDIAN, VAR_1 , TILE_SMOOTH },
{"smooth featstone? floor",FLOOR, FEATSTONE, VAR_1 , TILE_SMOOTH },
{"smooth featstone floor",FLOOR, FEATSTONE, VAR_1 , TILE_SMOOTH },
{"smooth vein floor",FLOOR, VEIN, VAR_1 , TILE_SMOOTH },
{"smooth ice floor",FLOOR, ICE, VAR_1 , TILE_SMOOTH },
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"grass stair up/down",STAIR_UPDOWN, GRASS, VAR_1},
// 50
{"grass stair down",STAIR_DOWN, GRASS, VAR_1},
{"grass stair up",STAIR_UP, GRASS, VAR_1},
{"grass2 stair up/down",STAIR_UPDOWN, GRASS2, VAR_1},
{"grass2 stair down",STAIR_DOWN, GRASS2, VAR_1},
{"grass2 stair up",STAIR_UP, GRASS2, VAR_1},
// 0x030
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"light grass stair up/down",STAIR_UPDOWN, GRASS, VAR_1},
{"light grass stair down",STAIR_DOWN, GRASS, VAR_1},
{"light grass stair up",STAIR_UP, GRASS, VAR_1},
{"dark grass stair up/down",STAIR_UPDOWN, GRASS2, VAR_1},
{"dark grass stair down",STAIR_DOWN, GRASS2, VAR_1},
{"dark grass stair up",STAIR_UP, GRASS2, VAR_1},
{"stone stair up/down",STAIR_UPDOWN, STONE, VAR_1},
{"stone stair down",STAIR_DOWN, STONE, VAR_1},
{"stone stair up",STAIR_UP, STONE, VAR_1},
{"vein stair up/down",STAIR_UPDOWN, VEIN, VAR_1},
{"vein stair down",STAIR_DOWN, VEIN, VAR_1},
// 60
{"vein stair up",STAIR_UP, VEIN, VAR_1},
{"featstone? stair up/down",STAIR_UPDOWN, FEATSTONE, VAR_1},
{"featstone? stair down",STAIR_DOWN, FEATSTONE, VAR_1},
{"featstone? stair up",STAIR_UP, FEATSTONE, VAR_1},
{"featstone stair up/down",STAIR_UPDOWN, FEATSTONE, VAR_1},
{"featstone stair down",STAIR_DOWN, FEATSTONE, VAR_1},
{"featstone stair up",STAIR_UP, FEATSTONE, VAR_1},
// 0x040
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"stone fortification",FORTIFICATION, STONE, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"campfire",FLOOR, CAMPFIRE, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 70
{"fire",FLOOR, FIRE, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -126,45 +124,45 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"stone pillar",PILLAR, STONE, VAR_1},
//80
// 0x050
{"obsidian pillar",PILLAR, OBSIDIAN, VAR_1,TILE_SMOOTH},
{"featstone? pillar",PILLAR, FEATSTONE, VAR_1,TILE_SMOOTH},
{"featstone pillar",PILLAR, FEATSTONE, VAR_1,TILE_SMOOTH},
{"vein pillar",PILLAR, VEIN, VAR_1,TILE_SMOOTH},
{"ice pillar",PILLAR, ICE, VAR_1,TILE_SMOOTH},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"waterfall landing",FLOOR, SOIL, VAR_1, TILE_WATERFALL }, // verify material
// 90
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"waterfall",FLOOR, SOIL, VAR_1, TILE_WATERFALL }, // verify material
{"river source",FLOOR, SOIL, VAR_1, TILE_RIVER_SOURCE }, // verify material
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x060
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 100
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 110
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x070
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -174,7 +172,6 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 120
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -183,36 +180,36 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x080
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 130
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 140
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x090
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 150
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -222,7 +219,7 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 160
// 0x0A0
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -231,36 +228,36 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 170
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x0B0
{"cracked stone wall" ,WALL, STONE, VAR_1, TILE_CRACKED },
{"damaged stone wall" ,WALL, STONE, VAR_1, TILE_DAMAGED },
{"worn stone wall" ,WALL, STONE, VAR_1, TILE_WORN },
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 180
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 190
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x0C0
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -270,7 +267,6 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 200
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -279,46 +275,46 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x0D0
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 210
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"stone wall" ,WALL, STONE, VAR_1},
// 220
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x0E0
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 230
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"sapling" ,SAPLING_OK, SOIL, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"dry grass ramp" ,RAMP, GRASS_DRY, VAR_1},
{"dead grass ramp" ,RAMP, GRASS_DEAD, VAR_1},
{"grass ramp" ,RAMP, GRASS, VAR_1},
{"grass ramp" ,RAMP, GRASS2, VAR_1},
{"light grass ramp" ,RAMP, GRASS, VAR_1},
{"dark grass ramp" ,RAMP, GRASS2, VAR_1},
{"stone ramp" ,RAMP, STONE, VAR_1},
{"obsidian ramp" ,RAMP, OBSIDIAN, VAR_1},
{"featstone? ramp" ,RAMP, FEATSTONE, VAR_1},
{"featstone ramp" ,RAMP, FEATSTONE, VAR_1},
// 240
// 0x0F0
{"vein ramp" ,RAMP, VEIN, VAR_1},
{"soil ramp" ,RAMP, SOIL, VAR_1},
{"ashes" ,FLOOR, ASHES, VAR_1},
@ -327,36 +323,36 @@ namespace DFHack
{"ice ramp" ,RAMP, ICE, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 250
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x100
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"ice floor" ,FLOOR, ICE, VAR_2},
{"ice floor" ,FLOOR, ICE, VAR_3},
// 260
{"ice floor" ,FLOOR, ICE, VAR_4},
{"furrowed soil" ,FLOOR, SOIL, VAR_1},
{"ice floor" ,FLOOR, ICE, VAR_1},
{"semi-molten rock" ,WALL, MAGMA, VAR_1},// unminable magma wall
{"magma" ,FLOOR, MAGMA, VAR_1},
{"magma flow" ,FLOOR, MAGMA, VAR_1},
{"soil wall" ,WALL, SOIL, VAR_1},
{"glowing barrier" ,WALL, CYAN_GLOW, VAR_1},
{"glowing floor" ,FLOOR, CYAN_GLOW, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"smooth obsidian wall RD2",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "--SS--E-" },
// 270
{"smooth obsidian wall R2D",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "--S---EE" },
{"smooth obsidian wall R2U",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N-----EE" },
// 0x110
{"smooth obsidian wall RU2",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "NN----E-" },
{"smooth obsidian wall L2U",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N---WW--" },
{"smooth obsidian wall LU2",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "NN--W---" },
@ -366,7 +362,6 @@ namespace DFHack
{"smooth obsidian wall RUD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N-S---E-" },
{"smooth obsidian wall LRD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "--S-W-E-" },
// 280
{"smooth obsidian wall LRU",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N---W-E-" },
{"smooth obsidian wall LUD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N-S-W---" },
{"smooth obsidian wall RD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "--S---E-" },
@ -375,36 +370,36 @@ namespace DFHack
{"smooth obsidian wall LD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "--S-W---" },
{"smooth obsidian wall UD",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "N-S-----" },
{"smooth obsidian wall LR",WALL,OBSIDIAN,VAR_1 , TILE_SMOOTH , "----W-E-" },
// 0x120
{"smooth featstone wall RD2",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--SS--E-" },
{"smooth featstone wall R2D",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--S---EE" },
// 290
{"smooth featstone wall R2U",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N-----EE" },
{"smooth featstone wall RU2",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "NN----E-" },
{"smooth featstone wall L2U",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N---WW--" },
{"smooth featstone wall LU2",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "NN--W---" },
{"smooth featstone wall L2D",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--S-WW--" },
{"smooth featstone wall LD2",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--SSW---" },
{"smooth featstone wall LRUD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH ,"N-S-W-E-" },
{"smooth featstone wall RUD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N-S---E-" },
{"smooth featstone wall LRD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--S-W-E-" },
{"smooth featstone wall LRU",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N---W-E-" },
//300
{"smooth featstone wall LUD",WALL,FEATSTONE,VAR_1, TILE_SMOOTH , "N-S-W---" },
{"smooth featstone wall RD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--S---E-" },
{"smooth featstone wall RU",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N-----E-" },
{"smooth featstone wall LU",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N---W---" },
// 0x130
{"smooth featstone wall LD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "--S-W---" },
{"smooth featstone wall UD",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "N-S-----" },
{"smooth featstone wall LR",WALL,FEATSTONE,VAR_1 , TILE_SMOOTH , "----W-E-" },
{"smooth stone wall RD2",WALL,STONE,VAR_1 , TILE_SMOOTH , "--SS--E-" },
{"smooth stone wall R2D",WALL,STONE,VAR_1 , TILE_SMOOTH , "--S---EE" },
{"smooth stone wall R2U",WALL,STONE,VAR_1 , TILE_SMOOTH , "N-----EE" },
//310
{"smooth stone wall RU2",WALL,STONE,VAR_1 , TILE_SMOOTH , "NN----E-" },
{"smooth stone wall L2U",WALL,STONE,VAR_1 , TILE_SMOOTH , "N---WW--" },
{"smooth stone wall LU2",WALL,STONE,VAR_1 , TILE_SMOOTH , "NN--W---" },
{"smooth stone wall L2D",WALL,STONE,VAR_1 , TILE_SMOOTH , "--S-WW--" },
{"smooth stone wall LD2",WALL,STONE,VAR_1 , TILE_SMOOTH , "--SSW---" },
@ -414,7 +409,7 @@ namespace DFHack
{"smooth stone wall LRU",WALL,STONE,VAR_1 , TILE_SMOOTH , "N---W-E-" },
{"smooth stone wall LUD",WALL,STONE,VAR_1 , TILE_SMOOTH , "N-S-W---" },
//320
// 0x140
{"smooth stone wall RD",WALL,STONE,VAR_1 , TILE_SMOOTH , "--S---E-" },
{"smooth stone wall RU",WALL,STONE,VAR_1 , TILE_SMOOTH , "N-----E-" },
{"smooth stone wall LU",WALL,STONE,VAR_1 , TILE_SMOOTH , "N---W---" },
@ -422,47 +417,46 @@ namespace DFHack
{"smooth stone wall UD",WALL,STONE,VAR_1 , TILE_SMOOTH , "N-S-----" },
{"smooth stone wall LR",WALL,STONE,VAR_1 , TILE_SMOOTH , "----W-E-" },
{"obsidian fortification",FORTIFICATION,OBSIDIAN,VAR_1},
{"featstone? fortification",FORTIFICATION,FEATSTONE,VAR_1},
{"featstone fortification",FORTIFICATION,FEATSTONE,VAR_1},
{"cracked obsidian wall",WALL,OBSIDIAN,VAR_1, TILE_CRACKED },
{"damaged obsidian wall",WALL,OBSIDIAN,VAR_1, TILE_DAMAGED },
// 330
{"worn obsidian wall",WALL,OBSIDIAN,VAR_1, TILE_WORN},
{"obsidian wall",WALL,OBSIDIAN,VAR_1},
{"cracked featstone wall",WALL,FEATSTONE,VAR_1, TILE_CRACKED },
{"damaged featstone wall",WALL,FEATSTONE,VAR_1, TILE_DAMAGED },
{"worn featstone wall",WALL,FEATSTONE,VAR_1, TILE_WORN },
{"featstone wall",WALL,FEATSTONE,VAR_1},
{"stone floor",FLOOR,STONE,VAR_1},
{"stone floor",FLOOR,STONE,VAR_2},
{"stone floor",FLOOR,STONE,VAR_3},
{"stone floor",FLOOR,STONE,VAR_4},
// 340
{"obsidian floor",FLOOR,OBSIDIAN,VAR_1},
{"obsidian floor",FLOOR,OBSIDIAN,VAR_2},
{"obsidian floor",FLOOR,OBSIDIAN,VAR_3},
{"obsidian floor",FLOOR,OBSIDIAN,VAR_4},
// 0x150
{"stone floor 1",FLOOR,STONE,VAR_1},
{"stone floor 2",FLOOR,STONE,VAR_2},
{"stone floor 3",FLOOR,STONE,VAR_3},
{"stone floor 4",FLOOR,STONE,VAR_4},
{"obsidian floor 1",FLOOR,OBSIDIAN,VAR_1},
{"obsidian floor 2",FLOOR,OBSIDIAN,VAR_2},
{"obsidian floor 3",FLOOR,OBSIDIAN,VAR_3},
{"obsidian floor 4",FLOOR,OBSIDIAN,VAR_4},
{"featstone floor 1",FLOOR,FEATSTONE,VAR_1},
{"featstone floor 2",FLOOR,FEATSTONE,VAR_2},
{"featstone floor 3",FLOOR,FEATSTONE,VAR_3},
{"featstone floor 4",FLOOR,FEATSTONE,VAR_4},
{"grass 1",FLOOR,GRASS,VAR_1},
{"grass 2",FLOOR,GRASS,VAR_2},
// 350
{"grass 3",FLOOR,GRASS,VAR_3},
{"grass 4",FLOOR,GRASS,VAR_4},
{"soil floor",FLOOR,SOIL,VAR_1},
{"soil floor",FLOOR,SOIL,VAR_2},
{"soil floor",FLOOR,SOIL,VAR_3},
{"soil floor",FLOOR,SOIL,VAR_4},
{"wet soil floor",FLOOR,SOIL,VAR_1},
{"wet soil floor",FLOOR,SOIL,VAR_2},
{"wet soil floor",FLOOR,SOIL,VAR_3},
{"wet soil floor",FLOOR,SOIL,VAR_4},
// 360
{"dark grass 1",FLOOR,GRASS2,VAR_1},
{"dark grass 2",FLOOR,GRASS2,VAR_2},
{"dark grass 3",FLOOR,GRASS2,VAR_3},
{"dark grass 4",FLOOR,GRASS2,VAR_4},
// 0x160
{"soil floor 1",FLOOR,SOIL,VAR_1},
{"soil floor 2",FLOOR,SOIL,VAR_2},
{"soil floor 3",FLOOR,SOIL,VAR_3},
{"soil floor 4",FLOOR,SOIL,VAR_4},
{"wet soil floor 1",FLOOR,SOIL,VAR_1},
{"wet soil floor 2",FLOOR,SOIL,VAR_2},
{"wet soil floor 3",FLOOR,SOIL,VAR_3},
{"wet soil floor 4",FLOOR,SOIL,VAR_4},
{"ice fortification",FORTIFICATION,ICE,VAR_1},
{"cracked ice wall",WALL,ICE,VAR_1, TILE_CRACKED},
{"damaged ice wall",WALL,ICE,VAR_1, TILE_DAMAGED},
@ -471,84 +465,84 @@ namespace DFHack
{"river N",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "N" },
{"river S",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "S" },
{"river E",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "E" },
// 0x170
{"river W",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "W" },
{"river NW",RIVER_BED,SOIL,VAR_1,TILE_NORMAL, "NW"},
//370
{"river NE",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "NE" },
{"river SW",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "SW" },
{"river SE",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "SE" },
{"brook bed N",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "N" },
{"brook bed S",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "S" },
{"brook bed E",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "E" },
{"brook bed W",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "W" },
{"brook bed NW",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "NW" },
{"brook bed NE",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "NE" },
{"brook bed SW",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "SW" },
// 380
{"brook bed SE",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "SE" },
{"brook top",BROOK_TOP,SOIL,VAR_1 },
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 0x180
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"dry grass 1",FLOOR,GRASS_DRY,VAR_1},
{"dry grass 2",FLOOR,GRASS_DRY,VAR_2},
{"dry grass 3",FLOOR,GRASS_DRY,VAR_3},
// 390
{"dry grass 4",FLOOR,GRASS_DRY,VAR_4},
{"dead tree",TREE_DEAD,SOIL,VAR_1},
{"dead sapling",SAPLING_DEAD,SOIL,VAR_1},
{"dead shrub",SHRUB_DEAD,SOIL,VAR_1},
{"dead grass 1",FLOOR,GRASS_DEAD,VAR_1},
{"dead grass 2",FLOOR,GRASS_DEAD,VAR_2},
{"dead grass 3",FLOOR,GRASS_DEAD,VAR_3},
{"dead grass 4",FLOOR,GRASS_DEAD,VAR_4},
{"grass B1",FLOOR,GRASS2,VAR_1},
{"grass B2",FLOOR,GRASS2,VAR_2},
{"light grass 1",FLOOR,GRASS,VAR_1},
{"light grass 2",FLOOR,GRASS,VAR_2},
// 400
{"grass B3",FLOOR,GRASS2,VAR_3},
{"grass B4",FLOOR,GRASS2,VAR_4},
// 0x190
{"light grass 3",FLOOR,GRASS,VAR_3},
{"light grass 4",FLOOR,GRASS,VAR_4},
{"boulder",BOULDER,STONE,VAR_1},
{"obsidian boulder",BOULDER,OBSIDIAN,VAR_1},
{"featstone? boulder",BOULDER,FEATSTONE,VAR_1},
{"pebbles 1",PEBBLES,STONE,VAR_1},
{"pebbles 2",PEBBLES,STONE,VAR_2},
{"pebbles 3",PEBBLES,STONE,VAR_3},
{"pebbles 4",PEBBLES,STONE,VAR_4},
{"obsidian shards",PEBBLES,OBSIDIAN,VAR_1},
// 410
{"obsidian shards",PEBBLES,OBSIDIAN,VAR_2},
{"obsidian shards",PEBBLES,OBSIDIAN,VAR_3},
{"obsidian shards",PEBBLES,OBSIDIAN,VAR_4},
{"featstone? pebbles",PEBBLES,FEATSTONE,VAR_1},
{"featstone? pebbles",PEBBLES,FEATSTONE,VAR_2},
{"featstone? pebbles",PEBBLES,FEATSTONE,VAR_3},
{"featstone? pebbles",PEBBLES,FEATSTONE,VAR_4},
{"featstone boulder",BOULDER,FEATSTONE,VAR_1},
{"stone pebbles 1",PEBBLES,STONE,VAR_1},
{"stone pebbles 2",PEBBLES,STONE,VAR_2},
{"stone pebbles 3",PEBBLES,STONE,VAR_3},
{"stone pebbles 4",PEBBLES,STONE,VAR_4},
{"obsidian pebbles 1",PEBBLES,OBSIDIAN,VAR_1},
{"obsidian pebbles 2",PEBBLES,OBSIDIAN,VAR_2},
{"obsidian pebbles 3",PEBBLES,OBSIDIAN,VAR_3},
{"obsidian pebbles 4",PEBBLES,OBSIDIAN,VAR_4},
{"featstone pebbles 1",PEBBLES,FEATSTONE,VAR_1},
{"featstone pebbles 2",PEBBLES,FEATSTONE,VAR_2},
{"featstone pebbles 3",PEBBLES,FEATSTONE,VAR_3},
// 0x1A0
{"featstone pebbles 4",PEBBLES,FEATSTONE,VAR_4},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--SS--E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--S---EE"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-----EE" },
// 420
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "NN----E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N---WW--"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "NN--W---"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--S-WW--" },
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--SSW---"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-S-W-E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-S---E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--S-W-E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N---W-E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-S-W---"},
// 430
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--S---E-"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-----E-"},
// 0x1B0
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N---W---"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "--S-W---"},
{"smooth vein wall",WALL,VEIN,VAR_1 , TILE_SMOOTH , "N-S-----"},
@ -558,45 +552,44 @@ namespace DFHack
{"damaged vein wall",WALL,VEIN,VAR_1, TILE_DAMAGED },
{"worn vein wall",WALL,VEIN,VAR_1 , TILE_WORN },
// 440
{"vein wall",WALL,VEIN,VAR_1},
{"vein floor",FLOOR,VEIN,VAR_1},
{"vein floor",FLOOR,VEIN,VAR_2},
{"vein floor",FLOOR,VEIN,VAR_3},
{"vein floor",FLOOR,VEIN,VAR_4},
{"vein floor 1",FLOOR,VEIN,VAR_1},
{"vein floor 2",FLOOR,VEIN,VAR_2},
{"vein floor 3",FLOOR,VEIN,VAR_3},
{"vein floor 4",FLOOR,VEIN,VAR_4},
{"vein boulder",BOULDER,VEIN,VAR_1},
{"vein pebbles",PEBBLES,VEIN,VAR_1},
{"vein pebbles",PEBBLES,VEIN,VAR_2},
{"vein pebbles",PEBBLES,VEIN,VAR_3},
{"vein pebbles",PEBBLES,VEIN,VAR_4},
{"vein pebbles 1",PEBBLES,VEIN,VAR_1},
{"vein pebbles 2",PEBBLES,VEIN,VAR_2},
// 450
// 0x1C0
{"vein pebbles 3",PEBBLES,VEIN,VAR_3},
{"vein pebbles 4",PEBBLES,VEIN,VAR_4},
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--SS--E-"},
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--S---EE" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-----EE" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "NN----E-"},
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N---WW--" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "NN--W---" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--S-WW--" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--SSW---" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-S-W-E-"},
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-S---E-" },
// 460
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--S-W-E-" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N---W-E-" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-S-W---"},
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--S---E-"},
// 0x1D0
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-----E-" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N---W---" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "--S-W---" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "N-S-----" },
{"smooth ice wall",WALL,ICE,VAR_1 , TILE_SMOOTH , "----W-E-"},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 470
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -606,7 +599,7 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 480
// 0x1E0
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
@ -615,36 +608,36 @@ namespace DFHack
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
// 490
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1},
{"constructed floor",FLOOR,CONSTRUCTED, VAR_1},
{"constructed fortification",FORTIFICATION,CONSTRUCTED, VAR_1},
{"constructed pillar",PILLAR,CONSTRUCTED, VAR_1},
// 0x1F0
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--SS--E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--S---EE" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-----EE" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "NN----E-" },
// 500
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N---WW--" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "NN--W---" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--S-WW--" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--SSW---" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-S-W-E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-S---E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--S-W-E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N---W-E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-S-W---" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--S---E-" },
// 510
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-----E-" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N---W---" },
// 0x200
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "--S-W---" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "N-S-----" },
{"constructed wall",WALL,CONSTRUCTED, VAR_1 ,TILE_NORMAL, "----W-E-" },
@ -652,7 +645,9 @@ namespace DFHack
{"constructed stair down",STAIR_DOWN,CONSTRUCTED, VAR_1},
{"constructed stair up",STAIR_UP,CONSTRUCTED, VAR_1},
{"constructed ramp",RAMP,CONSTRUCTED, VAR_1},
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1} // end
// end
{0 ,tileshape_invalid, tilematerial_invalid, VAR_1}
};
//set tile class string lookup table (e.g. for printing to user)
@ -679,9 +674,9 @@ namespace DFHack
};
#undef X
int32_t findSimilarTileType( const int32_t sourceTileType, const TileShape tshape )
int16_t findSimilarTileType( const int16_t sourceTileType, const TileShape tshape )
{
int32_t match=0;
int16_t match=0;
int value=0, matchv=0;
const TileRow *source = &tileTypeTable[sourceTileType];
@ -716,7 +711,7 @@ namespace DFHack
}
//Run through until perfect match found or hit end.
for(int32_t tt=0;tt<TILE_TYPE_ARRAY_LENGTH && value<(8|4|1); ++tt)
for(int16_t tt=0;tt<TILE_TYPE_ARRAY_LENGTH && value<(8|4|1); ++tt)
{
if( tshape == tileTypeTable[tt].shape )
{

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -55,7 +55,6 @@ namespace DFHack
class Gui;
class World;
class Materials;
class Constructions;
class Notes;
class VersionInfo;
class VersionInfoFactory;
@ -99,8 +98,6 @@ namespace DFHack
World * getWorld();
/// get the materials module
Materials * getMaterials();
/// get the constructions module
Constructions * getConstructions();
/// get the notes module
Notes * getNotes();
/// get the graphic module
@ -152,7 +149,6 @@ namespace DFHack
Gui * pGui;
World * pWorld;
Materials * pMaterials;
Constructions * pConstructions;
Notes * pNotes;
Graphic * pGraphic;
} s_mods;

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -34,7 +34,6 @@ namespace DFHack
Module* createWorld();
Module* createMaterials();
Module* createVegetation();
Module* createConstructions();
Module* createNotes();
Module* createGraphic();
}

@ -48,7 +48,7 @@ namespace DFHack
X(RAMP_TOP, "used for pathing?" ) \
X(FLOOR, "") \
X(BROOK_TOP, "water-passable floor on top of BROOK_BED tiles") \
X(RIVER_BED, "It's a riverbed. Basically a floor.'") \
X(RIVER_BED, "It's a riverbed. Basically a floor that doesn't get muddy.") \
X(POOL, "A pool. Gathers water while it's raining.'") \
X(TREE_DEAD, "") \
X(TREE_OK, "") \
@ -77,14 +77,14 @@ namespace DFHack
X(SOIL, "ordinary soil. material depends on geology" ) \
X(STONE, "ordinary layer stone. material depends on geology" ) \
X(FEATSTONE, "map special stone. used for things like hell, the hell temple or adamantine tubes. material depends on local/global special" ) \
X(OBSIDIAN, "cast obsidian" ) \
X(OBSIDIAN, "lava stone created by mixing magma and water" ) \
X(VEIN, "vein stone. material depends on mineral veins present" ) \
X(ICE, "frozen water... not much to say. you can determine what was on the tile before it froze by looking into the 'ice vein' objects" ) \
X(GRASS, "grass (has 4 variants)" ) \
X(GRASS2, "grass (has 4 variants)" ) \
X(GRASS, "light grass (has 4 variants)" ) \
X(GRASS2, "dark grass (has 4 variants)" ) \
X(GRASS_DEAD, "dead grass (has 4 variants)" ) \
X(GRASS_DRY, "dry grass (has 4 variants)" ) \
X(DRIFTWOOD, "non-specified wood - normally on top of the local layer stone/soil." ) \
X(DRIFTWOOD, "driftwood. normally shows up on beaches" ) \
X(HFS, "the stuff demon pits are made of - this makes them different from ordinary pits." ) \
X(MAGMA, "material for semi-molten rock and 'magma flow' tiles" ) \
X(CAMPFIRE, "human armies make them when they siege. The original tile may be lost?" ) \
@ -111,11 +111,11 @@ namespace DFHack
// When the TileType class gets created, everything should be re-thought.
#define TILESPECIAL_MACRO \
X(NORMAL, "Default for all type, nothing present" ) \
X(RIVER_SOURCE, "Rivers Source, when it exists on a map" ) \
X(WATERFALL, "Special case for Waterfall Landing. How's this used?" ) \
X(CRACKED, "Walls being dug" ) \
X(DAMAGED, "Walls being dug" ) \
X(WORN, "Walls being dug ??" ) \
X(RIVER_SOURCE, "River Source, when it exists on a map" ) \
X(WATERFALL, "Waterfall from Nowhere, used by cave rivers back in 40d" ) \
X(CRACKED, "Partially (75%) mined walls" ) \
X(DAMAGED, "Partially (50%) mined walls" ) \
X(WORN, "Partially (25%) mined walls" ) \
X(SMOOTH, "Walls and floors." )
//end TILESPECIAL_MACRO
@ -255,7 +255,7 @@ namespace DFHack
// tile is missing a floor
inline
bool LowPassable(uint16_t tiletype)
bool LowPassable(int16_t tiletype)
{
switch(DFHack::tileTypeTable[tiletype].shape)
{
@ -271,7 +271,7 @@ namespace DFHack
// tile is missing a roof
inline
bool HighPassable(uint16_t tiletype)
bool HighPassable(int16_t tiletype)
{
switch(DFHack::tileTypeTable[tiletype].shape)
{
@ -299,81 +299,81 @@ namespace DFHack
};
inline
bool FlowPassable(uint16_t tiletype)
bool FlowPassable(int16_t tiletype)
{
TileShape tc = tileTypeTable[tiletype].shape;
return tc != WALL && tc != PILLAR && tc != TREE_DEAD && tc != TREE_OK;
};
inline
bool isWallTerrain(int tiletype)
bool isWallTerrain(int16_t tiletype)
{
return tileTypeTable[tiletype].shape >= WALL && tileTypeTable[tiletype].shape <= FORTIFICATION ;
}
inline
bool isFloorTerrain(int tiletype)
bool isFloorTerrain(int16_t tiletype)
{
return tileTypeTable[tiletype].shape >= FLOOR && tileTypeTable[tiletype].shape <= PEBBLES;
}
inline
bool isRampTerrain(int tiletype)
bool isRampTerrain(int16_t tiletype)
{
return tileTypeTable[tiletype].shape == RAMP;
}
inline
bool isStairTerrain(int tiletype)
bool isStairTerrain(int16_t tiletype)
{
return tileTypeTable[tiletype].shape >= STAIR_UP && tileTypeTable[tiletype].shape <= STAIR_UPDOWN;
}
inline
bool isOpenTerrain(int tiletype)
bool isOpenTerrain(int16_t tiletype)
{
return tileTypeTable[tiletype].shape == EMPTY;
}
inline
const char * tileName(int tiletype)
const char * tileName(int16_t tiletype)
{
return tileTypeTable[tiletype].name;
}
inline
TileShape tileShape(int tiletype)
TileShape tileShape(int16_t tiletype)
{
return tileTypeTable[tiletype].shape;
}
inline
TileSpecial tileSpecial(int tiletype)
TileSpecial tileSpecial(int16_t tiletype)
{
return tileTypeTable[tiletype].special;
}
inline
TileVariant tileVariant(int tiletype)
TileVariant tileVariant(int16_t tiletype)
{
return tileTypeTable[tiletype].variant;
}
inline
TileMaterial tileMaterial(int tiletype)
TileMaterial tileMaterial(int16_t tiletype)
{
return tileTypeTable[tiletype].material;
}
inline
TileDirection tileDirection(int tiletype)
TileDirection tileDirection(int16_t tiletype)
{
return tileTypeTable[tiletype].direction;
}
/// Safely access the tile type array.
inline const
TileRow * getTileRow(int tiletype)
TileRow * getTileRow(int16_t tiletype)
{
if( tiletype<0 || tiletype>=TILE_TYPE_ARRAY_LENGTH ) return 0;
return ( const TileRow * ) &tileTypeTable[tiletype];
@ -387,9 +387,9 @@ namespace DFHack
* @return matching index in tileTypeTable, or -1 if none found.
*/
inline
int32_t findTileType( const TileShape tshape, const TileMaterial tmat, const TileVariant tvar, const TileSpecial tspecial, const TileDirection tdir )
int16_t findTileType( const TileShape tshape, const TileMaterial tmat, const TileVariant tvar, const TileSpecial tspecial, const TileDirection tdir )
{
int32_t tt;
int16_t tt;
for(tt=0;tt<TILE_TYPE_ARRAY_LENGTH; ++tt)
{
if( tshape>-1 && tshape != tileTypeTable[tt].shape ) continue;
@ -410,7 +410,7 @@ namespace DFHack
*
* @todo Definitely needs improvement for wall directions, etc.
*/
DFHACK_EXPORT int32_t findSimilarTileType( const int32_t sourceTileType, const TileShape tshape );
DFHACK_EXPORT int16_t findSimilarTileType( const int16_t sourceTileType, const TileShape tshape );
}

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -29,7 +29,8 @@ distribution.
* DF constructions
*/
#include "Export.h"
#include "Module.h"
#include "DataDefs.h"
#include "df/construction.h"
/**
* \defgroup grp_constructions Construction module parts
@ -37,64 +38,28 @@ distribution.
*/
namespace DFHack
{
/**
* type of item the construction is made of
* \ingroup grp_constructions
*/
enum e_construction_base
namespace Simple
{
constr_bar = 0, /*!< Bars */
constr_block = 2, /*!< Blocks */
constr_boulder = 4, /*!< Rough stones or boulders */
constr_logs = 5 /*!< Wooden logs */
};
#pragma pack(push, 1)
/**
* structure for holding a DF construction
* \ingroup grp_constructions
*/
struct t_construction
namespace Constructions
{
//0
uint16_t x; /*!< X coordinate */
uint16_t y; /*!< Y coordinate */
// 4
uint16_t z; /*!< Z coordinate */
uint16_t form; /*!< type of item the construction is made of */
// 8
uint16_t unk_8; // = -1 in many cases
uint16_t mat_type;
// C
uint32_t mat_idx;
uint16_t unk3;
// 10
uint16_t unk4;
uint16_t unk5;
// 14
uint32_t unk6;
/// Address of the read object in DF memory. Added by DFHack.
t_construction * origin;
// "Simplified" copy of construction
struct t_construction {
df::coord pos;
df::item_type item_type;
int16_t unk;
int16_t mat_type;
int32_t mat_index;
df::construction_flags flags;
int16_t original_tile;
// Pointer to original object, in case you want to modify it
df::construction *origin;
};
#pragma pack (pop)
class DFContextShared;
/**
* The Constructions module - allows reading constructed tiles (walls, floors, stairs, etc.)
* \ingroup grp_modules
* \ingroup grp_constructions
*/
class DFHACK_EXPORT Constructions : public Module
{
public:
Constructions();
~Constructions();
bool Start(uint32_t & numConstructions);
bool Read (const uint32_t index, t_construction & constr);
bool Finish();
private:
struct Private;
Private *d;
};
DFHACK_EXPORT bool isValid();
DFHACK_EXPORT uint32_t getCount();
DFHACK_EXPORT bool copyConstruction (const int32_t index, t_construction &out);
DFHACK_EXPORT df::construction * getConstruction (const int32_t index);
}
}
}
#endif

@ -41,8 +41,24 @@ namespace Simple
{
namespace Engravings
{
// "Simplified" copy of engraving
struct t_engraving {
int32_t artist;
int32_t masterpiece_event;
int32_t skill_rating;
df::coord pos;
df::engraving_flags flags;
int8_t tile;
int32_t type;
int16_t subtype;
df::item_quality quality;
// Pointer to original object, in case you want to modify it
df::engraving *origin;
};
DFHACK_EXPORT bool isValid();
DFHACK_EXPORT uint32_t getCount();
DFHACK_EXPORT bool copyEngraving (const int32_t index, t_engraving &out);
DFHACK_EXPORT df::engraving * getEngraving (const int32_t index);
}
}

@ -32,6 +32,10 @@ distribution.
#include "BitArray.h"
#include <string>
#include "DataDefs.h"
#include "df/init.h"
#include "df/ui.h"
namespace df {
struct viewscreen;
struct job;
@ -86,88 +90,6 @@ namespace DFHack
DFHACK_EXPORT void showPopupAnnouncement(std::string message, int color = 7, bool bright = true);
class DFContextShared;
/**
* A GUI screen
* \ingroup grp_gui
*/
struct t_viewscreen : public t_virtual
{
t_viewscreen * child;
t_viewscreen * parent;
char unk1; // varies
char unk2; // state?
};
/**
* Interface - wrapper for the GUI
* \ingroup grp_gui
*/
struct t_interface
{
int fps;
t_viewscreen view;
unsigned int flags; // ?
// more crud this way ...
};
enum graphics_flag
{
GRAPHICS_ENABLED = 0,
GRAPHICS_BLACKSPACE = 1,
GRAPHICS_PARTIAL_PRINT = 2,
GRAPHICS_TEXT = 11,
GRAPHICS_FIXED_SIZE = 13
};
enum media_flag
{
MEDIA_NO_SOUND,
MEDIA_NO_INTRO,
MEDIA_COMPRESS_WORLDS,
};
/**
* The init structure - basically DF settings
* \ingroup grp_gui
*/
struct t_init
{
struct
{
BitArray <graphics_flag> flags;
enum
{
WINDOWED_YES,
WINDOWED_NO,
WINDOWED_PROMPT
} windowed;
// screen size in tiles
int grid_x;
int grid_y;
// in pixels ?
int fullscreen_x;
int fullscreen_y;
int window_x;
int window_y;
char partial_print;
} graphics;
struct
{
BitArray <media_flag> flags;
int32_t volume;
} media;
// much more stuff follows
};
#define NUM_HOTKEYS 16
/**
* The hotkey structure
* \ingroup grp_gui
*/
struct t_hotkey
{
std::string name;
int16_t mode;
int32_t x;
int32_t y;
int32_t z;
};
typedef t_hotkey hotkey_array[NUM_HOTKEYS];
/**
* One tile of the screen. Possibly outdated.
@ -212,23 +134,11 @@ namespace DFHack
/*
* Gui screens
*/
/// handle to the interface object
t_interface * df_interface;
/// Get the current top-level view-screen
t_viewscreen * GetCurrentScreen();
df::viewscreen * GetCurrentScreen();
/// The DF menu state (designation menu ect)
uint32_t * df_menu_state;
/*
* Hotkeys (DF's zoom locations)
*/
hotkey_array * hotkeys;
/*
* Game settings
*/
t_init * init;
/*
* Window size in tiles
*/

@ -145,11 +145,13 @@ typedef int16_t t_blockmaterials [16][16];
* \ingroup grp_maps
*/
typedef df::tile_designation designations40d [16][16];
typedef df::tile_designation t_designation;
/**
* 16x16 array of occupancy flags
* \ingroup grp_maps
*/
typedef df::tile_occupancy occupancies40d [16][16];
typedef df::tile_occupancy t_occupancy;
/**
* array of 16 biome indexes valid for the block
* \ingroup grp_maps

@ -169,6 +169,7 @@ DFHACK_EXPORT bool isValid();
/* Read Functions */
// Read creatures in a box, starting with index. Returns -1 if no more creatures
// found. Call repeatedly do get all creatures in a specified box (uses tile coords)
DFHACK_EXPORT int32_t getNumCreatures();
DFHACK_EXPORT int32_t GetCreatureInBox(const int32_t index, df::unit ** furball,
const uint16_t x1, const uint16_t y1,const uint16_t z1,
const uint16_t x2, const uint16_t y2,const uint16_t z2);

@ -42,9 +42,31 @@ namespace Vegetation
{
const uint32_t sapling_to_tree_threshold = 120 * 28 * 12 * 3; // 3 years
// "Simplified" copy of plant
struct t_plant {
df::language_name name;
df::plant_flags flags;
int16_t material;
df::coord pos;
int32_t grow_counter;
uint16_t temperature_1;
uint16_t temperature_2;
int32_t is_burning;
int32_t hitpoints;
int16_t update_order;
//std::vector<void *> unk1;
//int32_t unk2;
//uint16_t temperature_3;
//uint16_t temperature_4;
//uint16_t temperature_5;
// Pointer to original object, in case you want to modify it
df::plant *origin;
};
DFHACK_EXPORT bool isValid();
DFHACK_EXPORT uint32_t getCount();
DFHACK_EXPORT df::plant * getPlant(const int32_t index);
DFHACK_EXPORT bool copyPlant (const int32_t index, t_plant &out);
}
}
}

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -34,64 +34,43 @@ using namespace std;
#include "VersionInfo.h"
#include "MemAccess.h"
#include "Types.h"
#include "modules/Constructions.h"
#include "ModuleFactory.h"
#include "Core.h"
#include "modules/Constructions.h"
#include "df/world.h"
using namespace DFHack;
using namespace DFHack::Simple;
using df::global::world;
struct Constructions::Private
{
vector <t_construction *> * p_cons;
Process * owner;
bool Inited;
bool Started;
};
Module* DFHack::createConstructions()
{
return new Constructions();
}
Constructions::Constructions()
bool Constructions::isValid()
{
Core & c = Core::getInstance();
d = new Private;
d->owner = c.p;
d->Inited = d->Started = false;
VersionInfo * mem = c.vinfo;
d->p_cons = (decltype(d->p_cons)) mem->getGroup("Constructions")->getAddress ("vector");
d->Inited = true;
return (world != NULL);
}
Constructions::~Constructions()
uint32_t Constructions::getCount()
{
if(d->Started)
Finish();
delete d;
return world->constructions.size();
}
bool Constructions::Start(uint32_t & numconstructions)
df::construction * Constructions::getConstruction(const int32_t index)
{
numconstructions = d->p_cons->size();
d->Started = true;
return true;
}
bool Constructions::Read (const uint32_t index, t_construction & construction)
{
if(!d->Started) return false;
t_construction * orig = d->p_cons->at(index);
construction = *orig;
construction.origin = orig;
return true;
if (index < 0 || index >= getCount())
return NULL;
return world->constructions[index];
}
bool Constructions::Finish()
bool Constructions::copyConstruction(const int32_t index, t_construction &out)
{
d->Started = false;
if (index < 0 || index >= getCount())
return false;
out.origin = world->constructions[index];
out.pos = out.origin->pos;
out.item_type = out.origin->item_type;
out.unk = out.origin->anon_1;
out.mat_type = out.origin->mat_type;
out.mat_index = out.origin->mat_index;
out.flags = out.origin->flags;
out.original_tile = out.origin->original_tile;
return true;
}

@ -44,7 +44,7 @@ using df::global::world;
bool Engravings::isValid()
{
return (world->engravings.size() > 0);
return (world != NULL);
}
uint32_t Engravings::getCount()
@ -52,9 +52,28 @@ uint32_t Engravings::getCount()
return world->engravings.size();
}
df::engraving *Engravings::getEngraving(const int32_t index)
df::engraving * Engravings::getEngraving(int index)
{
if (index < 0 || index >= getCount())
return NULL;
return world->engravings[index];
}
bool Engravings::copyEngraving(const int32_t index, t_engraving &out)
{
if (index < 0 || index >= getCount())
return false;
out.origin = world->engravings[index];
out.artist = out.origin->artist;
out.masterpiece_event = out.origin->masterpiece_event;
out.skill_rating = out.origin->skill_rating;
out.pos = out.origin->pos;
out.flags = out.origin->flags;
out.tile = out.origin->tile;
out.type = out.origin->type;
out.subtype = out.origin->subtype;
out.quality = out.origin->quality;
return true;
}

@ -47,7 +47,6 @@ using namespace DFHack;
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_unitjobsst.h"
#include "df/viewscreen_itemst.h"
#include "df/ui.h"
#include "df/ui_unit_view_mode.h"
#include "df/ui_sidebar_menus.h"
#include "df/ui_look_list.h"
@ -59,8 +58,14 @@ using namespace DFHack;
#include "df/unit_inventory_item.h"
#include "df/report.h"
#include "df/popup_message.h"
#include "df/interface.h"
#include "df/graphic.h"
#include "df/selection_rect.h"
using namespace df::enums;
using df::global::gview;
using df::global::init;
using df::global::gps;
// Predefined common guard functions
@ -457,25 +462,12 @@ struct Gui::Private
{
Started = false;
StartedScreen = false;
mouse_xy_offset = 0;
designation_xyz_offset = 0;
}
bool Started;
int32_t * window_x_offset;
int32_t * window_y_offset;
int32_t * window_z_offset;
struct xyz
{
int32_t x;
int32_t y;
int32_t z;
} * cursor_xyz_offset, * designation_xyz_offset;
struct xy
{
int32_t x;
int32_t y;
} * mouse_xy_offset, * window_dims_offset;
bool StartedScreen;
void * screen_tiles_ptr_offset;
@ -491,26 +483,6 @@ Gui::Gui()
VersionInfo * mem = c.vinfo;
OffsetGroup * OG_Gui = mem->getGroup("GUI");
// Setting up hotkeys
try
{
hotkeys = (hotkey_array *) OG_Gui->getAddress("hotkeys");
}
catch(Error::All &)
{
hotkeys = 0;
};
// Setting up init
try
{
init = (t_init *) OG_Gui->getAddress("init");
}
catch(Error::All &)
{
init = 0;
};
// Setting up menu state
try
{
@ -521,16 +493,6 @@ Gui::Gui()
df_menu_state = 0;
};
// Setting up the view screen stuff
try
{
df_interface = (t_interface *) OG_Gui->getAddress ("interface");
}
catch(exception &)
{
df_interface = 0;
};
OffsetGroup * OG_Position;
try
{
@ -538,28 +500,10 @@ Gui::Gui()
d->window_x_offset = (int32_t *) OG_Position->getAddress ("window_x");
d->window_y_offset = (int32_t *) OG_Position->getAddress ("window_y");
d->window_z_offset = (int32_t *) OG_Position->getAddress ("window_z");
d->cursor_xyz_offset = (Private::xyz *) OG_Position->getAddress ("cursor_xyz");
d->window_dims_offset = (Private::xy *) OG_Position->getAddress ("window_dims");
d->Started = true;
}
catch(Error::All &){};
try
{
d->mouse_xy_offset = (Private::xy *) OG_Position->getAddress ("mouse_xy");
}
catch(Error::All &)
{
d->mouse_xy_offset = 0;
};
try
{
d->designation_xyz_offset = (Private::xyz *) OG_Position->getAddress ("designation_xyz");
}
catch(Error::All &)
{
d->designation_xyz_offset = 0;
};
try
{
d->screen_tiles_ptr_offset = (void *) OG_Position->getAddress ("screen_tiles_pointer");
d->StartedScreen = true;
@ -582,11 +526,9 @@ bool Gui::Finish()
return true;
}
t_viewscreen * Gui::GetCurrentScreen()
df::viewscreen * Gui::GetCurrentScreen()
{
if(!df_interface)
return 0;
t_viewscreen * ws = &df_interface->view;
df::viewscreen * ws = &gview->view;
while(ws)
{
if(ws->child)
@ -625,12 +567,9 @@ bool Gui::setViewCoords (const int32_t x, const int32_t y, const int32_t z)
bool Gui::getCursorCoords (int32_t &x, int32_t &y, int32_t &z)
{
if(!d->Started) return false;
int32_t coords[3];
d->owner->read (d->cursor_xyz_offset, 3*sizeof (int32_t), (uint8_t *) coords);
x = coords[0];
y = coords[1];
z = coords[2];
x = df::global::cursor->x;
y = df::global::cursor->y;
z = df::global::cursor->z;
if (x == -30000) return false;
return true;
}
@ -638,55 +577,44 @@ bool Gui::getCursorCoords (int32_t &x, int32_t &y, int32_t &z)
//FIXME: confine writing of coords to map bounds?
bool Gui::setCursorCoords (const int32_t x, const int32_t y, const int32_t z)
{
if (!d->Started) return false;
int32_t coords[3] = {x, y, z};
d->owner->write (d->cursor_xyz_offset, 3*sizeof (int32_t), (uint8_t *) coords);
df::global::cursor->x = x;
df::global::cursor->y = y;
df::global::cursor->z = z;
return true;
}
bool Gui::getDesignationCoords (int32_t &x, int32_t &y, int32_t &z)
{
if(!d->designation_xyz_offset) return false;
int32_t coords[3];
d->owner->read (d->designation_xyz_offset, 3*sizeof (int32_t), (uint8_t *) coords);
x = coords[0];
y = coords[1];
z = coords[2];
x = df::global::selection_rect->start_x;
y = df::global::selection_rect->start_y;
z = df::global::selection_rect->start_z;
if (x == -30000) return false;
return true;
}
bool Gui::setDesignationCoords (const int32_t x, const int32_t y, const int32_t z)
{
if(!d->designation_xyz_offset) return false;
int32_t coords[3] = {x, y, z};
d->owner->write (d->designation_xyz_offset, 3*sizeof (int32_t), (uint8_t *) coords);
df::global::selection_rect->start_x = x;
df::global::selection_rect->start_y = y;
df::global::selection_rect->start_z = z;
return true;
}
bool Gui::getMousePos (int32_t & x, int32_t & y)
{
if(!d->mouse_xy_offset) return false;
int32_t coords[2];
d->owner->read (d->mouse_xy_offset, 2*sizeof (int32_t), (uint8_t *) coords);
x = coords[0];
y = coords[1];
x = gps->mouse_x;
y = gps->mouse_y;
if(x == -1) return false;
return true;
}
bool Gui::getWindowSize (int32_t &width, int32_t &height)
{
if(!d->Started) return false;
int32_t coords[2];
d->owner->read (d->window_dims_offset, 2*sizeof (int32_t), (uint8_t *) coords);
width = coords[0];
height = coords[1];
width = gps->dimx;
height = gps->dimy;
return true;
}
bool Gui::getScreenTiles (int32_t width, int32_t height, t_screen screen[])
{
if(!d->StartedScreen) return false;

@ -143,7 +143,7 @@ bool Maps::ReadBlock40d(uint32_t x, uint32_t y, uint32_t z, mapblock40d * buffer
buffer->global_feature = block->global_feature;
buffer->local_feature = block->local_feature;
buffer->mystery = block->unk2;
buffer->origin = &block;
buffer->origin = block;
buffer->blockflags.whole = block->flags;
return true;
}

@ -62,6 +62,7 @@ using namespace std;
#include "df/physical_attribute_type.h"
#include "df/mental_attribute_type.h"
#include <df/color_modifier_raw.h>
using namespace DFHack;
using namespace df::enums;
@ -746,32 +747,32 @@ bool Materials::ReadCreatureTypesEx (void)
caste.singular = ca->caste_name[0];
caste.plural = ca->caste_name[1];
caste.adjective = ca->caste_name[2];
/*
// color mod reading
// Caste + offset > color mod vector
vector <char *> & p_colormod = *(vector<char*> *) (world->raws.creatures.all[i]->caste + caste_colormod_offset);
uint32_t sizecolormod = p_colormod.size();
auto & colorings = ca->color_modifiers;
uint32_t sizecolormod = colorings.size();
caste.ColorModifier.resize(sizecolormod);
for(uint32_t k = 0; k < sizecolormod;k++)
{
// color mod [0] -> color list
vector <uint32_t> & p_colorlist = *(vector<uint32_t> *) (p_colormod[k]);
uint32_t sizecolorlist = p_colorlist.size();
auto & indexes = colorings[k]->color_indexes;
uint32_t sizecolorlist = indexes.size();
caste.ColorModifier[k].colorlist.resize(sizecolorlist);
for(uint32_t l = 0; l < sizecolorlist; l++)
caste.ColorModifier[k].colorlist[l] = p_colorlist[l];
caste.ColorModifier[k].colorlist[l] = indexes[l];
// color mod [color_modifier_part_offset] = string part
caste.ColorModifier[k].part = p->readSTLString( p_colormod[k] + color_modifier_part_offset);
caste.ColorModifier[k].startdate = p->readDWord( p_colormod[k] + color_modifier_startdate_offset );
caste.ColorModifier[k].enddate = p->readDWord( p_colormod[k] + color_modifier_enddate_offset );
caste.ColorModifier[k].part = colorings[k]->part;
caste.ColorModifier[k].startdate = colorings[k]->start_date;
caste.ColorModifier[k].enddate = colorings[k]->end_date;
}
*/
// body parts
caste.bodypart.empty();
uint32_t sizebp = ca->body_parts.size();
uint32_t sizebp = ca->unknown1.body_parts.size();
for (uint32_t k = 0; k < sizebp; k++)
{
df::body_part_raw *bp = ca->body_parts[k];
df::body_part_raw *bp = ca->unknown1.body_parts[k];
t_bodypart part;
part.id = bp->part_code;
part.category = bp->part_name;

@ -59,6 +59,11 @@ bool Units::isValid()
return (world->units.all.size() > 0);
}
int32_t Units::getNumCreatures()
{
return world->units.all.size();
}
df::unit * Units::GetCreature (const int32_t index)
{
if (!isValid()) return NULL;

@ -45,7 +45,7 @@ using df::global::world;
bool Vegetation::isValid()
{
return (world->plants.all.size() > 0);
return (world != NULL);
}
uint32_t Vegetation::getCount()
@ -59,3 +59,28 @@ df::plant *Vegetation::getPlant(const int32_t index)
return NULL;
return world->plants.all[index];
}
bool Vegetation::copyPlant(const int32_t index, t_plant &out)
{
if (index < 0 || index >= getCount())
return false;
out.origin = world->plants.all[index];
out.name = out.origin->name;
out.flags = out.origin->flags;
out.material = out.origin->material;
out.pos = out.origin->pos;
out.grow_counter = out.origin->grow_counter;
out.temperature_1 = out.origin->temperature_1;
out.temperature_2 = out.origin->temperature_2;
out.is_burning = out.origin->is_burning;
out.hitpoints = out.origin->hitpoints;
out.update_order = out.origin->update_order;
//out.unk1 = out.origin->anon_1;
//out.unk2 = out.origin->anon_2;
//out.temperature_3 = out.origin->temperature_3;
//out.temperature_4 = out.origin->temperature_4;
//out.temperature_5 = out.origin->temperature_5;
return true;
}

@ -46,6 +46,8 @@ using namespace std;
using namespace DFHack;
using df::global::world;
Module* DFHack::createWorld()
{
return new World();
@ -55,17 +57,13 @@ struct World::Private
{
Private()
{
Inited = StartedTime = StartedWeather = StartedMode = PauseInited = false;
Inited = PauseInited = StartedWeather = StartedMode = false;
}
bool Inited;
bool PauseInited;
void * pause_state_offset;
bool StartedTime;
void * year_offset;
void * tick_offset;
bool StartedWeather;
char * weather_offset;
@ -74,9 +72,6 @@ struct World::Private
void * controlmode_offset;
void * controlmodecopy_offset;
bool StartedFolder;
void * folder_name_offset;
Process * owner;
};
@ -87,14 +82,6 @@ World::World()
d->owner = c.p;
wmap = 0;
OffsetGroup * OG_World = c.vinfo->getGroup("World");
try
{
d->year_offset = OG_World->getAddress( "current_year" );
d->tick_offset = OG_World->getAddress( "current_tick" );
d->StartedTime = true;
}
catch(Error::All &){};
OffsetGroup * OG_Gui = c.vinfo->getGroup("GUI");
try
{
@ -102,6 +89,8 @@ World::World()
d->PauseInited = true;
}
catch(exception &){};
OffsetGroup * OG_World = c.vinfo->getGroup("World");
try
{
d->weather_offset = OG_World->getAddress( "current_weather" );
@ -116,13 +105,6 @@ World::World()
d->StartedMode = true;
}
catch(Error::All &){};
try
{
d->folder_name_offset = OG_World->getAddress( "save_folder" );
d->StartedFolder = true;
}
catch(Error::All &){};
d->Inited = true;
}
@ -145,28 +127,24 @@ bool World::Finish()
bool World::ReadPauseState()
{
if(!d->PauseInited) return false;
uint32_t pauseState = d->owner->readDWord (d->pause_state_offset);
uint8_t pauseState = d->owner->readByte (d->pause_state_offset);
return pauseState & 1;
}
void World::SetPauseState(bool paused)
{
if(!d->PauseInited) return;
d->owner->writeDWord (d->pause_state_offset, paused);
d->owner->writeByte (d->pause_state_offset, paused);
}
uint32_t World::ReadCurrentYear()
{
if(d->Inited && d->StartedTime)
return(d->owner->readDWord(d->year_offset));
return 0;
return *df::global::cur_year;
}
uint32_t World::ReadCurrentTick()
{
if(d->Inited && d->StartedTime)
return(d->owner->readDWord(d->tick_offset));
return 0;
return *df::global::cur_year_tick;
}
bool World::ReadGameMode(t_gamemodes& rd)
@ -241,11 +219,7 @@ void World::SetCurrentWeather(uint8_t weather)
string World::ReadWorldFolder()
{
if (d->Inited && d->StartedFolder)
{
return string( * ( (string*) d->folder_name_offset ) );
}
return string("");
return world->unk_192bd8.save_dir;
}
static PersistentDataItem dataFromHFig(df::historical_figure *hfig)

@ -1 +1 @@
Subproject commit 3da91078d44282fa096f71f3f1e44809f9699e3d
Subproject commit 867e7de022af7a5cc623b360ae2b864df395316f

@ -70,6 +70,7 @@ DFHACK_PLUGIN(jobutils jobutils.cpp)
DFHACK_PLUGIN(regrass regrass.cpp)
DFHACK_PLUGIN(workflow workflow.cpp)
DFHACK_PLUGIN(showmood showmood.cpp)
DFHACK_PLUGIN(fixveins fixveins.cpp)
#DFHACK_PLUGIN(versionosd versionosd.cpp)
# this is the skeleton plugin. If you want to make your own, make a copy and then change it

@ -98,7 +98,6 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete
DFHack::Materials *Materials = c->getMaterials();
uint32_t num_creatures;
bool ok = Materials->ReadAllMaterials();
c->con.print("Found total %d items.\n", world->items.all.size());

@ -43,10 +43,9 @@ DFhackCExport DFHack::command_result readFlag (Core * c, vector <string> & param
{
c->Suspend();
DFHack::Maps * Maps = c->getMaps();
DFHack::Gui * Gui = c->getGui();
// init the map
if(!Maps->Start())
if(!Maps::IsValid())
{
c->con.printerr("Can't init map. Make sure you have a map loaded in DF.\n");
c->Resume();
@ -64,7 +63,7 @@ DFhackCExport DFHack::command_result readFlag (Core * c, vector <string> & param
DFHack::DFCoord cursor = DFHack::DFCoord(cx,cy,cz);
MapExtras::MapCache * MCache = new MapExtras::MapCache(Maps);
MapExtras::MapCache * MCache = new MapExtras::MapCache();
DFHack::t_occupancy oc = MCache->occupancyAt(cursor);
c->con.print("Current Value: %d\n", oc.bits.building);
@ -111,10 +110,9 @@ DFhackCExport DFHack::command_result writeFlag (Core * c, vector <string> & para
c->Suspend();
DFHack::Maps * Maps = c->getMaps();
DFHack::Gui * Gui = c->getGui();
// init the map
if(!Maps->Start())
if(!Maps::IsValid())
{
c->con.printerr("Can't init map. Make sure you have a map loaded in DF.\n");
c->Resume();
@ -132,7 +130,7 @@ DFhackCExport DFHack::command_result writeFlag (Core * c, vector <string> & para
DFHack::DFCoord cursor = DFHack::DFCoord(cx,cy,cz);
MapExtras::MapCache * MCache = new MapExtras::MapCache(Maps);
MapExtras::MapCache * MCache = new MapExtras::MapCache();
DFHack::t_occupancy oc = MCache->occupancyAt(cursor);
oc.bits.building = value;

@ -15,11 +15,11 @@ using namespace DFHack;
//////////////////////
// START item choosers
//////////////////////
/*
class item_chooser
{
public:
item_chooser(Core* _c, DFHack::Items* _Items) : c(_c), Items(_Items)
item_chooser(Core* _c) : c(_c)
{
}
@ -31,13 +31,12 @@ public:
protected:
Core *c;
DFHack::Items *Items;
};
class choose_all : public item_chooser
{
public:
choose_all(Core* _c, ::Items* _Items) : item_chooser(_c, _Items)
choose_all(Core* _c) : item_chooser(_c)
{
}
@ -51,7 +50,7 @@ public:
class choose_unknown : public item_chooser
{
public:
choose_unknown(Core* _c, ::Items* _Items) : item_chooser(_c, _Items)
choose_unknown(Core* _c) : item_chooser(_c)
{
}
@ -66,9 +65,8 @@ public:
t_itemflags &f = itm->origin->flags;
return (f.unk1 || f.unk2 || f.unk3 || f.unk4 || /*f.unk5 ||*/
return (f.unk1 || f.unk2 || f.unk3 || f.unk4 ||
f.unk6 || f.unk7 ||
// f.unk8 || f.unk9 || /* Too common */
f.unk10 || f.unk11);
}
@ -263,6 +261,7 @@ DFhackCExport command_result df_dumpitems (Core * c, vector <string> & parameter
}
}
*/
/*
}
c->Resume();
@ -271,3 +270,4 @@ DFhackCExport command_result df_dumpitems (Core * c, vector <string> & parameter
return CR_OK;
}
*/

@ -9,10 +9,13 @@
#include "modules/Items.h"
#include <modules/Gui.h>
#include <llimits.h>
#include <df/caste_raw.h>
#include <df/creature_raw.h>
using std::vector;
using std::string;
using namespace DFHack;
using namespace DFHack::Simple;
//FIXME: possible race conditions with calling kittens from the IO thread and shutdown from Core.
bool shutdown_flag = false;
bool final_flag = true;
@ -26,12 +29,9 @@ uint64_t timeLast = 0;
DFhackCExport command_result kittens (Core * c, vector <string> & parameters);
DFhackCExport command_result ktimer (Core * c, vector <string> & parameters);
DFhackCExport command_result bflags (Core * c, vector <string> & parameters);
DFhackCExport command_result trackmenu (Core * c, vector <string> & parameters);
DFhackCExport command_result trackpos (Core * c, vector <string> & parameters);
DFhackCExport command_result mapitems (Core * c, vector <string> & parameters);
DFhackCExport command_result test_creature_offsets (Core * c, vector <string> & parameters);
DFhackCExport command_result creat_job (Core * c, vector <string> & parameters);
DFhackCExport command_result colormods (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void )
{
@ -43,12 +43,9 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
commands.clear();
commands.push_back(PluginCommand("nyan","NYAN CAT INVASION!",kittens, true));
commands.push_back(PluginCommand("ktimer","Measure time between game updates and console lag (toggle).",ktimer));
commands.push_back(PluginCommand("blockflags","Look up block flags",bflags));
commands.push_back(PluginCommand("trackmenu","Track menu ID changes (toggle).",trackmenu));
commands.push_back(PluginCommand("trackpos","Track mouse and designation coords (toggle).",trackpos));
commands.push_back(PluginCommand("mapitems","Check item ids under cursor against item ids in map block.",mapitems));
commands.push_back(PluginCommand("test_creature_offsets","Bleh.",test_creature_offsets));
commands.push_back(PluginCommand("creat_job","Bleh.",creat_job));
commands.push_back(PluginCommand("colormods","Dump colormod vectors.",colormods));
return CR_OK;
}
@ -107,59 +104,6 @@ DFhackCExport command_result plugin_onupdate ( Core * c )
return CR_OK;
}
DFhackCExport command_result mapitems (Core * c, vector <string> & parameters)
{
c->Suspend();
vector <df_item *> vec_items;
Gui * g = c-> getGui();
Maps* m = c->getMaps();
Items* it = c->getItems();
if(!m->Start())
{
c->con.printerr("No map to probe\n");
return CR_FAILURE;
}
if(!it->Start() || !it->readItemVector(vec_items))
{
c->con.printerr("Failed to get items\n");
return CR_FAILURE;
}
int32_t cx,cy,cz;
g->getCursorCoords(cx,cy,cz);
if(cx != -30000)
{
df_block * b = m->getBlock(cx/16,cy/16,cz);
if(b)
{
c->con.print("Item IDs present in block:\n");
auto iter_b = b->items.begin();
while (iter_b != b->items.end())
{
df_item * itmz = it->findItemByID(*iter_b);
string s;
itmz->getItemDescription(&s);
c->con.print("%d = %s\n",*iter_b, s.c_str());
iter_b++;
}
c->con.print("Items under cursor:\n");
auto iter_it = vec_items.begin();
while (iter_it != vec_items.end())
{
df_item * itm = *iter_it;
if(itm->x == cx && itm->y == cy && itm->z == cz)
{
string s;
itm->getItemDescription(&s,0);
c->con.print("%d = %s\n",itm->id, s.c_str());
}
iter_it ++;
}
}
}
c->Resume();
return CR_OK;
}
DFhackCExport command_result trackmenu (Core * c, vector <string> & parameters)
{
if(trackmenu_flg)
@ -189,53 +133,19 @@ DFhackCExport command_result trackpos (Core * c, vector <string> & parameters)
trackpos_flg = !trackpos_flg;
return CR_OK;
}
DFhackCExport command_result bflags (Core * c, vector <string> & parameters)
DFhackCExport command_result colormods (Core * c, vector <string> & parameters)
{
c->Suspend();
Gui * g = c-> getGui();
Maps* m = c->getMaps();
if(!m->Start())
{
c->con.printerr("No map to probe\n");
return CR_FAILURE;
}
int32_t cx,cy,cz;
g->getCursorCoords(cx,cy,cz);
if(cx == -30000)
{
// get map size in blocks
uint32_t sx,sy,sz;
m->getSize(sx,sy,sz);
std::map <uint8_t, df_block *> counts;
// for each block
for(size_t x = 0; x < sx; x++)
for(size_t y = 0; y < sx; y++)
for(size_t z = 0; z < sx; z++)
{
df_block * b = m->getBlock(x,y,z);
if(!b) continue;
auto iter = counts.find(b->flags.size);
if(iter == counts.end())
{
counts[b->flags.bits[0]] = b;
}
}
for(auto iter = counts.begin(); iter != counts.end(); iter++)
{
c->con.print("%2x : 0x%x\n",iter->first, iter->second);
}
}
else
auto & vec = df::global::world->raws.creatures.alphabetic;
for(int i = 0; i < vec.size();i++)
{
df_block * b = m->getBlock(cx/16,cy/16,cz);
if(b)
df::creature_raw* rawlion = vec[i];
df::caste_raw * caste = rawlion->caste[0];
c->con.print("%s\nCaste addr 0x%x\n",rawlion->creature_id.c_str(), &caste->color_modifiers);
for(int j = 0; j < caste->color_modifiers.size();j++)
{
c->con << "Block flags:" << b->flags << std::endl;
}
else
{
c->con.printerr("No block here\n");
return CR_FAILURE;
c->con.print("mod %d: 0x%x\n", j, caste->color_modifiers[j]);
}
}
c->Resume();
@ -328,71 +238,3 @@ DFhackCExport command_result kittens (Core * c, vector <string> & parameters)
color = Console::COLOR_BLUE;
}
}
#include "modules/Units.h"
#include "VersionInfo.h"
#include <stddef.h>
command_result test_creature_offsets(Core* c, vector< string >& parameters)
{
uint32_t off_vinfo = c->vinfo->getGroup("Creatures")->getGroup("creature")->/*getGroup("advanced")->*/getOffset("custom_profession");
uint32_t off_struct = offsetof(df_unit,custom_profession);
c->con.print("Struct 0x%x, vinfo 0x%x\n", off_struct, off_vinfo);
return CR_OK;
};
command_result creat_job (Core * c, vector< string >& parameters)
{
c->Suspend();
Units * cr = c->getUnits();
Gui * g = c-> getGui();
uint32_t num_cr = 0;
int32_t cx,cy,cz;
g->getCursorCoords(cx,cy,cz);
if(cx == -30000)
{
c->con.printerr("No cursor.\n");
c->Resume();
return CR_FAILURE;
}
if(!cr->Start(num_cr) || num_cr == 0)
{
c->con.printerr("No creatures.\n");
c->Resume();
return CR_FAILURE;
}
auto iter = cr->creatures->begin();
while (iter != cr->creatures->end())
{
df_unit * unit = *iter;
if(cx == unit->x && cy == unit->y && cz == unit->z)
{
c->con.print("%d:%s - address 0x%x - job 0x%x\n"
"Soul: 0x%x, likes: 0x%x\n",
unit->id,
unit->name.first_name.c_str(),
unit,
uint32_t(unit) + offsetof(df_unit,current_job),
uint32_t(unit) + offsetof(df_unit,current_soul),
uint32_t(unit->current_soul) + offsetof(df_soul,likes)
);
df_soul * s = unit->current_soul;
if(s)
{
c->con.print("LIKES:\n");
int idx = 1;
auto iter = s->likes.begin();
while(iter != s->likes.end())
{
df_like * l = *iter;
c->con.print("%3d: %f\n", idx, float(l->mystery));
iter++;
idx++;
}
}
}
iter++;
}
c->Resume();
return CR_OK;
};

@ -6,7 +6,7 @@
#include <string>
#include <modules/Materials.h>
#include <stdlib.h>
/*
using std::vector;
using std::string;
using namespace DFHack;
@ -136,4 +136,4 @@ DFhackCExport command_result rawdump_p (Core * c, vector <string> & parameters)
c->Resume();
return CR_OK;
}
*/

@ -0,0 +1,107 @@
// Building and removing construction on a mineral floor will destroy the mineral, changing it to the layer stone
// Farm plots or paved roads do the same thing periodically (once every 500 ticks or so)
// This tool changes said tiles back into the mineral type they originally had
// It also fixes tiles marked as "mineral inclusion" where no inclusion is present,
// which generally happen as a result of improper use of the tiletypes plugin
#include "Core.h"
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "DataDefs.h"
#include "modules/Maps.h"
#include "TileTypes.h"
using std::vector;
using std::string;
using namespace DFHack;
using namespace DFHack::Simple;
using namespace df::enums;
using df::global::world;
DFhackCExport command_result df_fixveins (Core * c, vector <string> & parameters)
{
if (parameters.size())
return CR_WRONG_USAGE;
CoreSuspender suspend(c);
if (!Maps::IsValid())
{
c->con.printerr("Map is not available!\n");
return CR_FAILURE;
}
int removed = 0;
int added = 0;
int num_blocks = 0, blocks_total = world->map.map_blocks.size();
for (int i = 0; i < blocks_total; i++)
{
df::map_block *block = world->map.map_blocks[i];
uint16_t has_mineral[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for (int j = 0; j < block->block_events.size(); j++)
{
df::block_square_event *evt = block->block_events[j];
if (evt->getType() != block_square_event_type::mineral)
continue;
df::block_square_event_mineralst *mineral = (df::block_square_event_mineralst *)evt;
for (int k = 0; k < 16; k++)
has_mineral[k] |= mineral->tile_bitmask[k];
}
for (int x = 0; x < 16; x++)
{
for (int y = 0; y < 16; y++)
{
int16_t oldT = block->tiletype[x][y];
int16_t newT = oldT;
TileMaterial mat = tileMaterial(oldT);
if ((mat == VEIN) && !(has_mineral[y] & (1 << x)))
{
newT = findTileType(tileShape(oldT), STONE, tileVariant(oldT), tileSpecial(oldT), tileDirection(oldT));
if ((newT != -1) && (newT != oldT))
{
block->tiletype[x][y] = newT;
removed++;
}
}
if ((mat == STONE) && (has_mineral[y] & (1 << x)))
{
newT = findTileType(tileShape(oldT), VEIN, tileVariant(oldT), tileSpecial(oldT), tileDirection(oldT));
if ((newT != -1) && (newT != oldT))
{
block->tiletype[x][y] = newT;
added++;
}
}
}
}
}
if (removed)
c->con.print("Removed %i invalid references to mineral inclusions.\n", removed);
if (added)
c->con.print("Restored %i missing references to mineral inclusions.\n", added);
return CR_OK;
}
DFhackCExport const char * plugin_name ( void )
{
return "fixveins";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{
commands.clear();
commands.push_back(PluginCommand("fixveins",
"Remove invalid references to mineral inclusions and restore missing ones.",
df_fixveins));
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}

@ -39,7 +39,7 @@ LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
#Generate sources from our proto files and store them in the source tree
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto ${PROJECT_PROTOS}
COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/ --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/ ${PROJECT_PROTOS}
DEPENDS protoc-bin ${PROJECT_PROTOS}
)

@ -15,6 +15,8 @@ using namespace google::protobuf::io;
#include "proto/Map.pb.h"
using namespace DFHack::Simple;
DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & parameters);
DFhackCExport const char * plugin_name ( void )