Atrinik Client  4.0
Functions | Variables
item.c File Reference
#include <global.h>
#include <region_map.h>
#include <toolkit/packet.h>

Go to the source code of this file.

Functions

void object_init (void)
 
void object_deinit (void)
 
void objects_free (object *op)
 
objectobject_find_object_inv (object *op, tag_t tag)
 
objectobject_find_object (object *op, tag_t tag)
 
objectobject_find (tag_t tag)
 
void object_remove (object *op)
 
void object_remove_inventory (object *op)
 
static void object_add (object *env, object *op, int bflag)
 
void object_transfer_inventory (object *op, object *to)
 
objectobject_create (object *env, tag_t tag, int bflag)
 
void toggle_locked (object *op)
 
void object_send_mark (object *op)
 
void object_redraw (object *op)
 
void objects_deinit (void)
 
void objects_init (void)
 
int object_animate (object *ob)
 
static void animate_inventory (object *op)
 
void animate_objects (void)
 
void object_show_centered (SDL_Surface *surface, object *tmp, int x, int y, int w, int h, bool fit)
 

Variables

static mempool_struct * pool_object
 

Detailed Description

Object management.

Definition in file item.c.

Function Documentation

static void animate_inventory ( object op)
static

Animate the inventory of an object.

Parameters
opThe object, such as cpl.ob, cpl.below, etc.

Definition at line 488 of file item.c.

void animate_objects ( void  )

Animate all possible objects.

Definition at line 510 of file item.c.

static void object_add ( object env,
object op,
int  bflag 
)
static

Adds an object to inventory of 'env'.

Parameters
envWhich object to add to.
opObject to add.
bflagIf 1, the object will be added to the end of the inventory instead of the start.

Definition at line 250 of file item.c.

int object_animate ( object ob)

Animate one object.

Parameters
obThe object to animate.
Returns
1 if the object changed face, 0 otherwise.

Definition at line 442 of file item.c.

object* object_create ( object env,
tag_t  tag,
int  bflag 
)

Creates a new object and inserts it into 'env'.

Parameters
envWhich object to insert the created object into. Can be NULL not to insert the created object anywhere.
tagThe object's ID.
bflagIf 1, the object will be added to the end of the inventory instead of the start.
Returns
The created object.

Definition at line 327 of file item.c.

void object_deinit ( void  )

Deinitialize the object system.

Definition at line 54 of file item.c.

object* object_find ( tag_t  tag)

Attempts to find an object by its tag, wherever it may be.

Parameters
tagTag to look for.
Returns
Matching object if found, NULL otherwise.

Definition at line 139 of file item.c.

object* object_find_object ( object op,
tag_t  tag 
)

Find an object inside another object by its tag.

Parameters
opObject to search in.
tagID of the object we're looking for.
Returns
Matching object if found, NULL otherwise.

Definition at line 116 of file item.c.

object* object_find_object_inv ( object op,
tag_t  tag 
)

Find an object inside another object, but not inside inventories.

Parameters
opObject to search in.
tagID of the object we're looking for.
Returns
Matching object if found, NULL otherwise.

Definition at line 96 of file item.c.

void object_init ( void  )

Initialize the object system.

Definition at line 42 of file item.c.

void object_remove ( object op)

Remove an object.

Parameters
opWhat to remove.

Definition at line 174 of file item.c.

void object_remove_inventory ( object op)

Remove all items in object's inventory.

Parameters
opThe object to remove inventory of.

Definition at line 217 of file item.c.

void object_send_mark ( object op)

Update the marked object.

Parameters
opThe object.

Definition at line 366 of file item.c.

void object_show_centered ( SDL_Surface *  surface,
object tmp,
int  x,
int  y,
int  w,
int  h,
bool  fit 
)

Draw the object, centering it. Animation offsets are taken into account for perfect centering, even with different image sizes in animation.

Parameters
surfaceSurface to render on.
tmpObject to show.
xX position.
yY position.
wMaximum width.
hMaximum height.
fitWhether to fit the object into the maximum width/height by zooming it as necessary.

Definition at line 545 of file item.c.

void object_transfer_inventory ( object op,
object to 
)

Transfer the entire inventory of 'op' into 'to'.

Parameters
opObject to transfer the inventory of.
toObject to receive the items.

Definition at line 295 of file item.c.

void objects_deinit ( void  )

Deinitialize the various objects of cpl structure.

Definition at line 418 of file item.c.

void objects_free ( object op)

Frees all objects in a list.

Parameters
opStart of the list.

Definition at line 64 of file item.c.

void objects_init ( void  )

Initializes the various objects of cpl structure.

Definition at line 427 of file item.c.

void toggle_locked ( object op)

Toggle the locked status of an object.

Parameters
opObject.

Definition at line 347 of file item.c.

Variable Documentation

mempool_struct* pool_object
static

Pool for objects.

Definition at line 37 of file item.c.