2 * Copyright (C) Prikol Software 1996-1997
3 * Copyright (C) Aleksey Volynskov 1996-1997
4 * Copyright (C) <ARembo@gmail.com> 2011
6 * This file is part of the Doom2D PSX project.
8 * Doom2D PSX is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Doom2D PSX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/> or
19 * write to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 byte fld_need_remap
= 1;
29 byte bmap
[FLDH
/ 4][FLDW
/ 4];
31 void BM_mark(obj_t
* o
, byte f
) {
35 if ((xs
= (o
->x
- o
->r
) >> 5) < 0)
37 if ((xe
= (o
->x
+ o
->r
) >> 5) >= FLDW
/ 4)
39 if ((ys
= (o
->y
- o
->h
) >> 5) < 0)
41 if ((ye
= o
->y
>> 5) >= FLDH
/ 4)
43 for (y
= ys
; y
<= ye
; ++y
) {
44 for (x
= xs
; x
<= xe
; ++x
)
49 void BM_clear(byte f
) {
52 for (x
= 0; x
< FLDW
/ 4; x
++) {
53 for (y
= 0; y
< FLDH
/ 4; y
++)
58 void BM_remapfld(void) {
62 for (x
= 0; x
< FLDW
; x
++) {
63 for (y
= 0; y
< FLDH
; y
++) {
64 if ((fld
[y
][x
] == 1) || (fld
[y
][x
] == 2))
65 bmap
[y
/ 4][x
/ 4] |= BM_WALL
;