Go to the documentation of this file.
28 static void expand_wall(
char **newlayout,
int i,
int j,
char **
layout,
int xsize,
int ysize);
29 static void expand_door(
char **newlayout,
int i,
int j,
char **
layout,
int xsize,
int ysize);
46 int nxsize = xsize*2-1;
47 int nysize = ysize*2-1;
50 char **newlayout = (
char **)calloc(
sizeof(
char *), nxsize);
51 for (i = 0; i < nxsize; i++) {
52 newlayout[i] = (
char *)calloc(
sizeof(
char), nysize);
55 for (i = 0; i < xsize; i++) {
56 for (j = 0; j < ysize; j++) {
73 for (i = 0; i < xsize; i++) {
96 newlayout[i*2][j*2] =
layout[i][j];
125 if (i+1 < xsize &&
layout[i+1][j] == ch) {
130 if (
layout[i][j+1] == ch) {
133 if (i+1 < xsize &&
layout[i+1][j+1] == ch) {
160 int both_pattern = wall_pattern|door_pattern;
162 newlayout[i*2][j*2] =
'#';
164 if (both_pattern&1) {
166 newlayout[i*2+1][j*2] =
layout[i+1][j];
171 if (both_pattern&2) {
173 newlayout[i*2][j*2+1] =
layout[i][j+1];
176 if (wall_pattern == 7) {
179 newlayout[i*2+1][j*2+1] =
'#';
208 if (wall_pattern&3) {
209 join_pattern = wall_pattern;
211 join_pattern = door_pattern;
214 newlayout[i*2][j*2] =
'D';
216 if (join_pattern&1) {
218 newlayout[i*2+1][j*2] =
'D';
223 if (join_pattern&2) {
225 newlayout[i*2][j*2+1] =
'D';
static void expand_misc(char **newlayout, int i, int j, char **layout)
static void expand_door(char **newlayout, int i, int j, char **layout, int xsize, int ysize)
char ** expand2x(char **layout, int xsize, int ysize)
static void expand_wall(char **newlayout, int i, int j, char **layout, int xsize, int ysize)
static int calc_pattern(char ch, char **layout, int i, int j, int xsize, int ysize)