diff --git a/dfhack/include/DFTypes.h b/dfhack/include/DFTypes.h index 40b5c57cc..92661aedd 100644 --- a/dfhack/include/DFTypes.h +++ b/dfhack/include/DFTypes.h @@ -73,7 +73,7 @@ struct t_matglossPlant char food_name[128]; char extract_name[128]; }; - +/* struct t_vein { uint32_t vtable; @@ -83,7 +83,16 @@ struct t_vein uint32_t flags; uint32_t address_of; // this is NOT part of the DF vein, but an address of the vein as seen by DFhack. }; - +*/ +struct t_vein +{ + uint32_t vtable; + int32_t type; + int16_t assignment[16]; + //int16_t unknown; + uint32_t flags; + uint32_t address_of; // this is NOT part of the DF vein, but an address of the vein as seen by DFhack. +}; // stores what tiles should appear when the ice melts struct t_frozenliquidvein { diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1181c83d6..4569dd33f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -62,41 +62,41 @@ TARGET_LINK_LIBRARIES(dfvecc dfhack) # ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp) # TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) -# IF(UNIX) -# SET(CURSES_NEED_WIDE "YES") -# SET(CURSES_NEED_NCURSES "YES") -# find_package(Curses) -# -# IF(CURSES_FOUND) -# if(CURSES_HAVE_NCURSESW_NCURSES_H) -# SET(NCURSES_H "ncursesw/ncurses.h") -# elseif(CURSES_HAVE_NCURSESW_CURSES_H) -# SET(NCURSES_H "ncursesw/curses.h") -# elseif(CURSES_HAVE_NCURSESW_H) -# SET(NCURSES_H "ncursesw.h") -# elseif(CURSES_HAVE_CURSESW_H) -# SET(NCURSES_H "cursesw.h") -# endif(CURSES_HAVE_NCURSESW_NCURSES_H) -# IF(NCURSES_H) -# # OPTION( VARIABLE "Description" Initial state) -# #OPTION( WITH_FOO "Enable FOO support" ON ) -# #OPTION( WITH_BAR "Enable BAR component" OFF ) -# #SET( BAZ 18 ) -# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h ) -# -# # veinlook - look at the map... sort of -# ADD_EXECUTABLE(dfveinlook veinlook.cpp) -# INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) -# TARGET_LINK_LIBRARIES(dfveinlook dfhack ${CURSES_LIBRARIES}) -# install(TARGETS -# dfveinlook -# RUNTIME DESTINATION bin -# ) -# ENDIF(NCURSES_H) -# ELSE(CURSES_FOUND) -# MESSAGE(STATUS "Wide-character ncurses library not found - vainlook can't be built") -# ENDIF(CURSES_FOUND) -# ENDIF(UNIX) +IF(UNIX) + SET(CURSES_NEED_WIDE "YES") + SET(CURSES_NEED_NCURSES "YES") + find_package(Curses) + + IF(CURSES_FOUND) + if(CURSES_HAVE_NCURSESW_NCURSES_H) + SET(NCURSES_H "ncursesw/ncurses.h") + elseif(CURSES_HAVE_NCURSESW_CURSES_H) + SET(NCURSES_H "ncursesw/curses.h") + elseif(CURSES_HAVE_NCURSESW_H) + SET(NCURSES_H "ncursesw.h") + elseif(CURSES_HAVE_CURSESW_H) + SET(NCURSES_H "cursesw.h") + endif(CURSES_HAVE_NCURSESW_NCURSES_H) + IF(NCURSES_H) + # OPTION( VARIABLE "Description" Initial state) + #OPTION( WITH_FOO "Enable FOO support" ON ) + #OPTION( WITH_BAR "Enable BAR component" OFF ) + #SET( BAZ 18 ) + CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h ) + + # veinlook - look at the map... sort of + ADD_EXECUTABLE(dfveinlook veinlook.cpp) + INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(dfveinlook dfhack ${CURSES_LIBRARIES}) + install(TARGETS + dfveinlook + RUNTIME DESTINATION bin + ) + ENDIF(NCURSES_H) + ELSE(CURSES_FOUND) + MESSAGE(STATUS "Wide-character ncurses library not found - vainlook can't be built") + ENDIF(CURSES_FOUND) +ENDIF(UNIX) # renamer - change the custom names and professions of creatures, sends keys to # df directly diff --git a/examples/veinlook.cpp b/examples/veinlook.cpp index 32980fa40..94c4cd20c 100644 --- a/examples/veinlook.cpp +++ b/examples/veinlook.cpp @@ -338,13 +338,13 @@ main(int argc, char *argv[]) z_max = z_max_a; // get stone matgloss mapping - if(!DF.ReadStoneMatgloss(stonetypes)) + if(!DF.ReadInorganicMaterials(stonetypes)) { error = "Can't read stone types."; pDF = 0; finish(0); } - +/* // get region geology if(!DF.ReadGeology( layerassign )) { @@ -352,7 +352,7 @@ main(int argc, char *argv[]) pDF = 0; finish(0); } - +*/ // FIXME: could fail on small forts int cursorX = x_max/2 - 1; int cursorY = y_max/2 - 1; @@ -439,6 +439,7 @@ main(int argc, char *argv[]) // Supend, read/write data DF.Suspend(); uint32_t effectnum; + /* if(DF.InitReadEffects(effectnum)) { for(uint32_t i = 0; i < effectnum;i++) @@ -448,6 +449,7 @@ main(int argc, char *argv[]) effects.push_back(effect); } } + */ for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++) { mapblock40d * Block = &blocks[i+1][j+1]; @@ -562,8 +564,10 @@ main(int argc, char *argv[]) //iterate through the bits for (uint32_t k = 0; k< 16;k++) { + /* if(tileTypeTable[blocks[1][1].tiletypes[k][j]].m != VEIN) continue; + */ /* if(blocks[1][1].designation[k][j].bits.hidden) continue; @@ -577,7 +581,7 @@ main(int argc, char *argv[]) } } gotoxy(0,51); - cprintf("Mineral: %s",stonetypes[veinVector[vein].type].name); + cprintf("Mineral: %s",stonetypes[veinVector[vein].type].id); } else { diff --git a/output/Memory.xml b/output/Memory.xml index f4c52240e..2ef810b70 100644 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -3099,7 +3099,7 @@ =========
0x016AD718
0x08 - 0x0092 + 0x009A 0x029C