==================================================================
 Documentation: RMT-files (used in RED ALERT!)
 Author:        Moritz Mertinkat
 eMail:         Moehrchen@t-online.de
 WWW 1:         http://home.t-online.de/home/moehrchen (Pascal)
 WWW 2:         http://www.geocities.com/SiliconValley/Pines/5268
==================================================================

(1) RMT-format
--------------

The header (in pascal):

  TRMTHeader = record
    Width    : Word;     {Width of images, always 24 (18h)}
    Height   : Word;     {Heigth of images, always 24 (18h)}
    NumTil   : Word;     {Number of Tiles}
    Unknown1 : Word;
    NumHT    : Word;     {Number of horizontal tiles} 
    NumVT    : Word;     {Number of vertical tiles}
    Size     : LongInt;  {Size of file}
    ImgStart : LongInt;  {Start of image-data}
    Unknown2 : LongInt;
    Unknown3 : LongInt;
    Index2   : LongInt;
    Unknown4 : LongInt;
    Index1   : LongInt;  {Offset of "Index"}
  end;


  Index2-Index1 should be the number of tiles!

  Index1 is an offset for an array of bytes:
    Index: ARRAY[1..NumTil] of Byte;

  Every entry in this array which points to a specified tile.
  If the entry is 255 (FFh) then the tile is empty!
  An example:
    If you want to display tile 8 of a RMT-file you have to do
    the following:
      - open the file
      - read the header
      - seek to pos. INDEX1
      - read the index
      - read the 9th byte of it (for tile 8, because the index
                                 starts with 0!}
      - seek to: SizeOf(Header) + Index[9] * (24*24)
      - read 576 bytes (24*24) and display them!
      - close the file

  If you want to show the whole image (NumTil tiles), you can
  use NumHT and NumVT to determine the dimension of the RMT-image.
  For example if NumHT=4 and NumVT=3, then you've got a 4x3-RMT-image!
  >> The old TMP-files (used in C&C) don't have NumHT and NumVT, so
  >> you've to work out the dimension by viewing every file...

  All the graphics-data is uncompressed!

  If you have any questions, comments ect. please email
  me: Moehrchen@t-online.de

  Hope this documentation will help you!
