Crossfire Server, Trunk
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, int _unused_option, int _unused_layers)
 
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

◆ find_top_left_corner()

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:

◆ make_square_spiral_layout()

char** make_square_spiral_layout ( int  xsize,
int  ysize,
int  _unused_option,
int  _unused_layers 
)

Generates a square-spiral layout.

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

Definition at line 80 of file square_spiral.c.

References find_top_left_corner(), make_wall(), map_gen_onion(), OPT_CENTERED, OPT_NO_DOORS, RANDOM, and nlohmann::detail::void().

Referenced by layoutgen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_gen_onion()

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, CFweardisguise::option, and RANDOM.

Referenced by make_square_spiral_layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: