1 /*
2  * Copyright 2011-2012 Arx Libertatis Team (see the AUTHORS file)
3  *
4  * This file is part of Arx Libertatis.
5  *
6  * Arx Libertatis is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Arx Libertatis is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Arx Libertatis.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 /* Based on:
20 ===========================================================================
21 ARX FATALIS GPL Source Code
22 Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company.
23 
24 This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code').
25 
26 Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
27 License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
28 
29 Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
30 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
31 
32 You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code.  If not, see
33 <http://www.gnu.org/licenses/>.
34 
35 In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these
36 additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx
37 Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below.
38 
39 If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o
40 ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
41 ===========================================================================
42 */
43 
44 #ifndef ARX_SCENE_LEVELFORMAT_H
45 #define ARX_SCENE_LEVELFORMAT_H
46 
47 #include "graphics/GraphicsFormat.h"
48 #include "platform/Platform.h"
49 
50 //Fileformat version
51 const f32 DLH_CURRENT_VERSION = 1.44f;
52 
53 
54 #pragma pack(push,1)
55 
56 
57 struct DANAE_LS_HEADER {
58 
59 	f32 version;
60 	char ident[16];
61 	char lastuser[256];
62 	s32 time;
63 	SavedVec3 pos_edit;
64 	SavedAnglef angle_edit;
65 	s32 nb_scn;
66 	s32 nb_inter;
67 	s32 nb_nodes;
68 	s32 nb_nodeslinks;
69 	s32 nb_zones;
70 	s32 lighting;
71 	s32 Bpad[256];
72 	s32 nb_lights;
73 	s32 nb_fogs;
74 
75 	s32 nb_bkgpolys;
76 	s32 nb_ignoredpolys;
77 	s32 nb_childpolys;
78 	s32 nb_paths;
79 	s32 pad[250];
80 	SavedVec3 offset;
81 	f32 fpad[253];
82 	char cpad[4096];
83 	s32 bpad[256];
84 
85 };
86 
87 struct DANAE_LS_SCENE {
88 	char name[512];
89 	s32 pad[16];
90 	f32 fpad[16];
91 };
92 
93 struct DANAE_LS_LIGHTINGHEADER {
94 	s32 nb_values;
95 	s32 ViewMode;
96 	s32 ModeLight;
97 	s32 pad;
98 };
99 
100 struct DANAE_LS_VLIGHTING {
101 	s32 r;
102 	s32 g;
103 	s32 b;
104 };
105 
106 // version 1.003f
107 struct DANAE_LS_LIGHT {
108 	SavedVec3 pos;
109 	SavedColor rgb;
110 	f32 fallstart;
111 	f32 fallend;
112 	f32 intensity;
113 	f32 i;
114 	SavedColor ex_flicker;
115 	f32 ex_radius;
116 	f32 ex_frequency;
117 	f32 ex_size;
118 	f32 ex_speed;
119 	f32 ex_flaresize;
120 	f32 fpadd[24];
121 	s32 extras;
122 	s32 lpadd[31];
123 };
124 
125 struct DANAE_LS_FOG {
126 	SavedVec3 pos;
127 	SavedColor rgb;
128 	f32 size;
129 	s32 special;
130 	f32 scale;
131 	SavedVec3 move;
132 	SavedAnglef angle;
133 	f32 speed;
134 	f32 rotatespeed;
135 	s32 tolive;
136 	s32 blend;
137 	f32 frequency;
138 	f32 fpadd[32];
139 	s32 lpadd[32];
140 	char cpadd[256];
141 };
142 
143 struct DANAE_LS_NODE {
144 	char name[64];
145 	SavedVec3 pos;
146 	s32 pad[16];
147 	f32 fpad[16];
148 };
149 
150 struct DANAE_LS_PATH {
151 	char name[64];
152 	s16 idx;
153 	s16 flags;
154 	SavedVec3 initpos;
155 	SavedVec3 pos;
156 	s32 nb_pathways;
157 	SavedColor rgb;
158 	f32 farclip;
159 	f32 reverb;
160 	f32 amb_max_vol;
161 	f32 fpadd[26];
162 	s32 height;
163 	s32 lpadd[31];
164 	char ambiance[128];
165 	char cpadd[128];
166 };
167 
168 struct DANAE_LS_PATHWAYS {
169 	SavedVec3 rpos;
170 	s32 flag;
171 	u32 time;
172 	f32 fpadd[2];
173 	s32 lpadd[2];
174 	char cpadd[32];
175 };
176 
177 // Lighting File Header
178 struct DANAE_LLF_HEADER {
179 	f32 version;
180 	char ident[16];
181 	char lastuser[256];
182 	s32 time;
183 	s32 nb_lights;
184 	s32 nb_Shadow_Polys;
185 	s32 nb_IGNORED_Polys;
186 	s32 nb_bkgpolys;
187 	s32 pad[256];
188 	f32 fpad[256];
189 	char cpad[4096];
190 	s32 bpad[256];
191 };
192 
193 struct DANAE_LS_INTER {
194 	char name[512];
195 	SavedVec3 pos;
196 	SavedAnglef angle;
197 	s32 ident;
198 	s32 flags;
199 	s32 pad[14];
200 	f32 fpad[16];
201 };
202 
203 const size_t SAVED_MAX_LINKS = 12;
204 
205 
206 #pragma pack(pop)
207 
208 
209 #endif // ARX_SCENE_LEVELFORMAT_H
210