Crossfire Server, Trunk  R20513
Functions
square_spiral.c File Reference

Square-spiral layout generator. More...

#include <stdlib.h>
#include <stdio.h>
#include <global.h>
#include <time.h>
#include <maze_gen.h>
#include <room_gen.h>
#include <random_map.h>
#include <sproto.h>
#include <rproto.h>
Include dependency graph for square_spiral.c:

Go to the source code of this file.

Functions

void find_top_left_corner (char **maze, int *cx, int *cy)
 This starts from within a centered onion layer (or between two layers), and looks up until it finds a wall, and then looks right until it finds a vertical wall, i.e., the corner. More...
 
char ** make_square_spiral_layout (int xsize, int ysize)
 Generates a square-spiral layout. More...
 
char ** map_gen_onion (int xsize, int ysize, int option, int layers)
 Generates an onion layout. More...
 

Detailed Description

Square-spiral layout generator.

Todo:
what does that look like? :)

Definition in file square_spiral.c.

Function Documentation

void find_top_left_corner ( char **  maze,
int *  cx,
int *  cy 
)

This starts from within a centered onion layer (or between two layers), and looks up until it finds a wall, and then looks right until it finds a vertical wall, i.e., the corner.

It sets cx and cy to that. it also starts from cx and cy.

Parameters
mazewhere to look.
cx
cywhere to start from, and detected corner.

Definition at line 53 of file square_spiral.c.

Referenced by make_square_spiral_layout().

Here is the caller graph for this function:

char** make_square_spiral_layout ( int  xsize,
int  ysize 
)

Generates a square-spiral layout.

Parameters
xsize
ysizesize of the layout.
Returns
generated layout.
Todo:
use function in another file for character searching.

Definition at line 78 of file square_spiral.c.

References find_top_left_corner(), make_wall(), map_gen_onion(), OPT_CENTERED, OPT_NO_DOORS, and RANDOM.

Referenced by layoutgen().

Here is the call graph for this function:

Here is the caller graph for this function:

char** map_gen_onion ( int  xsize,
int  ysize,
int  option,
int  layers 
)

Generates an onion layout.

Parameters
xsize
ysizelayout size.
optioncombination of OPT_xxx values.
layersnumber of layers the onion should have.
Returns
layout.

Definition at line 70 of file room_gen_onion.c.

References bottom_centered_onion(), bottom_right_centered_onion(), centered_onion(), OPT_BOTTOM_C, OPT_BOTTOM_R, OPT_CENTERED, OPT_IRR_SPACE, OPT_LINEAR, OPT_WALL_OFF, OPT_WALLS_ONLY, and RANDOM.

Referenced by make_square_spiral_layout().

Here is the call graph for this function:

Here is the caller graph for this function: