Difference between revisions of "Xmoto.bin"

From X-Moto
Jump to: navigation, search
Line 1: Line 1:
[[Ca:xmoto.bin|Català]]
+
[[Ca:xmoto.bin|Català]] - [[Es:xmoto.bin|Español]]
  
 
This file, which on Windows is located in the game installation directory and some random place on other systems, contains most of the built-in data you'll find in Xmoto. That is, the built-in levels, the textures, the sounds, and such. It's a very simple file format, there is no compression or anything, as most of the contained files are already compressed.  
 
This file, which on Windows is located in the game installation directory and some random place on other systems, contains most of the built-in data you'll find in Xmoto. That is, the built-in levels, the textures, the sounds, and such. It's a very simple file format, there is no compression or anything, as most of the contained files are already compressed.  

Revision as of 03:04, 12 October 2006

Català - Español

This file, which on Windows is located in the game installation directory and some random place on other systems, contains most of the built-in data you'll find in Xmoto. That is, the built-in levels, the textures, the sounds, and such. It's a very simple file format, there is no compression or anything, as most of the contained files are already compressed.

One might argue that it would be much nicer to have all these contained files as actual files in the file system instead, but for historical reasons this is how it is now; it might change in the future.

You can update your xmoto.bin by running xmoto-edit with the -pack argument. It will tell the editor to read the package.lst file (which is a list of files to add to xmoto.bin) and generate a new file.

Format

4 bytes: XBI1  (FILEID)     # indicates the file format

Following is an entry for each contained file in the package:

1 byte         (NAME_LEN)   # length of file name
NAME_LEN bytes (FILENAME)   # name of file, for instance Sounds/Strawberry.ogg
4 bytes        (FILESIZE)   # size of file, a little-endian integer
FILESIZE bytes (DATA)       # actual file data

Notice that file names don't have \0 in the end. Also notice that there's no information about how many files there are, so you should simply read until you get an EOF.

See Also