Crossfire Server, Trunk  R20513
Data Structures | Macros | Functions | Variables
main.c File Reference

Command-line interface to the map generator used to test layouts. More...

#include "global.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "maze_gen.h"
#include "random_map.h"
#include "room_gen.h"
#include "rproto.h"
#include "sproto.h"
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  layout
 

Macros

#define LO_NEWFILE   2
 

Functions

int apply_auto (object *op)
 
void apply_auto_fix (mapstruct *m)
 
void clean_tmp_files (void)
 
void dragon_ability_gain (object *ob, int x, int y)
 
void draw_ext_info (int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
 
void draw_ext_info_format (int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
 
void emergency_save (int x)
 
void esrv_del_item (player *pl, object *ob)
 
void esrv_send_item (object *ob, object *obx)
 
void esrv_update_item (int flags, object *pl, object *op)
 
void esrv_update_spells (player *pl)
 
int execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix)
 
int execute_global_event (int eventcode,...)
 
void ext_info_map (int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
 
objectfind_skill_by_number (object *who, int skillno)
 
static void generate_map (char *OutFileName)
 
int main (int argc, char *argv[])
 
void move_firewall (object *ob)
 
static void print_map (char **layout, int width, int height)
 Print the human-readable layout of a map. More...
 
static void print_quickhelp (void)
 Print a message stating how to get help. More...
 
static void print_usage (void)
 Print out usage information. More...
 
void rod_adjust (object *rod)
 
void set_darkness_map (mapstruct *m)
 
void set_map_timeout (mapstruct *oldmap)
 
static void test_layout (int width, int height, char **(*layout_func)(int, int, int, int))
 Test the map layout produced by the specified generator. More...
 

Variables

static layout layout_list [NROFLAYOUTS]
 

Detailed Description

Command-line interface to the map generator used to test layouts.

Definition in file main.c.

Macro Definition Documentation

#define LO_NEWFILE   2

Definition at line 32 of file main.c.

Referenced by generate_map().

Function Documentation

int apply_auto ( object op)
void apply_auto_fix ( mapstruct m)
void clean_tmp_files ( void  )

Definition at line 336 of file main.c.

void dragon_ability_gain ( object ob,
int  x,
int  y 
)

Definition at line 345 of file main.c.

void draw_ext_info ( int  flags,
int  pri,
const object pl,
uint8_t  type,
uint8_t  subtype,
const char *  message 
)

Definition at line 310 of file main.c.

References logfile.

void draw_ext_info_format ( int  flags,
int  pri,
const object pl,
uint8_t  type,
uint8_t  subtype,
const char *  format,
  ... 
)

Definition at line 315 of file main.c.

References logfile.

void emergency_save ( int  x)

Definition at line 333 of file main.c.

void esrv_del_item ( player pl,
object ob 
)

Definition at line 355 of file main.c.

void esrv_send_item ( object ob,
object obx 
)

Definition at line 339 of file main.c.

void esrv_update_item ( int  flags,
object pl,
object op 
)

Definition at line 342 of file main.c.

void esrv_update_spells ( player pl)

Definition at line 358 of file main.c.

int execute_event ( object op,
int  eventcode,
object activator,
object third,
const char *  message,
int  fix 
)

Definition at line 364 of file main.c.

int execute_global_event ( int  eventcode,
  ... 
)

Definition at line 369 of file main.c.

void ext_info_map ( int  color,
const mapstruct map,
uint8_t  type,
uint8_t  subtype,
const char *  str1 
)

Definition at line 325 of file main.c.

References logfile.

object* find_skill_by_number ( object who,
int  skillno 
)

Definition at line 351 of file main.c.

static void generate_map ( char *  OutFileName)
static

Definition at line 34 of file main.c.

References generate_random_map(), init_archetypes(), init_artifacts(), init_formulae(), init_globals(), init_gods(), init_library(), init_readable(), LO_NEWFILE, load_parameters(), save_map(), SAVE_MODE_INPLACE, RMParms::Xsize, and RMParms::Ysize.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 159 of file main.c.

References layout::func, generate_map(), NROFLAYOUTS, print_quickhelp(), print_usage(), roguelike_layout_gen(), and test_layout().

Referenced by CREMessagePanel::CREMessagePanel(), and CREQuestPanel::CREQuestPanel().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_firewall ( object ob)

Definition at line 330 of file main.c.

static void print_map ( char **  layout,
int  width,
int  height 
)
static

Print the human-readable layout of a map.

Definition at line 64 of file main.c.

Referenced by test_layout().

Here is the caller graph for this function:

static void print_quickhelp ( void  )
static

Print a message stating how to get help.

Definition at line 131 of file main.c.

Referenced by main().

Here is the caller graph for this function:

static void print_usage ( void  )
static

Print out usage information.

Definition at line 136 of file main.c.

Referenced by main().

Here is the caller graph for this function:

void rod_adjust ( object rod)

Definition at line 361 of file main.c.

void set_darkness_map ( mapstruct m)

Definition at line 348 of file main.c.

void set_map_timeout ( mapstruct oldmap)

Definition at line 307 of file main.c.

static void test_layout ( int  width,
int  height,
char **(*)(int, int, int, int)  layout_func 
)
static

Test the map layout produced by the specified generator.

Parameters
widthMap width
heightMap height
layout_funcThe layout method to use.

Definition at line 116 of file main.c.

References print_map(), and SRANDOM.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

layout layout_list[NROFLAYOUTS]
static
Initial value:
= {
{ "rogue", (char **(*)(int, int, int, int))&roguelike_layout_gen },
{ "snake", (char **(*)(int, int, int, int))&make_snake_layout },
{ "sspiral", (char **(*)(int, int, int, int))&make_square_spiral_layout },
{ "spiral", (char **(*)(int, int, int, int))&map_gen_spiral },
{ "maze", (char **(*)(int, int, int, int))&maze_gen },
{ "onion", &map_gen_onion }
}
char ** roguelike_layout_gen(int xsize, int ysize, int options)
Actually make the rogue layout.
Definition: rogue_layout.c:332
char ** make_snake_layout(int xsize, int ysize)
Generate a snake-like layout.
Definition: snake.c:34
char ** make_square_spiral_layout(int xsize, int ysize)
Generates a square-spiral layout.
Definition: square_spiral.c:78
char ** map_gen_spiral(int xsize, int ysize, int option)
Generates a spiral layout.
char ** maze_gen(int xsize, int ysize, int option)
This function generates a random blocked maze with the property that there is only one path from one ...
Definition: maze_gen.c:58
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
Generates an onion layout.

Definition at line 93 of file main.c.