home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d529
/
townmaze.lha
/
TownMaze
/
src.lzh
/
cleanupmap.c
next >
Wrap
C/C++ Source or Header
|
1991-08-04
|
937b
|
43 lines
/*
** cleanupmap.c Copyright 1991 Kent Paul Dolan,
** Mountain View, CA, USA 94039-0755
**
** Written to satisfy an inquiry on USENet's rec.games.programmer newsgroup.
** May be freely used or modified in any non-commercial work. Copyrighted
** only to prevent patenting by someone else.
*/
#include <stdio.h>
#include "townmaze.h"
#include "townproto.h"
#ifdef __STDC__
void cleanupmap()
#else
int cleanupmap()
#endif
{
/*
** Isolated "posts" of wall segments are left by the normal map making
** process; clean them up to make nice open courtyards.
*/
int i, j;
#if PROGRESS
fprintf(stderr,"Clean up map ");
#endif
for (i = 4; i < (mazeheight - 4); i += 2)
for (j = 4; j < (mazewidth - 4); j += 2)
if ( (cmaze[i-1][j] == BLANK)
&& (cmaze[i][j+1] == BLANK)
&& (cmaze[i+1][j] == BLANK)
&& (cmaze[i][j-1] == BLANK)
)
cmaze[i][j] = BLANK;
return;
}