From 1b911f06c1ea683bd32421f7a0cd002d95ab44cd Mon Sep 17 00:00:00 2001 From: Andriy Shinkarchuck Date: Sun, 24 Jul 2011 19:51:37 +0300 Subject: [PATCH] bmap.c bmap.h moved to repo. Added license notification --- bmap.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bmap.h | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100755 bmap.c create mode 100755 bmap.h diff --git a/bmap.c b/bmap.c new file mode 100755 index 0000000..ccb4404 --- /dev/null +++ b/bmap.c @@ -0,0 +1,61 @@ +/* + Copyright (C) Prikol Software 1996-1997 + Copyright (C) Aleksey Volynskov 1996-1997 + Copyright (C) 2011 + + This file is part of the Doom2D:Rembo project. + + Doom2D:Rembo is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + Doom2D:Rembo is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see or + write to the Free Software Foundation, Inc., + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "glob.h" +#include "view.h" +#include "bmap.h" + +byte fld_need_remap=1; + +byte bmap[FLDH/4][FLDW/4]; + +void BM_mark(obj_t *o,byte f) { + int x,y; + int xs,ys,xe,ye; + + if((xs=(o->x-o->r)>>5)<0) xs=0; + if((xe=(o->x+o->r)>>5)>=FLDW/4) xe=FLDW/4-1; + if((ys=(o->y-o->h)>>5)<0) ys=0; + if((ye=o->y>>5)>=FLDH/4) ye=FLDH/4-1; + for(y=ys;y<=ye;++y) + for(x=xs;x<=xe;++x) + bmap[y][x]|=f; +} + +void BM_clear(byte f) +{ + int x,y; + for(x=0; x 2011 + + This file is part of the Doom2D:Rembo project. + + Doom2D:Rembo is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + Doom2D:Rembo is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see or + write to the Free Software Foundation, Inc., + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// Block map + +#define BM_WALL 1 +#define BM_PLR1 2 +#define BM_PLR2 4 +#define BM_MONSTER 8 + +void BM_clear(byte f); +void BM_mark(obj_t *o,byte f); +void BM_remapfld(void); + +extern byte bmap[FLDH/4][FLDW/4]; +extern byte fld_need_remap; -- 2.29.2