Minor comments and other changes

develop
Petr Mrázek 2010-06-01 21:06:16 +02:00
parent 61fea19e91
commit b8600169ef
3 changed files with 51 additions and 56 deletions

@ -29,9 +29,10 @@ distribution.
namespace DFHack namespace DFHack
{ {
// tile class -- determines the general shape of the tile
enum TileClass enum TileClass
{ {
EMPTY, EMPTY,// empty
WALL, WALL,
PILLAR, PILLAR,
@ -41,10 +42,10 @@ namespace DFHack
STAIR_DOWN, STAIR_DOWN,
STAIR_UPDOWN, STAIR_UPDOWN,
RAMP, RAMP,// ramps have no direction
RAMP_TOP, RAMP_TOP,// the top of a ramp. I assume it's used for path finding.
FLOOR, FLOOR,// generic floor
TREE_DEAD, TREE_DEAD,
TREE_OK, TREE_OK,
SAPLING_DEAD, SAPLING_DEAD,
@ -54,29 +55,31 @@ namespace DFHack
BOULDER, BOULDER,
PEBBLES PEBBLES
}; };
// material -- what material the tile is made of
enum TileMaterial enum TileMaterial
{ {
AIR, AIR,// empty
SOIL, SOIL,// ordinary soil. material depends on geology
STONE, STONE,// ordinary layer stone. material depends on geology
FEATSTONE, // whatever it is FEATSTONE,// map feature stone. used for things like hell, the hell temple or adamantine tubes. material depends on local/global feature
OBSIDIAN, OBSIDIAN,// cast obsidian
VEIN, VEIN,// vein stone. material depends on mineral veins present
ICE, 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
GRASS, GRASS,// grass (has 4 variants)
GRASS2, GRASS2,// grass (has 4 variants)
GRASS_DEAD, GRASS_DEAD,// dead grass (has 4 variants)
GRASS_DRY, GRASS_DRY,// dry grass (has 4 variants)
DRIFTWOOD, DRIFTWOOD,// non-specified wood - normally on top of the local layer stone/soil.
HFS, HFS,// the stuff demon pits are made of - this makes them different from ordinary pits.
MAGMA, MAGMA,// material for semi-molten rock and 'magma flow' tiles
CAMPFIRE, CAMPFIRE,// human armies make them when they siege. The original tile may be lost?
FIRE, FIRE,// burning grass
ASHES, ASHES,// what remains from a FIRE
CONSTRUCTED, CONSTRUCTED,// tile material depends on the construction present
CYAN_GLOW CYAN_GLOW// the glowy stuff that disappears from the demon temple when you take the sword.
}; };
// variants are used for tiles, where there are multiple variants of the same - like grass floors
enum TileVariant enum TileVariant
{ {
VAR_1, VAR_1,

@ -1816,6 +1816,24 @@ map_data_1b60_offset 0x1B9c
<Offset name="creature_type_extract_vector">0x1A14</Offset> <Offset name="creature_type_extract_vector">0x1A14</Offset>
<Offset name="creature_tile">0xE0</Offset> <Offset name="creature_tile">0xE0</Offset>
<Offset name="creature_tile_color">0xF6</Offset> <Offset name="creature_tile_color">0xF6</Offset>
<!--
struct CreatureCasteType
{
?
};
struct CreatureExtractType
{
?
};
struct CreatureType
{
Vector<CreatureCasteType*> creature_type_caste_vector (0x138);
Vector<CreatureExtractType*> creature_type_extract_vector (0x1A14);
Offset creature_tile (0xE0);
Offset creature_tile_color (0xF6);
}
Vector<CreatureType*> creature_type_vector (0x09324F14);
-->
Translations Translations
============ ============
@ -1831,13 +1849,6 @@ map_data_1b60_offset 0x1B9c
<Address name="construction_vector">0x92D0144</Address> 0x165b290 <Address name="construction_vector">0x92D0144</Address> 0x165b290
<Offset name="sizeof_construction">0x14</Offset> <Offset name="sizeof_construction">0x14</Offset>
<!-- <!--
Translations
============
WORLD + 0x54E50
<Address name="language_vector">0x016AFFD8</Address>
WORLD + 0x54E80
<Address name="translation_vector">0x016B0008</Address>
<Offset name="word_table">0x4C</Offset>
Vegetation Vegetation
========== ==========

@ -172,29 +172,12 @@ bool vectorString (SegmentedFinder* s, vecTriplet *x, const char *y)
uint32_t object_ptr; uint32_t object_ptr;
if(!s->Read(x->start,object_ptr)) if(!s->Read(x->start,object_ptr))
return false; return false;
// deref ptr to first object, get ptr to string
uint32_t string_ptr; uint32_t string_ptr;
if(!s->Read(object_ptr,string_ptr)) if(!s->Read(object_ptr,string_ptr))
return false; return false;
char * str = s->Translate<char>(string_ptr);
/*
uint8_t *deref1 = s->Translate(x->start);
if(!deref1)
return false;
uint32_t object_ptr = *(uint32_t *)deref1;
if(!object_ptr)
return false;
// deref ptr to first object, get ptr to string
deref1 = s->Translate(object_ptr);
if(!deref1)
return false;
uint32_t string_ptr = *(uint32_t *)deref1;
if(!string_ptr)
return false;
// get string location in our local cache // get string location in our local cache
deref1 = s->Translate(string_ptr); char * str = s->Translate<char>(string_ptr);
if(!deref1)
return false;
char * str = (char *) deref1;*/
if(!str) if(!str)
return false; return false;
if(strcmp(y, str) == 0) if(strcmp(y, str) == 0)
@ -216,14 +199,12 @@ bool vectorAll (SegmentedFinder* s, vecTriplet *x, int )
bool findString (SegmentedFinder* s, uint32_t *addr, const char * compare ) bool findString (SegmentedFinder* s, uint32_t *addr, const char * compare )
{ {
// read string pointer // read string pointer, translate to local scheme
uint32_t addrx = *addr; char *str = s->Translate<char>(*addr);
// translat to local scheme
char *deref1 = (char *) s->Translate<char>(addrx);
// verify // verify
if(!deref1) if(!str)
return false; return false;
if(strcmp(deref1, compare) == 0) if(strcmp(str, compare) == 0)
return true; return true;
return false; return false;
} }