DEADSOFTWARE

e36dc0fa7198855f98da49d8caed3ac1cb263925
[d2df-sdl.git] / src / tools / png2map / mapdef.h
1 /* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
16 #pragma once
18 #include <stdint.h>
20 #define MAP_MAGIC "MAP\x01"
22 enum {
23 MBLK_NONE = 0,
24 MBLK_TEXTURES = 1,
25 MBLK_PANELS = 2,
26 MBLK_HEADER = 7,
27 };
29 enum {
30 PANEL_NONE = 0, // 0
31 PANEL_WALL, // 1
32 PANEL_BACK, // 2
33 PANEL_FORE, // 4
34 PANEL_WATER, // 8
35 PANEL_ACID1, // 16
36 PANEL_ACID2, // 32
37 PANEL_STEP, // 64
38 PANEL_LIFTUP, // 128
39 PANEL_LIFTDOWN, // 256
40 PANEL_OPENDOOR, // 512
41 PANEL_CLOSEDOOR, // 1024
42 PANEL_BLOCKMON, // 2048
43 PANEL_LIFTLEFT, // 4096
44 PANEL_LIFTRIGHT, // 8192
46 PANEL_NUMTYPES
47 };
49 enum {
50 PFLAG_HIDE = 2,
51 PFLAG_WATERTEXTURES = 4,
52 };
54 #pragma pack(push, 1)
56 typedef struct {
57 char name[32];
58 char author[32];
59 char desc[256];
60 char music[64];
61 char sky[64];
62 uint16_t width;
63 uint16_t height;
64 } map_header_t;
66 typedef struct {
67 char resname[64];
68 uint8_t anim;
69 } map_texture_t;
71 typedef struct {
72 int32_t x, y;
73 uint16_t w, h;
74 uint16_t texid;
75 uint16_t type;
76 uint8_t alpha;
77 uint8_t flags;
78 } map_panel_t;
80 typedef struct {
81 uint8_t type;
82 uint32_t reserved;
83 uint32_t size;
84 } map_block_t;
86 #pragma pack(pop)