Atrinik Server 2.5
Data Structures | Functions | Variables
server/image.c File Reference
#include <global.h>

Go to the source code of this file.

Data Structures

struct  bmappair

Functions

static int compar (struct bmappair *a, struct bmappair *b)
int read_bmap_names ()
int find_face (char *name, int error)
void free_all_images ()

Variables

New_Facenew_faces
static struct bmappairxbm = NULL
New_Faceblank_face
New_Facenext_item_face
New_Faceprev_item_face
int nroffiles = 0
int nrofpixmaps = 0

Detailed Description

Handles face-related stuff, including the actual face data.

Definition in file image.c.


Function Documentation

static int compar ( struct bmappair a,
struct bmappair b 
) [static]

Used for bsearch searching.

Definition at line 73 of file image.c.

int find_face ( char *  name,
int  error 
)

This returns the face number of face 'name'. Number is constant during an invocation, but not necessarily between versions (this is because the faces are arranged in alphabetical order, so if a face is removed or added, all faces after that will have a different number).

Parameters:
nameFace to search for.
errorValue to return if face was not found.

Definition at line 184 of file image.c.

void free_all_images ( )

Deallocates memory allocated by read_bmap_names().

Definition at line 211 of file image.c.

int read_bmap_names ( )

This reads the bmaps file to get all the bitmap names and stuff. It only needs to be done once, because it is player independent (ie, what display the person is on will not make a difference).

Definition at line 82 of file image.c.


Variable Documentation

Following can just as easily be pointers, but it is easier to keep them like this.

Definition at line 61 of file image.c.

int nroffiles = 0

The actual number of bitmaps defined.

Definition at line 64 of file image.c.

int nrofpixmaps = 0

The number of bitmaps loaded. With the automatic generation of the bmaps file, this is now equal to nroffiles.

Definition at line 69 of file image.c.

struct bmappair* xbm = NULL [static]

The xbm array (which contains name and number information, and is then sorted) contains nroffiles entries.

Definition at line 56 of file image.c.