:orphan:

==============
TKE_Dictionary
==============

Opcode
======

.. csv-table::

	"ASCII", "D"
	"Hexadecimal", "44"
	"Decimal", "68"


Operands
========

| Byte format
| [Word pause_count],
| [(pause_count)xLong pause_offsets]
| Long count,
| (count)x{
| Long index,
| Byte presence,
| (number of bits set in presence)xLong item_offset,
| [Byte item_options],
| [Point bounds_min, Point bounds_max] 
| }
| [Long first_pause_offset]
| Long dictionary_offset 

.. raw:: html::

	<table BORDER =1 WIDTH="530">
	  <TR> 
		<TD height=21 width=131>format</TD>
		<TD height=21 width=390>indicates type of dictionary, currently supported 
		  values are 0, 1, and 2.</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>pause_count</TD>
		<TD height=21 width=390>number of entries in pause offset table, present 
		  if format is 2.</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>pause_offsets</TD>
		<TD height=21 width=390>file offsets of all recorded pause opcodes, present 
		  if format is 2.</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>count</TD>
		<TD height=21 width=390>number of index-value sets</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>index</TD>
		<TD height=21 width=390>index associated with an object and the corresponding 
		  offsets</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>presence</TD>
		<TD height=21 width=390>bitmask indicating which variations of an object 
		  have recorded offsets, low bit represents the full objects, successive 
		  bits for increasingly reduced detail versions.</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>item_offset</TD>
		<TD height=21 width=390>file offset for a specific variation of an object, 
		  one per bit in <em>presence</em></TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>item_options</TD>
		<TD height=21 width=390>flags indicating any additional enties for this 
		  item, present if format is 1 or greater.</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>bounds_min</TD>
		<TD height=21 width=390>minimum corner of the bounding volume of this 
		  item, present if the low bit set in <em>item_options</em></TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>bounds_max</TD>
		<TD height=21 width=390>maximum corner of the bounding volume of this 
		  item, present if the low bit set in <em>item_options</em></TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>first_pause_offset</TD>
		<TD height=21 width=390>file offset of a single recorded pause (0 if none 
		  recorded), present if format is 1</TD>
	  </TR>
	  <TR> 
		<TD height=21 width=131>dictionary_offset</TD>
		<TD height=21 width=390>file offset of the start of the dictionary</TD>
	  </TR>
	</table>
	
	
Notes
=====

A *dictionary* is a lookup table, providing the file offsets to specified items and their variations.
  
An application might, for instance, only read the first part of an appropriated created HSF file to get the basic layout and coarse representations of the scene (low level of detail representations). It could then use the dictionary to locate and read specific items to "sweeten" them on demand.

The dictionary will commonly be placed at the end of the file, so that by stepping back from the end the location of the dictionary can be found. A ``TKE_Dictionary_Locater`` may be used instead at the end of the file if it is useful to place the dictionary itself elsewhere in the file.
