Bläddra i källkod

Added documentation on the package file format.

Lasse Öörni 12 år sedan
förälder
incheckning
1463b67a70
1 ändrade filer med 24 tillägg och 3 borttagningar
  1. 24 3
      Docs/Reference.dox

+ 24 - 3
Docs/Reference.dox

@@ -1707,7 +1707,7 @@ Examines a directory recursively for files and subdirectories and creates a Pack
 Usage:
 Usage:
 
 
 \verbatim
 \verbatim
-PackageTool <directory to process> <package name> [basepath]
+PackageTool <directory to process> <package name> [basepath] [-c]
 \endverbatim
 \endverbatim
 
 
 When PackageTool runs, it will go inside the source directory, then look for subdirectories and any files. Paths inside the package will by default be relative to the source directory, but if an extra path prefix is desired, it can be specified by the optional basepath argument.
 When PackageTool runs, it will go inside the source directory, then look for subdirectories and any files. Paths inside the package will by default be relative to the source directory, but if an extra path prefix is desired, it can be specified by the optional basepath argument.
@@ -1718,6 +1718,8 @@ For example, this would convert all the resource files inside the Urho3D Data di
 PackageTool Data Data.pak
 PackageTool Data Data.pak
 \endverbatim
 \endverbatim
 
 
+The -c option enables LZ4 file compression on the package.
+
 \section Tools_RampGenerator RampGenerator
 \section Tools_RampGenerator RampGenerator
 
 
 Creates 1D and 2D ramp textures for use in light attenuation and spotlight spot shapes.
 Creates 1D and 2D ramp textures for use in light attenuation and spotlight spot shapes.
@@ -1919,14 +1921,33 @@ uint       Bytecode size
 byte[]     Bytecode
 byte[]     Bytecode
 \endverbatim
 \endverbatim
 
 
+\section FileFormats_Package Package file (.pak)
+
+\verbatim
+byte[4]    Identifier "UPAK" or "ULZ4" if compressed
+uint       Number of file entries
+uint       Whole package checksum
+(uint)     Compressed block size, only included if compressed
+
+    For each file entry:
+    cstring    Name
+    uint       Start offset
+    uint       Size
+    uint       Checksum
+
+    For each compressed block in file data:
+    ushort     Uncompressed length of block
+    ushort     Compressed length of block
+    byte[]     Compressed data
+\endverbatim
+
 \section FileFormats_Script Compiled AngelScript (.asc)
 \section FileFormats_Script Compiled AngelScript (.asc)
 
 
 \verbatim
 \verbatim
 byte[4]    Identifier "ASBC"
 byte[4]    Identifier "ASBC"
-?          Bytecode, produced by AngelScript serializer
+byte[]     Bytecode, produced by AngelScript serializer
 \endverbatim
 \endverbatim
 
 
-
 \page CodingConventions Coding conventions
 \page CodingConventions Coding conventions
 
 
 - Indent style is Allman (BSD) -like, ie. brace on the next line from a control statement, indented on the same level. In switch-case statements the cases are on the same indent level as the switch statement.
 - Indent style is Allman (BSD) -like, ie. brace on the next line from a control statement, indented on the same level. In switch-case statements the cases are on the same indent level as the switch statement.