Defines | Functions | Variables

mkmap.c File Reference

#include "hack.h"
#include "sp_lev.h"
Include dependency graph for mkmap.c:

Defines

#define HEIGHT   (ROWNO - 1)
#define WIDTH   (COLNO - 2)
#define new_loc(i, j)   *(new_locations+ ((j)*(WIDTH+1)) + (i))
#define N_P1_ITER   1
#define N_P2_ITER   1
#define N_P3_ITER   2

Functions

STATIC_DCL void FDECL (init_map,(SCHAR_P))
STATIC_DCL void FDECL (init_fill,(SCHAR_P, SCHAR_P))
STATIC_DCL schar FDECL (get_map,(int, int, SCHAR_P))
STATIC_DCL void FDECL (pass_one,(SCHAR_P, SCHAR_P))
STATIC_DCL void FDECL (pass_two,(SCHAR_P, SCHAR_P))
STATIC_DCL void FDECL (pass_three,(SCHAR_P, SCHAR_P))
STATIC_DCL void NDECL (wallify_map)
STATIC_DCL void FDECL (join_map,(SCHAR_P, SCHAR_P))
STATIC_DCL void FDECL (finish_map,(SCHAR_P, SCHAR_P, XCHAR_P, XCHAR_P))
STATIC_DCL void FDECL (remove_room,(unsigned))
STATIC_DCL void FDECL (backfill,(SCHAR_P, SCHAR_P))
void FDECL (mkmap,(lev_init *))
STATIC_OVL void init_map (schar bg_typ)
STATIC_OVL void backfill (schar bg_typ, schar filler)
STATIC_OVL void init_fill (schar bg_typ, schar fg_typ)
STATIC_OVL schar get_map (int col, int row, schar bg_typ)
STATIC_OVL void pass_one (schar bg_typ, schar fg_typ)
STATIC_OVL void pass_two (schar bg_typ, schar fg_typ)
STATIC_OVL void pass_three (schar bg_typ, schar fg_typ)
void flood_fill_rm (int sx, int sy, int rmno, boolean lit, boolean anyroom)
STATIC_OVL void wallify_map ()
STATIC_OVL void join_map (schar bg_typ, schar fg_typ)
STATIC_OVL void finish_map (schar fg_typ, schar bg_typ, boolean lit, boolean walled)
void remove_rooms (int lx, int ly, int hx, int hy)
STATIC_OVL void remove_room (unsigned roomno)
void mkmap (lev_init *init_lev)

Variables

char * new_locations
int min_rx
int max_rx
int min_ry
int max_ry
static int n_loc_filled
static int dirs [16]

Define Documentation

#define HEIGHT   (ROWNO - 1)
#define N_P1_ITER   1

Referenced by mkmap().

#define N_P2_ITER   1

Referenced by mkmap().

#define N_P3_ITER   2

Referenced by mkmap().

#define new_loc (   i,
 
)    *(new_locations+ ((j)*(WIDTH+1)) + (i))

Referenced by pass_three(), and pass_two().

#define WIDTH   (COLNO - 2)

Function Documentation

STATIC_OVL void backfill ( schar  bg_typ,
schar  filler 
)

References COLNO, LAVAPOOL, levl, MAX_TYPE, and ROWNO.

Referenced by mkmap().

Here is the caller graph for this function:

STATIC_DCL void FDECL ( init_fill  ,
(SCHAR_P, SCHAR_P)   
)
STATIC_DCL void FDECL ( pass_one  ,
(SCHAR_P, SCHAR_P)   
)
STATIC_DCL void FDECL ( join_map  ,
(SCHAR_P, SCHAR_P)   
)
STATIC_DCL void FDECL ( finish_map  ,
(SCHAR_P, SCHAR_P, XCHAR_P, XCHAR_P)   
)
STATIC_DCL void FDECL ( pass_two  ,
(SCHAR_P, SCHAR_P)   
)
STATIC_DCL void FDECL ( remove_room  ,
(unsigned)   
)
STATIC_DCL void FDECL ( backfill  ,
(SCHAR_P, SCHAR_P)   
)
STATIC_DCL void FDECL ( init_map  ,
(SCHAR_P)   
)
STATIC_DCL void FDECL ( pass_three  ,
(SCHAR_P, SCHAR_P)   
)
void FDECL ( mkmap  ,
(lev_init *)   
)
STATIC_DCL schar FDECL ( get_map  ,
(int, int, SCHAR_P)   
)
STATIC_OVL void finish_map ( schar  fg_typ,
schar  bg_typ,
boolean  lit,
boolean  walled 
)

