Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

dll/bigmap.c File Reference


Detailed Description

Map generator for big levels.

Definition in file bigmap.c.

#include "crogue.h"
#include "dll.h"

Go to the source code of this file.

Data Structures

struct  mark
union  feature_info
struct  feature
struct  vaultdesc

Defines

#define ROOMCONN_RETRIES   2
#define CORRIDOREND_RETRIES   10
#define CORRIDORBRANCH_RETRIES   2
#define ROOMSIZE_MAX_X   8
#define ROOMSIZE_MIN_X   4
#define ROOMSIZE_MAX_Y   8
#define ROOMSIZE_MIN_Y   4
#define CORRIDOR_MAX_LEN   10
#define CORRIDOR_MIN_LEN   4
#define TFLAG_CLEAN   1
#define TFLAG_RECEPTACLE   2
#define TFLAG_JUNCTION   4 /* Later, might put a door here */
#define NUM_TYPES   2
#define FEATURE_ROOM   0
#define FEATURE_CORRIDOR   1
#define FEATURE_VAULT   2
#define NUM_VAULT_TYPES   12
#define VAULTCHAR_BLANK   '/' /* A tile that's not part of the vault */
#define VAULTCHAR_WALL_HARD   '#' /* A 'hard' wall cannot be replaced */
#define VAULTCHAR_WALL_SOFT   '$' /* A 'soft' wall could be connected to a */
#define VAULTCHAR_DOOR   '+'
#define VAULTCHAR_MARK_DOWN   '2' /* These correspond to the num pad */
#define VAULTCHAR_MARK_LEFT   '4'
#define VAULTCHAR_MARK_RIGHT   '6'
#define VAULTCHAR_MARK_UP   '8'
#define DIR_RIGHT   0
#define DIR_UP   1
#define DIR_LEFT   2
#define DIR_DOWN   3

Typedefs

typedef mark mark
typedef feature_info feature_info
typedef feature feature
typedef vaultdesc vaultdesc

Functions

void bigmap_prepass (void)
int bigmap_postpass (void)
void bigmap_fill (void)
int bigmap_place_feature (feature *feature, mark *marks, int *marks_pending)
int bigmap_place_corridor (feature *feature, int dry, mark *marks, int *marks_pending)
int bigmap_place_room (feature *feature, int dry, mark *marks, int *pending)
int bigmap_place_vault (feature *feature, int dry, mark *marks, int *pending)
void rand_feature (feature *feature, mark *m)
void add_mark (int x, int y, int dir, mark *marks, int *pending, int retries)
int mkmap_big (void)
int is_in_bounds (scoord pos)

Variables

const vaultdesc vaults []
scoord directions [4]


Define Documentation

#define CORRIDOR_MAX_LEN   10
 

Definition at line 33 of file bigmap.c.

Referenced by rand_feature().

#define CORRIDOR_MIN_LEN   4
 

Definition at line 34 of file bigmap.c.

Referenced by rand_feature().

#define CORRIDORBRANCH_RETRIES   2
 

Definition at line 28 of file bigmap.c.

Referenced by bigmap_place_corridor().

#define CORRIDOREND_RETRIES   10
 

Definition at line 27 of file bigmap.c.

#define DIR_DOWN   3
 

Definition at line 305 of file bigmap.c.

Referenced by bigmap_place_vault().

#define DIR_LEFT   2
 

Definition at line 304 of file bigmap.c.

Referenced by bigmap_place_vault().

#define DIR_RIGHT   0
 

Definition at line 302 of file bigmap.c.

Referenced by bigmap_place_vault().

#define DIR_UP   1
 

Definition at line 303 of file bigmap.c.

Referenced by bigmap_place_vault().

#define FEATURE_CORRIDOR   1
 

Definition at line 74 of file bigmap.c.

Referenced by rand_feature().

#define FEATURE_ROOM   0
 

Definition at line 73 of file bigmap.c.

Referenced by bigmap_place_feature(), and rand_feature().

#define FEATURE_VAULT   2
 

Definition at line 75 of file bigmap.c.

Referenced by bigmap_place_feature(), and rand_feature().

#define NUM_TYPES   2
 

Definition at line 72 of file bigmap.c.

#define NUM_VAULT_TYPES   12
 

Definition at line 85 of file bigmap.c.

Referenced by rand_feature().

#define ROOMCONN_RETRIES   2
 

Definition at line 26 of file bigmap.c.

Referenced by bigmap_place_vault().

#define ROOMSIZE_MAX_X   8
 

Definition at line 29 of file bigmap.c.

Referenced by rand_feature().

#define ROOMSIZE_MAX_Y   8
 

Definition at line 31 of file bigmap.c.

#define ROOMSIZE_MIN_X   4
 

Definition at line 30 of file bigmap.c.

#define ROOMSIZE_MIN_Y   4
 

Definition at line 32 of file bigmap.c.

Referenced by rand_feature().

#define TFLAG_CLEAN   1
 

Definition at line 36 of file bigmap.c.

Referenced by bigmap_place_corridor(), bigmap_place_room(), bigmap_place_vault(), and bigmap_prepass().

