Atrinik Server 2.5
Defines | Functions
random_maps/room_gen_spiral.c File Reference
#include <global.h>
#include <math.h>

Go to the source code of this file.

Defines

#define RANDOM_OPTIONS   0
#define REGULAR_SPIRAL   1
#define FINE_SPIRAL   2
#define FIT_SPIRAL   4
#define MAX_SPIRAL_OPT   8
#define MINDIST   3
#define MAX_FINE   .454545

Functions

int surround_check (char **maze, int i, int j, int xsize, int ysize)
char ** map_gen_spiral (int xsize, int ysize, int option)
void connect_spirals (int xsize, int ysize, int sym, char **layout)

Detailed Description

The spiral room generator.

Definition in file room_gen_spiral.c.


Function Documentation

void connect_spirals ( int  xsize,
int  ysize,
int  sym,
char **  layout 
)

Connects disjoint spirals which may result from the symmetrization process.

Parameters:
xsizeX size of the layout.
ysizeY size of the layout.
symOne of the SYM_xxx values.
layoutLayout to alter.

Definition at line 176 of file room_gen_spiral.c.

char** map_gen_spiral ( int  xsize,
int  ysize,
int  option 
)

Generates a spiral layout.

Parameters:
xsizeX size of the layout.
ysizeY size of the layout.
optionCombination of SPIRAL_xxx values.
Returns:
The generated layout.

Definition at line 69 of file room_gen_spiral.c.

int surround_check ( char **  layout,
int  i,
int  j,
int  Xsize,
int  Ysize 
)

Checks free spots around a spot.

Parameters:
layoutMap layout.
iX coordinate to check.
jY coordinate to check.
XsizeX size of the layout.
YsizeY size of the layout.
Returns:
Combination of the following values:
  • 1: Free space to left,
  • 2: Free space to right,
  • 4: Free space above
  • 8: Free space below

Definition at line 66 of file rogue_layout.c.