Atrinik Server  4.0
Data Structures | Macros | Typedefs | Functions | Variables
image.c File Reference
#include <global.h>
#include <loader.h>
#include <toolkit/packet.h>
#include <toolkit/string.h>
#include "zlib.h"

Go to the source code of this file.

Data Structures

struct  FaceInfo
 
struct  FaceSets
 

Macros

#define MAX_FACE_SETS   1
 
#define MAX_IMAGE_SIZE   50000
 

Typedefs

typedef struct FaceInfo FaceInfo
 

Functions

int is_valid_faceset (int fsn)
 
void free_socket_images (void)
 
void read_client_images (void)
 
void socket_command_ask_face (socket_struct *ns, player *pl, uint8_t *data, size_t len, size_t pos)
 
void face_get_data (int face, uint8_t **ptr, uint16_t *len)
 

Variables

static FaceSets facesets [MAX_FACE_SETS]
 

Detailed Description

This file deals with the image related communication to the client.

Definition in file image.c.

Macro Definition Documentation

#define MAX_FACE_SETS   1

Maximum different face sets.

Definition at line 37 of file image.c.

#define MAX_IMAGE_SIZE   50000

Maximum possible size of a single image in bytes.

Definition at line 117 of file image.c.

Typedef Documentation

typedef struct FaceInfo FaceInfo

Face info structure.

Function Documentation

void face_get_data ( int  face,
uint8_t **  ptr,
uint16_t *  len 
)

Get face's data.

Parameters
faceThe face.
[out]ptrPointer that will contain the image data, can be NULL.
[out]lenPointer that will contain the image data length, can be NULL.

Definition at line 272 of file image.c.

void free_socket_images ( void  )

Free all the information in face sets.

Definition at line 94 of file image.c.

int is_valid_faceset ( int  fsn)

Check if a face set is valid.

Parameters
fsnThe face set number to check
Returns
1 if the face set is valid, 0 otherwise

Definition at line 82 of file image.c.

void read_client_images ( void  )

Loads up all the image types into memory.

This way, we can easily send them to the client.

This function also generates client_bmaps file here.

At the moment, Atrinik only uses one face set file, no files like atrinik.1, atrinik.2, etc.

Definition at line 129 of file image.c.

Variable Documentation

FaceSets facesets[MAX_FACE_SETS]
static

The face sets.

Definition at line 73 of file image.c.