]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/vfswad/unwad.h
uncrustify! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / plugins / vfswad / unwad.h
index 074a75eaa339f9cbe37753352abbc0ba03ef130c..9a6060798ec1211d4e8b2a48669d0288897f0b9c 100644 (file)
@@ -7,53 +7,53 @@
 
 #define WADBUFSIZE 32768
 
-#define WAD2_TYPE_MIP  0x44
-#define WAD2_ID                        ('W' | 'A' << 8 | 'D' << 16 | '2' << 24)
-#define WAD3_TYPE_MIP  0x43
-#define WAD3_ID                        ('W' | 'A' << 8 | 'D' << 16 | '3' << 24)
-#define GET_MIP_DATA_SIZE(WIDTH, HEIGHT)               ((WIDTH * HEIGHT) + (WIDTH * HEIGHT / 4) + (WIDTH * HEIGHT / 16) + (WIDTH * HEIGHT / 64))
+#define WAD2_TYPE_MIP   0x44
+#define WAD2_ID         ( 'W' | 'A' << 8 | 'D' << 16 | '2' << 24 )
+#define WAD3_TYPE_MIP   0x43
+#define WAD3_ID         ( 'W' | 'A' << 8 | 'D' << 16 | '3' << 24 )
+#define GET_MIP_DATA_SIZE( WIDTH, HEIGHT )        ( ( WIDTH * HEIGHT ) + ( WIDTH * HEIGHT / 4 ) + ( WIDTH * HEIGHT / 16 ) + ( WIDTH * HEIGHT / 64 ) )
 
 /*
 
-  WAD3 pseudo-structure:
-
-       WAD3 Header
-       Mip section
-               First mip
-                       Mip header
-                       First mip (width * height)
-                       Second mip (width * height / 4)
-                       Third mip (width * height / 16)
-                       Fourth mip (width * height / 64)
-                       Palette size (WORD)
-                       Palette (Palette size * 3)
-                       Padding (WORD)
-               [...]
-               Last mip
-       Lump table
-               First lump entry
-                       Lump header
-               [...]
-               Last lump entry
-
-  WAD2 pseudo-structure:
-
-       WAD2 Header
-       Mip section
-               First mip
-                       Mip header
-                       First mip (width * height)
-                       Second mip (width * height / 4)
-                       Third mip (width * height / 16)
-                       Fourth mip (width * height / 64)
-               [...]
-               Last mip
-       Lump table
-               First lump entry
-                       Lump header
-               [...]
-               Last lump entry
-*/
+   WAD3 pseudo-structure:
+
+    WAD3 Header
+    Mip section
+        First mip
+            Mip header
+            First mip (width * height)
+            Second mip (width * height / 4)
+            Third mip (width * height / 16)
+            Fourth mip (width * height / 64)
+            Palette size (WORD)
+            Palette (Palette size * 3)
+            Padding (WORD)
+        [...]
+        Last mip
+    Lump table
+        First lump entry
+            Lump header
+        [...]
+        Last lump entry
+
+   WAD2 pseudo-structure:
+
+    WAD2 Header
+    Mip section
+        First mip
+            Mip header
+            First mip (width * height)
+            Second mip (width * height / 4)
+            Third mip (width * height / 16)
+            Fourth mip (width * height / 64)
+        [...]
+        Last mip
+    Lump table
+        First lump entry
+            Lump header
+        [...]
+        Last lump entry
+ */
 
 #define DWORD unsigned int
 #define BYTE unsigned char
 
 typedef struct
 {
-       DWORD           identification;
-       DWORD           numlumps;
-       DWORD           infotableofs;                   // Lump table
+       DWORD identification;
+       DWORD numlumps;
+       DWORD infotableofs;                 // Lump table
 } WAD3_HEADER, *LPWAD3_HEADER;
 
 typedef struct
 {
-       DWORD           filepos;
-       DWORD           disksize;
-       DWORD           size;                                   // uncompressed
-       BYTE            type;
-       BYTE            compression;
-       BYTE            pad1, pad2;
-       char            name[16];                               // must be null terminated
+       DWORD filepos;
+       DWORD disksize;
+       DWORD size;                         // uncompressed
+       BYTE type;
+       BYTE compression;
+       BYTE pad1, pad2;
+       char name[16];                      // must be null terminated
 } WAD3_LUMP, *LPWAD3_LUMP;
 
 typedef struct
 {
-       char            name[16];
-       DWORD           width, height;
-       DWORD           offsets[4];             // four mip maps stored
+       char name[16];
+       DWORD width, height;
+       DWORD offsets[4];           // four mip maps stored
 } WAD3_MIP, *LPWAD3_MIP;
 
 
 typedef struct wadFile_s
 {
        FILE * fin;
-       LPWAD3_HEADER   lpHeader;
-       LPWAD3_LUMP             lpLump;
-       LPWAD3_MIP              lpMip;
+       LPWAD3_HEADER lpHeader;
+       LPWAD3_LUMP lpLump;
+       LPWAD3_MIP lpMip;
 
        DWORD FileSize;
-  unsigned long currentfile;
-  char *wadfilename;
+       unsigned long currentfile;
+       char *wadfilename;
 } wadFile_t;
 
 
-wadFile_t *wadOpen(const char* path);
-wadFile_t *wadCleanup(wadFile_t *wf);
-int wadGoToFirstFile(wadFile_t *wf);
-int wadGetCurrentFileInfo (    wadFile_t *wf, char *szFileName, unsigned long fileNameBufferSize, unsigned long *filesize);
-int wadGoToNextFile(wadFile_t *wf);
+wadFile_t *wadOpen( const char* path );
+wadFile_t *wadCleanup( wadFile_t *wf );
+int wadGoToFirstFile( wadFile_t *wf );
+int wadGetCurrentFileInfo( wadFile_t *wf, char *szFileName, unsigned long fileNameBufferSize, unsigned long *filesize );
+int wadGoToNextFile( wadFile_t *wf );
 
-int wadOpenCurrentFileByNum (wadFile_t *wf, unsigned long filenumber);
-void wadCloseCurrentFile (wadFile_t *wf);
-unsigned long wadReadCurrentFile (wadFile_t *wf , char *bufferptr, unsigned long size);
+int wadOpenCurrentFileByNum( wadFile_t *wf, unsigned long filenumber );
+void wadCloseCurrentFile( wadFile_t *wf );
+unsigned long wadReadCurrentFile( wadFile_t *wf, char *bufferptr, unsigned long size );
 
-#endif         // #ifndef _WAD3_H_
+#endif      // #ifndef _WAD3_H_