Fix t_vein, tiletype offset

develop
Petr Mrázek 2010-04-03 04:41:21 +02:00
parent e4d6e01ee2
commit ef6af19c8d
4 changed files with 55 additions and 42 deletions

@ -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
{

@ -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

@ -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
{

@ -3099,7 +3099,7 @@
=========
<Address name="map_data">0x016AD718</Address>
<Offset name="v_vein">0x08</Offset>
<Offset name="type">0x0092</Offset>
<Offset name="type">0x009A</Offset>
<Offset name="designation">0x029C</Offset>
<!--
No idea if those are still relevant. I'll assume NO