]> icculus.org git repositories - crow/jumpnbump.git/blob - gob.txt
Updated.
[crow/jumpnbump.git] / gob.txt
1              THE FORMAT OF GOBFILES
2
3 Do YOU want to make your own GOB-files?
4 Then you have to know the GOB format!
5 Here you can find a brief desciption of it.
6 (this is all about how the file is saved)
7 Note: Everything is saved in Intel byteorder,
8 ie the least significant byte first.
9
10
11                   THE HEADER
12
13 Offset   Size   Description
14  0        2      Number of images in the file
15
16
17 For I=1 to Number of images
18
19    Offset   Size   Description
20     2+I*4    4      Offset in file to image data
21
22 End repeat
23
24
25 The above offsets are offsets from the beginning of
26 the file. Each image has it's own image data.
27 The image data is like this:
28
29
30                 THE IMAGE DATA
31
32 Offset   Size   Description
33  0        2      Image width in pixels (W)
34  2        2      Image height in pixels (H)
35  4        2      Hotspot x
36  6        2      Hotspot y
37  8        W*H    Bitmap data
38
39
40 The offsets above are offsets in the image data (for each image).
41
42 The Hotspot x/y of a specific image works like this:
43 Whenever a sprite is drawn at (x, y) with that image,
44 the image is drawn at (x - hotspot x, y - hotspot y),
45 where hotspot x/y are the hotspots for that image.
46
47 The bitmap data is just a block of colordata for each pixel.
48 It scans the image horisontally left/down. This means that
49 the first byte represents the upper left pixel, the second
50 represents the pixel to the right of that and so on.
51 If the width is 10  pixels then the 10th byte of bitmap data
52 will represent the pixel (0, 1).