#define TFLAG_JUNCTION   4 /* Later, might put a door here */
 

Definition at line 38 of file bigmap.c.

Referenced by add_mark(), bigmap_place_corridor(), and bigmap_postpass().

#define TFLAG_RECEPTACLE   2
 

Definition at line 37 of file bigmap.c.

Referenced by bigmap_place_corridor().

#define VAULTCHAR_BLANK   '/' /* A tile that's not part of the vault */
 

Definition at line 87 of file bigmap.c.

#define VAULTCHAR_DOOR   '+'
 

Definition at line 94 of file bigmap.c.

#define VAULTCHAR_MARK_DOWN   '2' /* These correspond to the num pad */
 

Definition at line 95 of file bigmap.c.

#define VAULTCHAR_MARK_LEFT   '4'
 

Definition at line 97 of file bigmap.c.

#define VAULTCHAR_MARK_RIGHT   '6'
 

Definition at line 98 of file bigmap.c.

#define VAULTCHAR_MARK_UP   '8'
 

Definition at line 99 of file bigmap.c.

#define VAULTCHAR_WALL_HARD   '#' /* A 'hard' wall cannot be replaced */
 

Definition at line 89 of file bigmap.c.

#define VAULTCHAR_WALL_SOFT   '$' /* A 'soft' wall could be connected to a */
 

Definition at line 91 of file bigmap.c.


Typedef Documentation

typedef struct feature feature
 

Referenced by bigmap_place_corridor(), bigmap_place_room(), bigmap_place_vault(), and rand_feature().

typedef union feature_info feature_info
 

typedef struct mark mark
 

typedef struct vaultdesc vaultdesc
 


Function Documentation

void add_mark int  x,
int  y,
int  dir,
mark marks,
int *  pending,
int  retries
[static]
 

Definition at line 715 of file bigmap.c.

References dir, TFLAG_JUNCTION, and w.

Referenced by bigmap_place_corridor(), and bigmap_place_vault().

void bigmap_fill void   )  [static]
 

Definition at line 375 of file bigmap.c.

int bigmap_place_corridor feature feature,
int  dry,
mark marks,
int *  marks_pending
[static]
 

Definition at line 427 of file bigmap.c.

References add_mark(), CORRIDORBRANCH_RETRIES, directions, feature, tile::flags, is_in_bounds(), nrandom(), world::t, TFLAG_CLEAN, TFLAG_JUNCTION, TFLAG_RECEPTACLE, tile::type, w, scoord::x, and scoord::y.

int bigmap_place_feature feature feature,
mark marks,
int *  marks_pending
[static]
 

Definition at line 404 of file bigmap.c.

References FEATURE_ROOM, and FEATURE_VAULT.

int bigmap_place_room feature feature,
int  dry,
mark marks,
int *  pending
[static]
 

Definition at line 503 of file bigmap.c.

References directions, feature, tile::flags, feature::pos, world::t, TFLAG_CLEAN, w, scoord::x, and scoord::y.

int bigmap_place_vault feature feature,
int  dry,
mark marks,
int *  pending
[static]
 

Definition at line 602 of file bigmap.c.

References add_mark(), vaultdesc::content, DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_UP, directions, feature, tile::flags, is_in_bounds(), ROOMCONN_RETRIES, vaultdesc::size, world::t, TFLAG_CLEAN, tile::type, vaults, w, scoord::x, and scoord::y.

int bigmap_postpass void   )  [static]
 

Definition at line 344 of file bigmap.c.

References tile::flags, make_door(), MAPSIZE_X, nrandom(), world::t, TFLAG_JUNCTION, tile::type, and w.

void bigmap_prepass void   )  [static]
 

Definition at line 335 of file bigmap.c.

References TFLAG_CLEAN, and w.

int is_in_bounds scoord  pos  )  [static]
 

Definition at line 326 of file bigmap.c.

Referenced by bigmap_place_corridor(), and bigmap_place_vault().

int mkmap_big void   ) 
 

Definition at line 318 of file bigmap.c.

Referenced by mkmap_big_front().

void rand_feature feature feature,
mark m
[static]
 

Definition at line 684 of file bigmap.c.

References CORRIDOR_MAX_LEN, CORRIDOR_MIN_LEN, feature::ext, feature, FEATURE_CORRIDOR, FEATURE_ROOM, FEATURE_VAULT, feature_info::length, nrandom(), NUM_VAULT_TYPES, feature_info::room, ROOMSIZE_MAX_X, ROOMSIZE_MIN_Y, feature_info::vault, and vaults.


Variable Documentation

scoord directions[4]
 

Initial value:

    {
        {  1,  0 },
        {  0, -1 },
        { -1,  0 },
        {  0,  1 }
    }

Definition at line 294 of file bigmap.c.

Referenced by bigmap_place_corridor(), bigmap_place_room(), and bigmap_place_vault().

const vaultdesc vaults[]
 

Definition at line 101 of file bigmap.c.

Referenced by bigmap_place_vault(), and rand_feature().


Generated on Thu May 20 13:12:12 2004 for CalcRogue by doxygen 1.3.6