Atrinik Server 2.5
Data Structures | Defines | Typedefs | Functions | Variables
modules/world_maker.c File Reference
#include <global.h>
#include <loader.h>
#include <gd.h>

Go to the source code of this file.

Data Structures

struct  wm_region

Defines

#define MAX_PIXELS   3

Typedefs

typedef struct wm_region wm_region

Functions

static void wm_images_init ()
static int render_object (gdImagePtr im, int x, int y, object *ob)
static void region_add_map (wm_region *r, mapstruct *m)
static int map_in_region (mapstruct *m, const char *name)
static void region_add_rec (wm_region *r, mapstruct *m, const char *region_name)
void world_maker ()

Variables

static int ** wm_face_colors

Detailed Description

Handles the world maker code.

Definition in file world_maker.c.


Define Documentation

#define MAX_PIXELS   3

Pixels per tile (3 = 3x3 box).

Definition at line 47 of file world_maker.c.


Typedef Documentation

typedef struct wm_region wm_region

Region.


Function Documentation

static int map_in_region ( mapstruct m,
const char *  name 
) [static]

Check if the specified map is in the specified region. Parent regions are checked for match.

Parameters:
mMap.
nameRegion to check.
Returns:
1 if it is in the region, 0 otherwise.

Definition at line 236 of file world_maker.c.

static void region_add_map ( wm_region r,
mapstruct m 
) [static]

Add map to region.

Parameters:
rRegion.
mMap to add.

Definition at line 220 of file world_maker.c.

static void region_add_rec ( wm_region r,
mapstruct m,
const char *  region_name 
) [static]

Recursively add maps to a region.

Parameters:
rRegion.
mStart map.
region_nameRegion name.

Definition at line 256 of file world_maker.c.

static int render_object ( gdImagePtr  im,
int  x,
int  y,
object ob 
) [static]

Render a single object on the image 'im'.

Parameters:
imImage to render on.
xX position.
yY position.
obObject to render.
Returns:
1 if we rendered the object, 0 otherwise.

Definition at line 157 of file world_maker.c.

static void wm_images_init ( ) [static]

Initialize the face colors.

Definition at line 89 of file world_maker.c.

void world_maker ( )

The main world maker function.

Definition at line 348 of file world_maker.c.


Variable Documentation

int** wm_face_colors [static]

Array of colors used by the different faces.

Each entry is an array consisting of:

  • average color value of the face
  • darker shade of the average color
  • red average
  • green average
  • blue average

Definition at line 44 of file world_maker.c.