1 /* Copyright (C) 1996-1997 Aleksey Volynskov
2 * Copyright (C) 2011 Rambo
3 * Copyright (C) 2020 SovietPony
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 byte fld_need_remap
=1;
25 byte bmap
[FLDH
/4][FLDW
/4];
27 void BM_mark(obj_t
*o
,byte f
) {
31 if((xs
=(o
->x
-o
->r
)>>5)<0) xs
=0;
32 if((xe
=(o
->x
+o
->r
)>>5)>=FLDW
/4) xe
=FLDW
/4-1;
33 if((ys
=(o
->y
-o
->h
)>>5)<0) ys
=0;
34 if((ye
=o
->y
>>5)>=FLDH
/4) ye
=FLDH
/4-1;
43 for(x
=0; x
<FLDW
/4; x
++)
44 for (y
=0; y
<FLDH
/4; y
++)
48 void BM_remapfld(void)
54 if (fld
[y
][x
] == 1 || fld
[y
][x
] == 2)
55 bmap
[y
/4][x
/4]|=BM_WALL
;