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

@ -1816,6 +1816,24 @@ map_data_1b60_offset 0x1B9c
<Offset name="creature_type_extract_vector">0x1A14</Offset>
<Offset name="creature_tile">0xE0</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
============
@ -1831,13 +1849,6 @@ map_data_1b60_offset 0x1B9c
<Address name="construction_vector">0x92D0144</Address> 0x165b290
<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
==========

@ -172,29 +172,12 @@ bool vectorString (SegmentedFinder* s, vecTriplet *x, const char *y)
uint32_t object_ptr;
if(!s->Read(x->start,object_ptr))
return false;
// deref ptr to first object, get ptr to string
uint32_t string_ptr;
if(!s->Read(object_ptr,string_ptr))
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
deref1 = s->Translate(string_ptr);
if(!deref1)
return false;
char * str = (char *) deref1;*/
char * str = s->Translate<char>(string_ptr);
if(!str)
return false;
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 )
{
// read string pointer
uint32_t addrx = *addr;
// translat to local scheme
char *deref1 = (char *) s->Translate<char>(addrx);
// read string pointer, translate to local scheme
char *str = s->Translate<char>(*addr);
// verify
if(!deref1)
if(!str)
return false;
if(strcmp(deref1, compare) == 0)
if(strcmp(str, compare) == 0)
return true;
return false;
}