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 food_name[128];
char extract_name[128]; char extract_name[128];
}; };
/*
struct t_vein struct t_vein
{ {
uint32_t vtable; uint32_t vtable;
@ -83,7 +83,16 @@ struct t_vein
uint32_t flags; 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. 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 // stores what tiles should appear when the ice melts
struct t_frozenliquidvein struct t_frozenliquidvein
{ {

@ -62,41 +62,41 @@ TARGET_LINK_LIBRARIES(dfvecc dfhack)
# ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp) # ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp)
# TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) # TARGET_LINK_LIBRARIES(dfcatsplosion dfhack)
# IF(UNIX) IF(UNIX)
# SET(CURSES_NEED_WIDE "YES") SET(CURSES_NEED_WIDE "YES")
# SET(CURSES_NEED_NCURSES "YES") SET(CURSES_NEED_NCURSES "YES")
# find_package(Curses) find_package(Curses)
#
# IF(CURSES_FOUND) IF(CURSES_FOUND)
# if(CURSES_HAVE_NCURSESW_NCURSES_H) if(CURSES_HAVE_NCURSESW_NCURSES_H)
# SET(NCURSES_H "ncursesw/ncurses.h") SET(NCURSES_H "ncursesw/ncurses.h")
# elseif(CURSES_HAVE_NCURSESW_CURSES_H) elseif(CURSES_HAVE_NCURSESW_CURSES_H)
# SET(NCURSES_H "ncursesw/curses.h") SET(NCURSES_H "ncursesw/curses.h")
# elseif(CURSES_HAVE_NCURSESW_H) elseif(CURSES_HAVE_NCURSESW_H)
# SET(NCURSES_H "ncursesw.h") SET(NCURSES_H "ncursesw.h")
# elseif(CURSES_HAVE_CURSESW_H) elseif(CURSES_HAVE_CURSESW_H)
# SET(NCURSES_H "cursesw.h") SET(NCURSES_H "cursesw.h")
# endif(CURSES_HAVE_NCURSESW_NCURSES_H) endif(CURSES_HAVE_NCURSESW_NCURSES_H)
# IF(NCURSES_H) IF(NCURSES_H)
# # OPTION( VARIABLE "Description" Initial state) # OPTION( VARIABLE "Description" Initial state)
# #OPTION( WITH_FOO "Enable FOO support" ON ) #OPTION( WITH_FOO "Enable FOO support" ON )
# #OPTION( WITH_BAR "Enable BAR component" OFF ) #OPTION( WITH_BAR "Enable BAR component" OFF )
# #SET( BAZ 18 ) #SET( BAZ 18 )
# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h ) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/fake-curses.h )
#
# # veinlook - look at the map... sort of # veinlook - look at the map... sort of
# ADD_EXECUTABLE(dfveinlook veinlook.cpp) ADD_EXECUTABLE(dfveinlook veinlook.cpp)
# INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR})
# TARGET_LINK_LIBRARIES(dfveinlook dfhack ${CURSES_LIBRARIES}) TARGET_LINK_LIBRARIES(dfveinlook dfhack ${CURSES_LIBRARIES})
# install(TARGETS install(TARGETS
# dfveinlook dfveinlook
# RUNTIME DESTINATION bin RUNTIME DESTINATION bin
# ) )
# ENDIF(NCURSES_H) ENDIF(NCURSES_H)
# ELSE(CURSES_FOUND) ELSE(CURSES_FOUND)
# MESSAGE(STATUS "Wide-character ncurses library not found - vainlook can't be built") MESSAGE(STATUS "Wide-character ncurses library not found - vainlook can't be built")
# ENDIF(CURSES_FOUND) ENDIF(CURSES_FOUND)
# ENDIF(UNIX) ENDIF(UNIX)
# renamer - change the custom names and professions of creatures, sends keys to # renamer - change the custom names and professions of creatures, sends keys to
# df directly # df directly

@ -338,13 +338,13 @@ main(int argc, char *argv[])
z_max = z_max_a; z_max = z_max_a;
// get stone matgloss mapping // get stone matgloss mapping
if(!DF.ReadStoneMatgloss(stonetypes)) if(!DF.ReadInorganicMaterials(stonetypes))
{ {
error = "Can't read stone types."; error = "Can't read stone types.";
pDF = 0; pDF = 0;
finish(0); finish(0);
} }
/*
// get region geology // get region geology
if(!DF.ReadGeology( layerassign )) if(!DF.ReadGeology( layerassign ))
{ {
@ -352,7 +352,7 @@ main(int argc, char *argv[])
pDF = 0; pDF = 0;
finish(0); finish(0);
} }
*/
// FIXME: could fail on small forts // FIXME: could fail on small forts
int cursorX = x_max/2 - 1; int cursorX = x_max/2 - 1;
int cursorY = y_max/2 - 1; int cursorY = y_max/2 - 1;
@ -439,6 +439,7 @@ main(int argc, char *argv[])
// Supend, read/write data // Supend, read/write data
DF.Suspend(); DF.Suspend();
uint32_t effectnum; uint32_t effectnum;
/*
if(DF.InitReadEffects(effectnum)) if(DF.InitReadEffects(effectnum))
{ {
for(uint32_t i = 0; i < effectnum;i++) for(uint32_t i = 0; i < effectnum;i++)
@ -448,6 +449,7 @@ main(int argc, char *argv[])
effects.push_back(effect); effects.push_back(effect);
} }
} }
*/
for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++) for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++)
{ {
mapblock40d * Block = &blocks[i+1][j+1]; mapblock40d * Block = &blocks[i+1][j+1];
@ -562,8 +564,10 @@ main(int argc, char *argv[])
//iterate through the bits //iterate through the bits
for (uint32_t k = 0; k< 16;k++) for (uint32_t k = 0; k< 16;k++)
{ {
/*
if(tileTypeTable[blocks[1][1].tiletypes[k][j]].m != VEIN) if(tileTypeTable[blocks[1][1].tiletypes[k][j]].m != VEIN)
continue; continue;
*/
/* /*
if(blocks[1][1].designation[k][j].bits.hidden) if(blocks[1][1].designation[k][j].bits.hidden)
continue; continue;
@ -577,7 +581,7 @@ main(int argc, char *argv[])
} }
} }
gotoxy(0,51); gotoxy(0,51);
cprintf("Mineral: %s",stonetypes[veinVector[vein].type].name); cprintf("Mineral: %s",stonetypes[veinVector[vein].type].id);
} }
else else
{ {

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