DEADSOFTWARE

8a873b5014a32c8cdb8f662d268c69321250ef3f
[d2df-sdl.git] / src / shared / MAPSTRUCT.pas
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, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$MODE DELPHI}
17 unit MAPSTRUCT;
19 {
20 -----------------------------------
21 MAPSTRUCT.PAS ÂÅÐÑÈß ÎÒ 13.11.07
23 Ïîääåðæêà êàðò âåðñèè 1
24 -----------------------------------
25 }
27 {
28 Êàðòà ïðåäñòàâëÿåò ñîáîþ WAD, â êîòîðîì ðåñóðñû â êîðíå - ñîáñòâåííî ñàìè êàðòû
29 (MAP01, MAP02 è ò.ä.).
31 Áëîêè çàêàí÷èâàþòñÿ íóëåâûì áëîêîì (BlockType=BLOCK_NONE)
33 Ñòðóêòóðà êàðòû (MAP01, MAP02...):
34 --------------------------------------
35 SIGNATURE | Byte[3] | 'MAP'
36 VERSION | Byte | $01
37 BLOCK1 | TBlock |
38 BLOCK1DATA | RAW |
39 ... | ...... |
40 BLOCKN | TBlock |
41 BLOCKNDATA | RAW |
42 --------------------------------------
44 Ñòðóêòóðà áëîêà:
45 --------------------------------------
46 BLOCKTYPE | Byte | (BLOCK_TEXTURES, BLOCK_PANELS,...)
47 RESERVED | LongWord | $00000000
48 BLOCKSIZE | LongWord | Ñêîëüêî ýòîò áëîê â ðàçìåðå (áàéò ïîñëå record'à)
49 --------------------------------------
50 }
52 interface
54 const
55 MAP_SIGNATURE = 'MAP';
56 BLOCK_NONE = 0;
57 BLOCK_TEXTURES = 1;
58 BLOCK_PANELS = 2;
59 BLOCK_ITEMS = 3;
60 BLOCK_AREAS = 4;
61 BLOCK_MONSTERS = 5;
62 BLOCK_TRIGGERS = 6;
63 BLOCK_HEADER = 7;
65 type
66 Char16 = packed array[0..15] of Char;
67 Char32 = packed array[0..31] of Char;
68 Char64 = packed array[0..63] of Char;
69 Char100 = packed array[0..99] of Char;
70 Char256 = packed array[0..255] of Char;
71 Byte128 = packed array[0..127] of Byte;
73 TMapHeaderRec_1 = packed record
74 MapName: Char32;
75 MapAuthor: Char32;
76 MapDescription: Char256;
77 MusicName: Char64;
78 SkyName: Char64;
79 Width: Word;
80 Height: Word;
81 end;
83 TTextureRec_1 = packed record
84 Resource: Char64;
85 Anim: Byte;
86 end;
88 TPanelRec_1 = packed record
89 X, Y: Integer;
90 Width,
91 Height: Word;
92 TextureNum: Word;
93 PanelType: Word;
94 Alpha: Byte;
95 Flags: Byte;
96 end;
98 TItemRec_1 = packed record
99 X, Y: Integer;
100 ItemType: Byte;
101 Options: Byte;
102 end;
104 TMonsterRec_1 = packed record
105 X, Y: Integer;
106 MonsterType: Byte;
107 Direction: Byte;
108 end;
110 TAreaRec_1 = packed record
111 X, Y: Integer;
112 AreaType: Byte;
113 Direction: Byte;
114 end;
116 TTriggerRec_1 = packed record
117 X, Y: Integer;
118 Width,
119 Height: Word;
120 Enabled: Byte;
121 TexturePanel: Integer;
122 TriggerType: Byte;
123 ActivateType: Byte;
124 Keys: Byte;
125 DATA: Byte128;
126 end;
128 TBlock = packed record
129 BlockType: Byte;
130 Reserved: LongWord;
131 BlockSize: LongWord;
132 end;
134 TTexturesRec1Array = array of TTextureRec_1;
135 TPanelsRec1Array = array of TPanelRec_1;
136 TItemsRec1Array = array of TItemRec_1;
137 TMonsterRec1Array = array of TMonsterRec_1;
138 TAreasRec1Array = array of TAreaRec_1;
139 TTriggersRec1Array = array of TTriggerRec_1;
141 implementation
143 end.