/
dd_wad.h
88 lines (76 loc) · 2.71 KB
/
dd_wad.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* DE1: $Id$
* Copyright (C) 2003, 2004 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not: http://www.opensource.org/
*
* Portions based on Hexen by Raven Software.
*/
/*
* dd_wad.h: WAD Files and Data Lump Cache
*/
#ifndef __DOOMSDAY_WAD_H__
#define __DOOMSDAY_WAD_H__
#include "sys_file.h"
#include "con_decl.h"
#define RECORD_FILENAMELEN 256
// File record flags.
#define FRF_RUNTIME 0x1 // Loaded at runtime (for reset).
enum // Lump Grouping Tags
{
LGT_NONE = 0,
LGT_FLATS,
LGT_SPRITES,
NUM_LGTAGS
};
typedef struct {
char filename[RECORD_FILENAMELEN]; // Full filename (every '\' -> '/').
int numlumps; // Number of lumps.
int flags;
DFILE *handle; // File handle.
char iwad;
} filerecord_t;
typedef struct {
char name[9]; // End in \0.
DFILE *handle;
int position, size;
int sent;
char group; // Lump grouping tag (LGT_*).
} lumpinfo_t;
extern lumpinfo_t *lumpinfo;
extern int numlumps;
void W_InitMultipleFiles(char **filenames);
void W_EndStartup(void);
int W_CheckNumForName(char *name);
int W_GetNumForName(char *name);
int W_LumpLength(int lump);
const char *W_LumpName(int lump);
void W_ReadLump(int lump, void *dest);
void W_ReadLumpSection(int lump, void *dest, int startoffset,
int length);
void *W_CacheLumpNum(int lump, int tag);
void *W_CacheLumpName(char *name, int tag);
boolean W_AddFile(const char *filename, boolean allowDuplicate);
boolean W_RemoveFile(char *filename);
void W_Reset();
void W_ChangeCacheTag(int lump, int tag);
void W_CheckIWAD(void);
boolean W_IsFromIWAD(int lump);
const char *W_LumpSourceFile(int lump);
unsigned int W_CRCNumberForRecord(int idx);
unsigned int W_CRCNumber(void);
void W_GetIWADFileName(char *buf, int bufSize);
void W_GetPWADFileNames(char *buf, int bufSize, char separator);
void W_PrintMapList(void);
D_CMD(ListMaps);
#endif