51 0, 1, 0, -1, -1, 0, 1, 0,
53 0, 2, 0, -2, -1, 2, 1, 2,
54 -1, -2, 1, -2, -1, 1, 1, 1,
55 -1, -1, 1, -1, -2, 1, 2, 1,
56 -2, -1, 2, -1, -2, 0, 2, 0,
58 0, 3, 0, -3, -1, 3, 1, 3,
59 -1, -3, 1, -3, -2, 3, 2, 3,
60 -2, -3, 2, -3, -2, 2, 2, 2,
61 -2, -2, 2, -2, -3, 2, 3, 2,
62 -3, -2, 3, -2, -3, 1, 3, 1,
63 -3, -1, 3, -1, -3, 0, 3, 0,
65 0, 4, 0, -4, -1, 4, 1, 4,
66 -1, -4, 1, -4, -2, 4, 2, 4,
67 -2, -4, 2, -4, -3, 4, 3, 4,
68 -3, -4, 3, -4, -3, 3, 3, 3,
69 -3, -3, 3, -3, -4, 3, 4, 3,
70 -4, -3, 4, -3, -4, 2, 4, 2,
71 -4, -2, 4, -2, -4, 1, 4, 1,
72 -4, -1, 4, -1, -4, 0, 4, 0,
74 0, 5, 0, -5, -1, 5, 1, 5,
75 -1, -5, 1, -5, -2, 5, 2, 5,
76 -2, -5, 2, -5, -3, 5, 3, 5,
77 -3, -5, 3, -5, -4, 5, 4, 5,
78 -4, -5, 4, -5, -4, 4, 4, 4,
79 -4, -4, 4, -4, -5, 4, 5, 4,
80 -5, -4, 5, -4, -5, 3, 5, 3,
81 -5, -3, 5, -3, -5, 2, 5, 2,
82 -5, -2, 5, -2, -5, 1, 5, 1,
83 -5, -1, 5, -1, -5, 0, 5, 0,
85 0, 6, 0, -6, -1, 6, 1, 6,
86 -1, -6, 1, -6, -2, 6, 2, 6,
87 -2, -6, 2, -6, -3, 6, 3, 6,
88 -3, -6, 3, -6, -4, 6, 4, 6,
89 -4, -6, 4, -6, -5, 6, 5, 6,
90 -5, -6, 5, -6, -5, 5, 5, 5,
91 -5, -5, 5, -5, -6, 5, 6, 5,
92 -6, -5, 6, -5, -6, 4, 6, 4,
93 -6, -4, 6, -4, -6, 3, 6, 3,
94 -6, -3, 6, -3, -6, 2, 6, 2,
95 -6, -2, 6, -2, -6, 1, 6, 1,
96 -6, -1, 6, -1, -6, 0, 6, 0,
98 0, 7, 0, -7, -1, 7, 1, 7,
99 -1, -7, 1, -7, -2, 7, 2, 7,
100 -2, -7, 2, -7, -3, 7, 3, 7,
101 -3, -7, 3, -7, -4, 7, 4, 7,
102 -4, -7, 4, -7, -5, 7, 5, 7,
103 -5, -7, 5, -7, -6, 7, 6, 7,
104 -6, -7, 6, -7, -6, 6, 6, 6,
105 -6, -6, 6, -6, -7, 6, 7, 6,
106 -7, -6, 7, -6, -7, 5, 7, 5,
107 -7, -5, 7, -5, -7, 4, 7, 4,
108 -7, -4, 7, -4, -7, 3, 7, 3,
109 -7, -3, 7, -3, -7, 2, 7, 2,
110 -7, -2, 7, -2, -7, 1, 7, 1,
111 -7, -1, 7, -1, -7, 0, 7, 0,
113 0, 8, 0, -8, -1, 8, 1, 8,
114 -1, -8, 1, -8, -2, 8, 2, 8,
115 -2, -8, 2, -8, -3, 8, 3, 8,
116 -3, -8, 3, -8, -4, 8, 4, 8,
117 -4, -8, 4, -8, -5, 8, 5, 8,
118 -5, -8, 5, -8, -6, 8, 6, 8,
119 -6, -8, 6, -8, -7, 8, 7, 8,
120 -7, -8, 7, -8, -7, 7, 7, 7,
121 -7, -7, 7, -7, -8, 7, 8, 7,
122 -8, -7, 8, -7, -8, 6, 8, 6,
123 -8, -6, 8, -6, -8, 5, 8, 5,
124 -8, -5, 8, -5, -8, 4, 8, 4,
125 -8, -4, 8, -4, -8, 3, 8, 3,
126 -8, -3, 8, -3, -8, 2, 8, 2,
127 -8, -2, 8, -2, -8, 1, 8, 1,
128 -8, -1, 8, -1, -8, 0, 8, 0,
130 0, 9, 0, -9, -1, 9, 1, 9,
131 -1, -9, 1, -9, -2, 9, 2, 9,
132 -2, -9, 2, -9, -3, 9, 3, 9,
133 -3, -9, 3, -9, -4, 9, 4, 9,
134 -4, -9, 4, -9, -5, 9, 5, 9,
135 -5, -9, 5, -9, -6, 9, 6, 9,
136 -6, -9, 6, -9, -7, 9, 7, 9,
137 -7, -9, 7, -9, -8, 9, 8, 9,
138 -8, -9, 8, -9, -8, 8, 8, 8,
139 -8, -8, 8, -8, -9, 8, 9, 8,
140 -9, -8, 9, -8, -9, 7, 9, 7,
141 -9, -7, 9, -7, -9, 6, 9, 6,
142 -9, -6, 9, -6, -9, 5, 9, 5,
143 -9, -5, 9, -5, -9, 4, 9, 4,
144 -9, -4, 9, -4, -9, 3, 9, 3,
145 -9, -3, 9, -3, -9, 2, 9, 2,
146 -9, -2, 9, -2, -9, 1, 9, 1,
147 -9, -1, 9, -1, -9, 0, 9, 0,
149 0, 10, 0, -10, -1, 10, 1, 10,
150 -1, -10, 1, -10, -2, 10, 2, 10,
151 -2, -10, 2, -10, -3, 10, 3, 10,
152 -3, -10, 3, -10, -4, 10, 4, 10,
153 -4, -10, 4, -10, -5, 10, 5, 10,
154 -5, -10, 5, -10, -6, 10, 6, 10,
155 -6, -10, 6, -10, -7, 10, 7, 10,
156 -7, -10, 7, -10, -8, 10, 8, 10,
157 -8, -10, 8, -10, -9, 10, 9, 10,
158 -9, -10, 9, -10, -9, 9, 9, 9,
159 -9, -9, 9, -9, -10, 9, 10, 9,
160 -10, -9, 10, -9, -10, 8, 10, 8,
161 -10, -8, 10, -8, -10, 7, 10, 7,
162 -10, -7, 10, -7, -10, 6, 10, 6,
163 -10, -6, 10, -6, -10, 5, 10, 5,
164 -10, -5, 10, -5, -10, 4, 10, 4,
165 -10, -4, 10, -4, -10, 3, 10, 3,
166 -10, -3, 10, -3, -10, 2, 10, 2,
167 -10, -2, 10, -2, -10, 1, 10, 1,
168 -10, -1, 10, -1, -10, 0, 10, 0,
170 0, 11, 0, -11, -1, 11, 1, 11,
171 -1, -11, 1, -11, -2, 11, 2, 11,
172 -2, -11, 2, -11, -3, 11, 3, 11,
173 -3, -11, 3, -11, -4, 11, 4, 11,
174 -4, -11, 4, -11, -5, 11, 5, 11,
175 -5, -11, 5, -11, -6, 11, 6, 11,
176 -6, -11, 6, -11, -7, 11, 7, 11,
177 -7, -11, 7, -11, -8, 11, 8, 11,
178 -8, -11, 8, -11, -9, 11, 9, 11,
179 -9, -11, 9, -11, -10, 11, 10, 11,
180 -10, -11, 10, -11, -10, 10, 10, 10,
181 -10, -10, 10, -10, -11, 10, 11, 10,
182 -11, -10, 11, -10, -11, 9, 11, 9,
183 -11, -9, 11, -9, -11, 8, 11, 8,
184 -11, -8, 11, -8, -11, 7, 11, 7,
185 -11, -7, 11, -7, -11, 6, 11, 6,
186 -11, -6, 11, -6, -11, 5, 11, 5,
187 -11, -5, 11, -5, -11, 4, 11, 4,
188 -11, -4, 11, -4, -11, 3, 11, 3,
189 -11, -3, 11, -3, -11, 2, 11, 2,
190 -11, -2, 11, -2, -11, 1, 11, 1,
191 -11, -1, 11, -1, -11, 0, 11, 0,
193 0, 12, 0, -12, -1, 12, 1, 12,
194 -1, -12, 1, -12, -2, 12, 2, 12,
195 -2, -12, 2, -12, -3, 12, 3, 12,
196 -3, -12, 3, -12, -4, 12, 4, 12,
197 -4, -12, 4, -12, -5, 12, 5, 12,
198 -5, -12, 5, -12, -6, 12, 6, 12,
199 -6, -12, 6, -12, -7, 12, 7, 12,
200 -7, -12, 7, -12, -8, 12, 8, 12,
201 -8, -12, 8, -12, -9, 12, 9, 12,
202 -9, -12, 9, -12, -10, 12, 10, 12,
203 -10, -12, 10, -12, -11, 12, 11, 12,
204 -11, -12, 11, -12, -11, 11, 11, 11,
205 -11, -11, 11, -11, -12, 11, 12, 11,
206 -12, -11, 12, -11, -12, 10, 12, 10,
207 -12, -10, 12, -10, -12, 9, 12, 9,
208 -12, -9, 12, -9, -12, 8, 12, 8,
209 -12, -8, 12, -8, -12, 7, 12, 7,
210 -12, -7, 12, -7, -12, 6, 12, 6,
211 -12, -6, 12, -6, -12, 5, 12, 5,
212 -12, -5, 12, -5, -12, 4, 12, 4,
213 -12, -4, 12, -4, -12, 3, 12, 3,
214 -12, -3, 12, -3, -12, 2, 12, 2,
215 -12, -2, 12, -2, -12, 1, 12, 1,
216 -12, -1, 12, -1, -12, 0, 12, 0,
218 0, 13, 0, -13, -1, 13, 1, 13,
219 -1, -13, 1, -13, -2, 13, 2, 13,
220 -2, -13, 2, -13, -3, 13, 3, 13,
221 -3, -13, 3, -13, -4, 13, 4, 13,
222 -4, -13, 4, -13, -5, 13, 5, 13,
223 -5, -13, 5, -13, -6, 13, 6, 13,
224 -6, -13, 6, -13, -7, 13, 7, 13,
225 -7, -13, 7, -13, -8, 13, 8, 13,
226 -8, -13, 8, -13, -9, 13, 9, 13,
227 -9, -13, 9, -13, -10, 13, 10, 13,
228 -10, -13, 10, -13, -11, 13, 11, 13,
229 -11, -13, 11, -13, -12, 13, 12, 13,
230 -12, -13, 12, -13, -12, 12, 12, 12,
231 -12, -12, 12, -12, -13, 12, 13, 12,
232 -13, -12, 13, -12, -13, 11, 13, 11,
233 -13, -11, 13, -11, -13, 10, 13, 10,
234 -13, -10, 13, -10, -13, 9, 13, 9,
235 -13, -9, 13, -9, -13, 8, 13, 8,
236 -13, -8, 13, -8, -13, 7, 13, 7,
237 -13, -7, 13, -7, -13, 6, 13, 6,
238 -13, -6, 13, -6, -13, 5, 13, 5,
239 -13, -5, 13, -5, -13, 4, 13, 4,
240 -13, -4, 13, -4, -13, 3, 13, 3,
241 -13, -3, 13, -3, -13, 2, 13, 2,
242 -13, -2, 13, -2, -13, 1, 13, 1,
243 -13, -1, 13, -1, -13, 0, 13, 0,
245 0, 14, 0, -14, -1, 14, 1, 14,
246 -1, -14, 1, -14, -2, 14, 2, 14,
247 -2, -14, 2, -14, -3, 14, 3, 14,
248 -3, -14, 3, -14, -4, 14, 4, 14,
249 -4, -14, 4, -14, -5, 14, 5, 14,
250 -5, -14, 5, -14, -6, 14, 6, 14,
251 -6, -14, 6, -14, -7, 14, 7, 14,
252 -7, -14, 7, -14, -8, 14, 8, 14,
253 -8, -14, 8, -14, -9, 14, 9, 14,
254 -9, -14, 9, -14, -10, 14, 10, 14,
255 -10, -14, 10, -14, -11, 14, 11, 14,
256 -11, -14, 11, -14, -12, 14, 12, 14,
257 -12, -14, 12, -14, -13, 14, 13, 14,
258 -13, -14, 13, -14, -13, 13, 13, 13,
259 -13, -13, 13, -13, -14, 13, 14, 13,
260 -14, -13, 14, -13, -14, 12, 14, 12,
261 -14, -12, 14, -12, -14, 11, 14, 11,
262 -14, -11, 14, -11, -14, 10, 14, 10,
263 -14, -10, 14, -10, -14, 9, 14, 9,
264 -14, -9, 14, -9, -14, 8, 14, 8,
265 -14, -8, 14, -8, -14, 7, 14, 7,
266 -14, -7, 14, -7, -14, 6, 14, 6,
267 -14, -6, 14, -6, -14, 5, 14, 5,
268 -14, -5, 14, -5, -14, 4, 14, 4,
269 -14, -4, 14, -4, -14, 3, 14, 3,
270 -14, -3, 14, -3, -14, 2, 14, 2,
271 -14, -2, 14, -2, -14, 1, 14, 1,
272 -14, -1, 14, -1, -14, 0, 14, 0,
274 0, 15, 0, -15, -1, 15, 1, 15,
275 -1, -15, 1, -15, -2, 15, 2, 15,
276 -2, -15, 2, -15, -3, 15, 3, 15,
277 -3, -15, 3, -15, -4, 15, 4, 15,
278 -4, -15, 4, -15, -5, 15, 5, 15,
279 -5, -15, 5, -15, -6, 15, 6, 15,
280 -6, -15, 6, -15, -7, 15, 7, 15,
281 -7, -15, 7, -15, -8, 15, 8, 15,
282 -8, -15, 8, -15, -9, 15, 9, 15,
283 -9, -15, 9, -15, -10, 15, 10, 15,
284 -10, -15, 10, -15, -11, 15, 11, 15,
285 -11, -15, 11, -15, -12, 15, 12, 15,
286 -12, -15, 12, -15, -13, 15, 13, 15,
287 -13, -15, 13, -15, -14, 15, 14, 15,
288 -14, -15, 14, -15, -14, 14, 14, 14,
289 -14, -14, 14, -14, -15, 14, 15, 14,
290 -15, -14, 15, -14, -15, 13, 15, 13,
291 -15, -13, 15, -13, -15, 12, 15, 12,
292 -15, -12, 15, -12, -15, 11, 15, 11,
293 -15, -11, 15, -11, -15, 10, 15, 10,
294 -15, -10, 15, -10, -15, 9, 15, 9,
295 -15, -9, 15, -9, -15, 8, 15, 8,
296 -15, -8, 15, -8, -15, 7, 15, 7,
297 -15, -7, 15, -7, -15, 6, 15, 6,
298 -15, -6, 15, -6, -15, 5, 15, 5,
299 -15, -5, 15, -5, -15, 4, 15, 4,
300 -15, -4, 15, -4, -15, 3, 15, 3,
301 -15, -3, 15, -3, -15, 2, 15, 2,
302 -15, -2, 15, -2, -15, 1, 15, 1,
303 -15, -1, 15, -1, -15, 0, 15, 0,
305 0, 16, 0, -16, -1, 16, 1, 16,
306 -1, -16, 1, -16, -2, 16, 2, 16,
307 -2, -16, 2, -16, -3, 16, 3, 16,
308 -3, -16, 3, -16, -4, 16, 4, 16,
309 -4, -16, 4, -16, -5, 16, 5, 16,
310 -5, -16, 5, -16, -6, 16, 6, 16,
311 -6, -16, 6, -16, -7, 16, 7, 16,
312 -7, -16, 7, -16, -8, 16, 8, 16,
313 -8, -16, 8, -16, -9, 16, 9, 16,
314 -9, -16, 9, -16, -10, 16, 10, 16,
315 -10, -16, 10, -16, -11, 16, 11, 16,
316 -11, -16, 11, -16, -12, 16, 12, 16,
317 -12, -16, 12, -16, -13, 16, 13, 16,
318 -13, -16, 13, -16, -14, 16, 14, 16,
319 -14, -16, 14, -16, -15, 16, 15, 16,
320 -15, -16, 15, -16, -15, 15, 15, 15,
321 -15, -15, 15, -15, -16, 15, 16, 15,
322 -16, -15, 16, -15, -16, 14, 16, 14,
323 -16, -14, 16, -14, -16, 13, 16, 13,
324 -16, -13, 16, -13, -16, 12, 16, 12,
325 -16, -12, 16, -12, -16, 11, 16, 11,
326 -16, -11, 16, -11, -16, 10, 16, 10,
327 -16, -10, 16, -10, -16, 9, 16, 9,
328 -16, -9, 16, -9, -16, 8, 16, 8,
329 -16, -8, 16, -8, -16, 7, 16, 7,
330 -16, -7, 16, -7, -16, 6, 16, 6,
331 -16, -6, 16, -6, -16, 5, 16, 5,
332 -16, -5, 16, -5, -16, 4, 16, 4,
333 -16, -4, 16, -4, -16, 3, 16, 3,
334 -16, -3, 16, -3, -16, 2, 16, 2,
335 -16, -2, 16, -2, -16, 1, 16, 1,
336 -16, -1, 16, -1, -16, 0, 16, 0,
338 0, 17, 0, -17, -1, 17, 1, 17,
339 -1, -17, 1, -17, -2, 17, 2, 17,
340 -2, -17, 2, -17, -3, 17, 3, 17,
341 -3, -17, 3, -17, -4, 17, 4, 17,
342 -4, -17, 4, -17, -5, 17, 5, 17,
343 -5, -17, 5, -17, -6, 17, 6, 17,
344 -6, -17, 6, -17, -7, 17, 7, 17,
345 -7, -17, 7, -17, -8, 17, 8, 17,
346 -8, -17, 8, -17, -9, 17, 9, 17,
347 -9, -17, 9, -17, -10, 17, 10, 17,
348 -10, -17, 10, -17, -11, 17, 11, 17,
349 -11, -17, 11, -17, -12, 17, 12, 17,
350 -12, -17, 12, -17, -13, 17, 13, 17,
351 -13, -17, 13, -17, -14, 17, 14, 17,
352 -14, -17, 14, -17, -15, 17, 15, 17,
353 -15, -17, 15, -17, -16, 17, 16, 17,
354 -16, -17, 16, -17, -16, 16, 16, 16,
355 -16, -16, 16, -16, -17, 16, 17, 16,
356 -17, -16, 17, -16, -17, 15, 17, 15,
357 -17, -15, 17, -15, -17, 14, 17, 14,
358 -17, -14, 17, -14, -17, 13, 17, 13,
359 -17, -13, 17, -13, -17, 12, 17, 12,
360 -17, -12, 17, -12, -17, 11, 17, 11,
361 -17, -11, 17, -11, -17, 10, 17, 10,
362 -17, -10, 17, -10, -17, 9, 17, 9,
363 -17, -9, 17, -9, -17, 8, 17, 8,
364 -17, -8, 17, -8, -17, 7, 17, 7,
365 -17, -7, 17, -7, -17, 6, 17, 6,
366 -17, -6, 17, -6, -17, 5, 17, 5,
367 -17, -5, 17, -5, -17, 4, 17, 4,
368 -17, -4, 17, -4, -17, 3, 17, 3,
369 -17, -3, 17, -3, -17, 2, 17, 2,
370 -17, -2, 17, -2, -17, 1, 17, 1,
371 -17, -1, 17, -1, -17, 0, 17, 0,
373 0, 18, 0, -18, -1, 18, 1, 18,
374 -1, -18, 1, -18, -2, 18, 2, 18,
375 -2, -18, 2, -18, -3, 18, 3, 18,
376 -3, -18, 3, -18, -4, 18, 4, 18,
377 -4, -18, 4, -18, -5, 18, 5, 18,
378 -5, -18, 5, -18, -6, 18, 6, 18,
379 -6, -18, 6, -18, -7, 18, 7, 18,
380 -7, -18, 7, -18, -8, 18, 8, 18,
381 -8, -18, 8, -18, -9, 18, 9, 18,
382 -9, -18, 9, -18, -10, 18, 10, 18,
383 -10, -18, 10, -18, -11, 18, 11, 18,
384 -11, -18, 11, -18, -12, 18, 12, 18,
385 -12, -18, 12, -18, -13, 18, 13, 18,
386 -13, -18, 13, -18, -14, 18, 14, 18,
387 -14, -18, 14, -18, -15, 18, 15, 18,
388 -15, -18, 15, -18, -16, 18, 16, 18,
389 -16, -18, 16, -18, -17, 18, 17, 18,
390 -17, -18, 17, -18, -17, 17, 17, 17,
391 -17, -17, 17, -17, -18, 17, 18, 17,
392 -18, -17, 18, -17, -18, 16, 18, 16,
393 -18, -16, 18, -16, -18, 15, 18, 15,
394 -18, -15, 18, -15, -18, 14, 18, 14,
395 -18, -14, 18, -14, -18, 13, 18, 13,
396 -18, -13, 18, -13, -18, 12, 18, 12,
397 -18, -12, 18, -12, -18, 11, 18, 11,
398 -18, -11, 18, -11, -18, 10, 18, 10,
399 -18, -10, 18, -10, -18, 9, 18, 9,
400 -18, -9, 18, -9, -18, 8, 18, 8,
401 -18, -8, 18, -8, -18, 7, 18, 7,
402 -18, -7, 18, -7, -18, 6, 18, 6,
403 -18, -6, 18, -6, -18, 5, 18, 5,
404 -18, -5, 18, -5, -18, 4, 18, 4,
405 -18, -4, 18, -4, -18, 3, 18, 3,
406 -18, -3, 18, -3, -18, 2, 18, 2,
407 -18, -2, 18, -2, -18, 1, 18, 1,
408 -18, -1, 18, -1, -18, 0, 18, 0
435 { 1, 0, 2, 0, 3, 0, 4, 0, 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 1, 1, 2, 2, 2, 2, 2, 3, 3 },
477 { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3 },
478 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 }
482 BYTE
RadiusAdj[23] = { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 4, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0 };
484 void RotateRadius(
int *x,
int *y,
int *dx,
int *dy,
int *lx,
int *ly,
int *bx,
int *by)
513 int x, y, v, xoff, yoff, mult, radius_block;
514 int min_x, max_x, min_y, max_y;
515 int dist_x, dist_y, light_x, light_y, block_x, block_y, temp_x, temp_y;
540 if (nXPos - 15 < 0) {
550 if (nYPos - 15 < 0) {
561 if (nXPos >= 0 && nXPos < MAXDUNX && nYPos >= 0 && nYPos <
MAXDUNY) {
565 mult = xoff + 8 * yoff;
566 for (y = 0; y < min_y; y++) {
567 for (x = 1; x < max_x; x++) {
569 if (radius_block < 128) {
573 if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y <
MAXDUNY) {
574 if (v <
dLight[temp_x][temp_y]) {
575 dLight[temp_x][temp_y] = v;
581 RotateRadius(&xoff, &yoff, &dist_x, &dist_y, &light_x, &light_y, &block_x, &block_y);
582 mult = xoff + 8 * yoff;
583 for (y = 0; y < max_y; y++) {
584 for (x = 1; x < max_x; x++) {
585 radius_block =
lightblock[mult][y + block_y][x + block_x];
586 if (radius_block < 128) {
590 if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y <
MAXDUNY) {
591 if (v <
dLight[temp_x][temp_y]) {
592 dLight[temp_x][temp_y] = v;
598 RotateRadius(&xoff, &yoff, &dist_x, &dist_y, &light_x, &light_y, &block_x, &block_y);
599 mult = xoff + 8 * yoff;
600 for (y = 0; y < max_y; y++) {
601 for (x = 1; x < min_x; x++) {
602 radius_block =
lightblock[mult][y + block_y][x + block_x];
603 if (radius_block < 128) {
607 if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y <
MAXDUNY) {
608 if (v <
dLight[temp_x][temp_y]) {
609 dLight[temp_x][temp_y] = v;
615 RotateRadius(&xoff, &yoff, &dist_x, &dist_y, &light_x, &light_y, &block_x, &block_y);
616 mult = xoff + 8 * yoff;
617 for (y = 0; y < min_y; y++) {
618 for (x = 1; x < min_x; x++) {
619 radius_block =
lightblock[mult][y + block_y][x + block_x];
620 if (radius_block < 128) {
624 if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y <
MAXDUNY) {
625 if (v <
dLight[temp_x][temp_y]) {
626 dLight[temp_x][temp_y] = v;
636 int x, y, min_x, min_y, max_x, max_y;
639 min_y = nYPos - nRadius;
640 max_y = nYPos + nRadius;
641 min_x = nXPos - nRadius;
642 max_x = nXPos + nRadius;
657 for (y = min_y; y < max_y; y++) {
658 for (x = min_x; x < max_x; x++) {
659 if (x >= 0 && x < MAXDUNX && y >= 0 && y <
MAXDUNY) {
668 int i, j, x1, y1, x2, y2;
671 y1 = nYPos - nRadius;
672 y2 = nYPos + nRadius;
673 x1 = nXPos - nRadius;
674 x2 = nXPos + nRadius;
689 for (i = x1; i < x2; i++) {
690 for (j = y1; j < y2; j++) {
696 void DoVision(
int nXPos,
int nYPos,
int nRadius, BOOL doautomap, BOOL visible)
699 int nCrawlX, nCrawlY, nLineLen, nTrans;
700 int j, k, v, x1adj, x2adj, y1adj, y2adj;
702 if (nXPos >= 0 && nXPos <= MAXDUNX && nYPos >= 0 && nYPos <=
MAXDUNY) {
704 if (
dFlags[nXPos][nYPos] >= 0) {
715 for (v = 0; v < 4; v++) {
716 for (j = 0; j < 23; j++) {
717 nBlockerFlag = FALSE;
719 for (k = 0; k < nLineLen && !nBlockerFlag; k += 2) {
758 if (nCrawlX >= 0 && nCrawlX < MAXDUNX && nCrawlY >= 0 && nCrawlY <
MAXDUNY) {
760 if ((x1adj + nCrawlX >= 0 && x1adj + nCrawlX < MAXDUNX && y1adj + nCrawlY >= 0 && y1adj + nCrawlY <
MAXDUNY
762 || (x2adj + nCrawlX >= 0 && x2adj + nCrawlX < MAXDUNX && y2adj + nCrawlY >= 0 && y2adj + nCrawlY <
MAXDUNY
765 if (
dFlags[nCrawlX][nCrawlY] >= 0) {
800 int i, j, k, l, lights, shade, l1, l2, cnt, rem, div;
815 for (i = 0; i < lights; i++) {
817 for (j = 0; j < 8; j++) {
818 col = 16 * j + shade;
820 for (k = 0; k < 16; k++) {
821 if (k != 0 || j != 0) {
832 for (j = 16; j < 20; j++) {
833 col = 8 * j + (shade >> 1);
835 for (k = 0; k < 8; k++) {
845 for (j = 10; j < 16; j++) {
846 col = 16 * j + shade;
848 for (k = 0; k < 16; k++) {
869 for (i = 0; i < 256; i++) {
875 for (i = 0; i < lights; i++) {
883 for (j = 1; j < 16; j++) {
886 if (l2 > l1 && j < 15) {
898 for (j = 1; j <= 15; j++) {
901 for (j = 15; j > 0; j--) {
908 for (j = 0; j < 31; j++) {
915 for (i = 0; i < 256; i++) {
921 for (i = 0; i < 256; i++) {
926 for (i = 0; i < 8; i++) {
927 for (col = 226; col < 239; col++) {
928 if (i != 0 || col != 226) {
938 for (i = 0; i < 4; i++) {
940 for (j = 224; j < 239; j += 2) {
945 for (i = 0; i < 6; i++) {
946 for (col = 224; col < 239; col++) {
952 for (k = 0; k < 16; k++) {
953 for (l = 0; l < 128; l++) {
954 if (l > (k + 1) * 8) {
957 lightradius[k][l] = l * 15.0 / ((k + 1) * 8.0) + 0.5;
962 for (i = 0; i < 8; i++) {
963 for (j = 0; j < 8; j++) {
964 for (k = 0; k < 16; k++) {
965 for (l = 0; l < 16; l++) {
966 fs = (BYTE)sqrt((8 * l - j) * (8 * l - j) + (8 * k - i) * (8 * k - i));
980 void ToggleLighting()
1288 for (j = 0; j < l; j++) {
1291 for (i = 0; i < 30; i++) {