home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / graphics / library / wgt51_r2.zip / WGT5 / DOC / WGTFILES.TXT < prev   
Text File  |  1996-08-02  |  3KB  |  113 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. WGT File Formats
  10. Revised: June 2, 1995
  11.  
  12.  
  13.  
  14. The following is technical info about the formats of WGT files. You can use
  15. this in case you need to write your own save or load procedures.
  16.  
  17.  
  18.  
  19. Palette files:
  20. --------------
  21. Palette files are the simplest of the WGT file formats.  Since the palette
  22. contains 256 colors (numbered 0-255), and each color is made up of 3 numbers
  23. for the red, green, and blue values, each palette files contains 768 bytes.
  24.  
  25. Each of the red, green and blue values range from 0 to 63, giving a total of
  26. 262144 possible colors!
  27.  
  28.     1 color = {
  29.             1 byte for red
  30.             1 byte for blue
  31.             1 byte for green
  32.           }
  33.     256 colors = 3 bytes * 256 = 768 bytes
  34.  
  35.  
  36.  
  37. Block Files:
  38. ------------
  39. A block file contains uncompressed image data which can be quickly loaded
  40. into memory. The size varies depending on how large the area of the screen
  41. you capture with the newblock command or how large the previously loaded
  42. image was.
  43.  
  44.     Width:    1 short integer
  45.     Height:    1 short integer
  46.     Data:    Width*Height bytes
  47.  
  48.  
  49.  
  50. Map Files:
  51. ----------
  52. Map files contain the tiled background for scrolling games. It also contains
  53. additional information for the type of the tiles used and the positions of
  54. the sprites which will be shown on top of the background.
  55.  
  56. 1 unsigned short : contains magic number:
  57.             8972 version 2
  58.             8973 version 3.5
  59.             8974 version 4.0
  60.                         8975 version 5.0
  61.  
  62. Version 3.5 and up 
  63. {
  64.         1 short      : width of map (0-320)
  65.         1 short      : height of map (0-200)
  66. }
  67.  or 
  68. Version 2 
  69. {
  70.         1 byte       : width of map (0-200)
  71.         1 byte       : height of map (0-200)
  72. }
  73.  
  74. w*h bytes            : map data (bytes represent tile numbers)
  75.                        Tile #201 is always empty in Version 3.5 or earlier.
  76.   
  77. 256 bytes (version 4.0 and up), 200 bytes otherwise
  78.                      : Type data (assigns a type number to each tile)
  79.  
  80. 1 byte               : number of sprite structures saved in file
  81.  
  82. Sprite structure {
  83.     1 byte            : on/off
  84.     1 short            : x coordinate
  85.     1 short            : y coordinate
  86.     Version 2: 1 byte        : sprite number shown (from sprite array)
  87.     Version 3+: 1 unsigned short: sprite number shown
  88.   }
  89.  
  90.  
  91.  
  92. Sprite Files:
  93. -------------
  94.         1   short               : Version number (Latest is 5)
  95.     13  bytes        : contains " Sprite File " (with spaces at ends)
  96.     768 unsigned char    : palette info
  97.     1   short        : Version 3.5 or less = max number of sprites per file
  98.                  (Version 3.5 is 1000, previous are 200)
  99.                                   Version 4+ reports number of sprites in file
  100.  
  101.         For each sprite in the file: (starting index is 0 for version 4+,
  102.                                       1 for all others)
  103.  
  104.         sprite structure {      (starting index to max sprite)
  105.         1 short: sprite slot status (0=empty, 1=used)
  106.         if sprite is made (1), then read in block
  107.         {
  108.             2 shorts           : width and height
  109.             width*height bytes : image data
  110.         }
  111.     end        
  112.  
  113.