Crossfire Server, Trunk
decor.cpp File Reference
#include <assert.h>
#include <stdlib.h>
#include "global.h"
#include "random_map.h"
#include "rproto.h"
+ Include dependency graph for decor.cpp:

Go to the source code of this file.

Macros

#define NR_DECOR_OPTIONS   1
 

Functions

int obj_count_in_map (mapstruct *map, int x, int y)
 
void put_decor (mapstruct *map, char **maze, char *decorstyle, int decor_option, RMParms *RP)
 

Detailed Description

Those functions handle the decor in the random maps.

Definition in file decor.cpp.

Macro Definition Documentation

◆ NR_DECOR_OPTIONS

#define NR_DECOR_OPTIONS   1

Number of decor styles that can be chosen if none specified.

Definition at line 27 of file decor.cpp.

Function Documentation

◆ obj_count_in_map()

int obj_count_in_map ( mapstruct map,
int  x,
int  y 
)

Count objects at a spot.

Parameters
mapmap we want to check
x
ycoordinates
Returns
count of objects in the map at x,y.

Definition at line 39 of file decor.cpp.

References disinfect::count, FOR_MAP_FINISH, FOR_MAP_PREPARE, disinfect::map, Ice::tmp, diamondslots::x, and diamondslots::y.

Referenced by put_decor().

+ Here is the caller graph for this function:

◆ put_decor()

void put_decor ( mapstruct map,
char **  maze,
char *  decorstyle,
int  decor_option,
RMParms RP 
)

Put the decor into the map. Right now, it's very primitive.

Parameters
mapmap to add decor to.
mazelayout of the map, as was generated.
decorstylestyle to use. Can be NULL.
decor_optionhow to place decor:
  • 0 means no decor.
  • 1 means to place randomly decor.
  • other means to fill the map with decor.
RPparameters of the random map.

Definition at line 65 of file decor.cpp.

References object::arch, arch_to_object(), find_style(), disinfect::map, NR_DECOR_OPTIONS, obj_count_in_map(), object_copy(), object_insert_in_map_at(), pick_random_object(), RANDOM, diamondslots::x, RMParms::Xsize, diamondslots::y, and RMParms::Ysize.

Referenced by generate_random_map().

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