References COLNO, IS_ROCK, IS_WALL, LAVAPOOL, levl, nroom, mkroom::rlit, rooms, ROWNO, TREE, TRUE, and wallify_map().

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

void flood_fill_rm ( int  sx,
int  sy,
int  rmno,
boolean  lit,
boolean  anyroom 
)

References IS_DOOR, IS_ROOM, IS_WALL, isok(), levl, SHARED, and WIDTH.

Referenced by join_map(), and spo_region().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL schar get_map ( int  col,
int  row,
schar  bg_typ 
)

References HEIGHT, levl, and WIDTH.

Referenced by pass_one(), pass_three(), and pass_two().

Here is the caller graph for this function:

STATIC_OVL void init_fill ( schar  bg_typ,
schar  fg_typ 
)

References HEIGHT, levl, MAX_TYPE, rn1, rnd(), and WIDTH.

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void init_map ( schar  bg_typ )

References COLNO, FALSE, levl, MAX_TYPE, and ROWNO.

Referenced by mkmap().

Here is the caller graph for this function:

STATIC_OVL void join_map ( schar  bg_typ,
schar  fg_typ 
)

References add_room(), dig_corridor(), FALSE, flood_fill_rm(), HEIGHT, mkroom::hx, mkroom::hy, mkroom::irregular, levl, mkroom::lx, mkroom::ly, max_rx, max_ry, MAXNROFROOMS, NO_ROOM, nroom, OROOM, rn2(), ROOMOFFSET, rooms, somexy(), TRUE, WIDTH, nhcoord::x, and nhcoord::y.

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

void mkmap ( lev_init init_lev )

References backfill(), lev_init::bg, depth(), FALSE, finish_map(), dlevel_t::flags, HEIGHT, init_fill(), init_map(), join(), join_map(), level, MAX_TYPE, N_P1_ITER, N_P2_ITER, N_P3_ITER, pass_one(), pass_three(), pass_two(), rn2(), rnd(), TRUE, u, you::uz, and WIDTH.

Referenced by splev_initlev().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_DCL void NDECL ( wallify_map   )
STATIC_OVL void pass_one ( schar  bg_typ,
schar  fg_typ 
)

References get_map(), HEIGHT, levl, MAX_TYPE, and WIDTH.

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void pass_three ( schar  bg_typ,
schar  fg_typ 
)

References get_map(), HEIGHT, levl, MAX_TYPE, new_loc, and WIDTH.

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void pass_two ( schar  bg_typ,
schar  fg_typ 
)

References get_map(), HEIGHT, levl, MAX_TYPE, new_loc, and WIDTH.

Referenced by mkmap().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void remove_room ( unsigned  roomno )

References mkroom::hx, mkroom::hy, levl, mkroom::lx, mkroom::ly, nroom, ROOMOFFSET, and rooms.

Referenced by remove_rooms().

Here is the caller graph for this function:

void remove_rooms ( int  lx,
int  ly,
int  hx,
int  hy 
)

References mkroom::hx, mkroom::hy, mkroom::irregular, mkroom::lx, mkroom::ly, nroom, remove_room(), and rooms.

Referenced by spo_map().

Here is the call graph for this function:

Here is the caller graph for this function:

STATIC_OVL void wallify_map (  )

References COLNO, HWALL, isok(), levl, ROOM, ROWNO, STONE, and VWALL.

Referenced by finish_map(), and spo_wallify().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int dirs[16] [static]
Initial value:
 {
    -1, -1 , -1, 0 , -1, 1 ,
     0, -1 ,              0, 1 ,
     1, -1 ,  1, 0 ,  1, 1}

Referenced by epathto(), and sp_level_coder().

int max_rx

Referenced by join_map().

int max_ry

Referenced by join_map().

int min_rx
int min_ry
int n_loc_filled [static]