Atrinik Server  4.0
Data Structures | Functions | Variables
image.c File Reference
#include <global.h>
#include <toolkit/string.h>

Go to the source code of this file.

Data Structures

struct  bmappair
 

Functions

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

Variables

New_Facenew_faces
 
static struct bmappairxbm = NULL
 
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 ( const void *  a,
const void *  b 
)
static

Used for bsearch searching.

Definition at line 72 of file image.c.

int find_face ( const 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 172 of file image.c.

void free_all_images ( void  )

Deallocates memory allocated by read_bmap_names().

Definition at line 183 of file image.c.

int read_bmap_names ( void  )

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

int nroffiles = 0

The actual number of bitmaps defined.

Definition at line 61 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 67 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 58 of file image.c.