|
|
@ -111,6 +111,7 @@ Creatures::Creatures(DFContextPrivate* _d)
|
|
|
|
creatures.name_words_offset = minfo->getOffset("name_words");
|
|
|
|
creatures.name_words_offset = minfo->getOffset("name_words");
|
|
|
|
d->dwarf_race_index_addr = minfo->getAddress("dwarf_race_index");
|
|
|
|
d->dwarf_race_index_addr = minfo->getAddress("dwarf_race_index");
|
|
|
|
d->dwarf_civ_id_addr = minfo->getAddress("dwarf_civ_id");
|
|
|
|
d->dwarf_civ_id_addr = minfo->getAddress("dwarf_civ_id");
|
|
|
|
|
|
|
|
/*
|
|
|
|
// upload offsets to the SHM
|
|
|
|
// upload offsets to the SHM
|
|
|
|
if(p->getModuleIndex("Creatures2010",1,d->creature_module))
|
|
|
|
if(p->getModuleIndex("Creatures2010",1,d->creature_module))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -119,6 +120,7 @@ Creatures::Creatures(DFContextPrivate* _d)
|
|
|
|
const uint32_t cmd = Creatures2010::CREATURE_INIT + (d->creature_module << 16);
|
|
|
|
const uint32_t cmd = Creatures2010::CREATURE_INIT + (d->creature_module << 16);
|
|
|
|
p->SetAndWait(cmd);
|
|
|
|
p->SetAndWait(cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
d->Inited = true;
|
|
|
|
d->Inited = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Error::MissingMemoryDefinition&)
|
|
|
|
catch (Error::MissingMemoryDefinition&)
|
|
|
@ -158,6 +160,7 @@ bool Creatures::ReadCreature (const int32_t index, t_creature & furball)
|
|
|
|
if(!d->Started) return false;
|
|
|
|
if(!d->Started) return false;
|
|
|
|
// SHM fast path
|
|
|
|
// SHM fast path
|
|
|
|
Process * p = d->owner;
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
|
|
|
/*
|
|
|
|
if(d->creature_module)
|
|
|
|
if(d->creature_module)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SHMCREATURESHDR->index = index;
|
|
|
|
SHMCREATURESHDR->index = index;
|
|
|
@ -166,7 +169,7 @@ bool Creatures::ReadCreature (const int32_t index, t_creature & furball)
|
|
|
|
memcpy(&furball,SHMDATA(t_creature),sizeof(t_creature));
|
|
|
|
memcpy(&furball,SHMDATA(t_creature),sizeof(t_creature));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
// non-SHM slow path
|
|
|
|
// non-SHM slow path
|
|
|
|
memory_info * minfo = d->d->offset_descriptor;
|
|
|
|
memory_info * minfo = d->d->offset_descriptor;
|
|
|
|
|
|
|
|
|
|
|
@ -300,7 +303,7 @@ int32_t Creatures::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
Process *p = d->owner;
|
|
|
|
Process *p = d->owner;
|
|
|
|
|
|
|
|
/*
|
|
|
|
if(d->creature_module)
|
|
|
|
if(d->creature_module)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// supply the module with offsets so it can work with them
|
|
|
|
// supply the module with offsets so it can work with them
|
|
|
@ -317,7 +320,7 @@ int32_t Creatures::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
memcpy(&furball,SHMDATA(void),sizeof(t_creature));
|
|
|
|
memcpy(&furball,SHMDATA(void),sizeof(t_creature));
|
|
|
|
return SHMCREATURESHDR->index;
|
|
|
|
return SHMCREATURESHDR->index;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else*/
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint16_t coords[3];
|
|
|
|
uint16_t coords[3];
|
|
|
|
uint32_t size = d->p_cre->size();
|
|
|
|
uint32_t size = d->p_cre->size();
|
|
|
|