Crossfire Server, Branches 1.12  R18729
square_spiral.c File Reference
#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)
 
char ** make_square_spiral_layout (int xsize, int ysize)
 
char ** map_gen_onion (int xsize, int ysize, int option, int layers)
 

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 68 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 90 of file square_spiral.c.

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

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 85 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, and OPT_WALLS_ONLY.

Referenced by make_square_spiral_layout().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: