|
|
@ -83,6 +83,11 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t item_material_offset;
|
|
|
|
uint32_t item_material_offset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t note_foreground_offset;
|
|
|
|
|
|
|
|
uint32_t note_background_offset;
|
|
|
|
|
|
|
|
uint32_t note_name_offset;
|
|
|
|
|
|
|
|
uint32_t note_xyz_offset;
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t dwarf_lang_table_offset;
|
|
|
|
uint32_t dwarf_lang_table_offset;
|
|
|
|
|
|
|
|
|
|
|
|
ProcessEnumerator* pm;
|
|
|
|
ProcessEnumerator* pm;
|
|
|
@ -98,6 +103,7 @@ public:
|
|
|
|
bool cursorWindowInited;
|
|
|
|
bool cursorWindowInited;
|
|
|
|
bool viewSizeInited;
|
|
|
|
bool viewSizeInited;
|
|
|
|
bool itemsInited;
|
|
|
|
bool itemsInited;
|
|
|
|
|
|
|
|
bool notesInited;
|
|
|
|
|
|
|
|
|
|
|
|
bool nameTablesInited;
|
|
|
|
bool nameTablesInited;
|
|
|
|
|
|
|
|
|
|
|
@ -107,6 +113,7 @@ public:
|
|
|
|
DfVector *p_bld;
|
|
|
|
DfVector *p_bld;
|
|
|
|
DfVector *p_veg;
|
|
|
|
DfVector *p_veg;
|
|
|
|
DfVector *p_itm;
|
|
|
|
DfVector *p_itm;
|
|
|
|
|
|
|
|
DfVector *p_notes;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
API::API (const string path_to_xml)
|
|
|
|
API::API (const string path_to_xml)
|
|
|
@ -122,6 +129,7 @@ API::API (const string path_to_xml)
|
|
|
|
d->cursorWindowInited = false;
|
|
|
|
d->cursorWindowInited = false;
|
|
|
|
d->viewSizeInited = false;
|
|
|
|
d->viewSizeInited = false;
|
|
|
|
d->itemsInited = false;
|
|
|
|
d->itemsInited = false;
|
|
|
|
|
|
|
|
d->notesInited = false;
|
|
|
|
d->pm = NULL;
|
|
|
|
d->pm = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -853,7 +861,47 @@ bool API::InitReadCreatures( uint32_t &numcreatures )
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool API::InitReadNotes( uint32_t &numnotes )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
memory_info * minfo = d->offset_descriptor;
|
|
|
|
|
|
|
|
int notes = d->offset_descriptor->getAddress ("notes");
|
|
|
|
|
|
|
|
d->note_foreground_offset = minfo->getOffset ("note_foreground");
|
|
|
|
|
|
|
|
d->note_background_offset = minfo->getOffset ("note_background");
|
|
|
|
|
|
|
|
d->note_name_offset = minfo->getOffset ("note_name");
|
|
|
|
|
|
|
|
d->note_xyz_offset = minfo->getOffset ("note_xyz");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (notes
|
|
|
|
|
|
|
|
&& d->note_foreground_offset
|
|
|
|
|
|
|
|
&& d->note_background_offset
|
|
|
|
|
|
|
|
&& d->note_name_offset
|
|
|
|
|
|
|
|
&& d->note_xyz_offset
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
d->p_notes = new DfVector (d->p->readVector (notes, 4));
|
|
|
|
|
|
|
|
//InitReadNameTables();
|
|
|
|
|
|
|
|
d->notesInited = true;
|
|
|
|
|
|
|
|
numnotes = d->p_notes->getSize();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
d->notesInited = false;
|
|
|
|
|
|
|
|
numnotes = 0;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool API::ReadNote (const int32_t &index, t_note & note)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert (d->notesInited);
|
|
|
|
|
|
|
|
// read pointer from vector at position
|
|
|
|
|
|
|
|
uint32_t temp = * (uint32_t *) d->p_notes->at (index);
|
|
|
|
|
|
|
|
note.symbol = g_pProcess->readByte(temp);
|
|
|
|
|
|
|
|
note.foreground = g_pProcess->readWord(temp + d->note_foreground_offset);
|
|
|
|
|
|
|
|
note.background = g_pProcess->readWord(temp + d->note_background_offset);
|
|
|
|
|
|
|
|
d->p->readSTLString (temp + d->note_name_offset, note.name, 128);
|
|
|
|
|
|
|
|
g_pProcess->read (temp + d->note_xyz_offset, 3*sizeof (uint16_t), (uint8_t *) ¬e.x);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
// returns index of creature actually read or -1 if no creature can be found
|
|
|
|
// returns index of creature actually read or -1 if no creature can be found
|
|
|
|
int32_t API::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
int32_t API::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
|
const uint16_t &x1, const uint16_t &y1, const uint16_t &z1,
|
|
|
@ -1087,6 +1135,13 @@ void API::FinishReadCreatures()
|
|
|
|
d->creaturesInited = false;
|
|
|
|
d->creaturesInited = false;
|
|
|
|
//FinishReadNameTables();
|
|
|
|
//FinishReadNameTables();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void API::FinishReadNotes()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
delete d->p_notes;
|
|
|
|
|
|
|
|
d->p_notes = NULL;
|
|
|
|
|
|
|
|
d->notesInited = false;
|
|
|
|
|
|
|
|
//FinishReadNameTables();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool API::Attach()
|
|
|
|
bool API::Attach()
|
|
|
|
{
|
|
|
|
{
|
|
|
|