Atrinik Client 2.5
Functions | Variables
client/image.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static unsigned long bmap_hash (const char *str)
bmap_structbmap_find (const char *name)
void bmap_add (bmap_struct *bmap)
void read_bmaps_p0 ()
void read_bmaps ()
void finish_face_cmd (int pnum, uint32 checksum, char *face)
static int load_picture_from_pack (int num)
static int load_gfx_user_face (uint16 num)
int request_face (int pnum)
int get_bmap_id (char *name)
void blit_face (int id, int x, int y)

Variables

static bmap_structbmaps_default [BMAPS_MAX]
static bmap_structbmaps = NULL
static size_t bmaps_size = 0

Detailed Description

Handles image related code.

Definition in file image.c.


Function Documentation

void blit_face ( int  id,
int  x,
int  y 
)

Blit a face.

Parameters:
idID of the face.
xX position.
yY position.

Definition at line 553 of file image.c.

void bmap_add ( bmap_struct bmap)

Add a bmap to the bmaps array.

Parameters:
atThe bitmap to add.

Definition at line 105 of file image.c.

bmap_struct* bmap_find ( const char *  name)

Find a bmap by name.

Parameters:
nameThe bmap name to find.
Returns:
NULL if not found, pointer to the bmap otherwise.

Definition at line 68 of file image.c.

static unsigned long bmap_hash ( const char *  str) [static]

Hash string to find it in the bmaps array.

Parameters:
strThe string to hash.
Returns:
Hashed string.

Definition at line 43 of file image.c.

void finish_face_cmd ( int  pnum,
uint32  checksum,
char *  face 
)

Finish face command.

Parameters:
pnumID of the face.
checksumFace checksum.
faceFace name.

Definition at line 298 of file image.c.

int get_bmap_id ( char *  name)

Find a face ID by name. Request the face by finding it, loading it or requesting it.

Parameters:
nameFace name to find
Returns:
Face ID if found, -1 otherwise

Definition at line 519 of file image.c.

static int load_gfx_user_face ( uint16  num) [static]

Load face from user's graphics directory.

Parameters:
numID of the face to load.
Returns:
1 on success, 0 on failure.

Definition at line 411 of file image.c.

static int load_picture_from_pack ( int  num) [static]

Load picture from atrinik.p0 file.

Parameters:
numID of the picture to load.
Returns:
1 if the file does not exist, 0 otherwise.

Definition at line 374 of file image.c.

void read_bmaps ( )

Read bmaps server file.

Definition at line 218 of file image.c.

void read_bmaps_p0 ( )

Read bmaps from atrinik.p0, calculate checksums, etc.

Definition at line 137 of file image.c.

int request_face ( int  pnum)

We got a face - test if we have it loaded. If not, ask the server to send us face command.

Parameters:
pnumFace ID.
Returns:
0 if face is not there, 1 if face was requested or loaded.

Definition at line 469 of file image.c.


Variable Documentation

bmap_struct* bmaps = NULL [static]

Bmaps loaded from the server bmaps file.

Definition at line 35 of file image.c.

bmap_struct* bmaps_default[BMAPS_MAX] [static]

Default bmaps loaded from atrinik.p0.

Definition at line 33 of file image.c.

size_t bmaps_size = 0 [static]

Number of entries in bmaps.

Definition at line 37 of file image.c.