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

Go to the source code of this file.

Functions

void effects_init ()
void effects_deinit ()
void effects_reinit ()
void effect_sprites_free (effect_struct *effect)
void effect_free (effect_struct *effect)
void effect_sprite_def_free (effect_sprite_def *sprite_def)
void effect_sprite_free (effect_sprite *sprite)
void effect_sprite_remove (effect_sprite *sprite)
static effect_spriteeffect_sprite_create (effect_struct *effect)
void effect_sprites_play ()
int effect_start (const char *name)
void effect_debug (const char *type)
void effect_stop ()
uint8 effect_has_overlay ()
void effect_scale (_Sprite *sprite)

Variables

static effect_structeffects = NULL
static effect_structcurrent_effect = NULL
static const char * overlay_cols [] = {"r", "g", "b", "a"}

Detailed Description

Map effects handling.

Definition in file effects.c.


Function Documentation

void effect_debug ( const char *  type)

Used for debugging effects code using /d_effect command.

Parameters:
typeWhat debugging command to run.

Definition at line 775 of file effects.c.

void effect_free ( effect_struct effect)

Deinitialize a single effect.

Parameters:
effectEffect that will be freed.

Definition at line 417 of file effects.c.

uint8 effect_has_overlay ( )

Check whether there is an overlay on the active effect (if any).

Returns:
1 if there is an overlay, 0 otherwise.

Definition at line 830 of file effects.c.

void effect_scale ( _Sprite sprite)

Add an effect overlay to a sprite.

Parameters:
spriteThe sprite to add overlay to.

Definition at line 843 of file effects.c.

static effect_sprite* effect_sprite_create ( effect_struct effect) [static]

Allocate a new sprite object and add it to the link of currently shown sprites.

A random sprite definition object will be chosen.

Parameters:
effectEffect this is being done for.
Returns:
The created sprite.

Definition at line 481 of file effects.c.

void effect_sprite_def_free ( effect_sprite_def sprite_def)

Deinitialize a single sprite definition.

Parameters:
sprite_defSprite definition that will be freed.

Definition at line 430 of file effects.c.

void effect_sprite_free ( effect_sprite sprite)

Deinitialize a single shown sprite.

Parameters:
spriteSprite that will be freed.

Definition at line 439 of file effects.c.

void effect_sprite_remove ( effect_sprite sprite)

Remove a single shown sprite from the linked list and free it.

Parameters:
spriteSprite to remove and free.

Definition at line 447 of file effects.c.

void effect_sprites_free ( effect_struct effect)

Deinitialize shown sprites of a single effect.

Parameters:
effectThe effect to have shown sprites deinitialized.

Definition at line 401 of file effects.c.

void effect_sprites_play ( )

Try to play effect sprites.

Definition at line 531 of file effects.c.

int effect_start ( const char *  name)

Start an effect identified by its name.

Parameters:
nameName of the effect to start. 'none' is a reserved effect name and will stop any currently playing effect.
Returns:
1 if the effect was started, 0 otherwise.

Definition at line 703 of file effects.c.

void effect_stop ( )

Stop currently playing effect.

Definition at line 816 of file effects.c.

void effects_deinit ( )

Deinitialize effects linked list.

Definition at line 356 of file effects.c.

void effects_init ( )

Initialize effects from file.

Definition at line 41 of file effects.c.

void effects_reinit ( )

Makes sure all sprite definitions have correct sprite IDs and their images are properly loaded.

Definition at line 384 of file effects.c.


Variable Documentation

effect_struct* current_effect = NULL [static]

Current effect.

Definition at line 35 of file effects.c.

effect_struct* effects = NULL [static]

Linked list of possible effects.

Definition at line 33 of file effects.c.

const char* overlay_cols[] = {"r", "g", "b", "a"} [static]

RGBA as lowercase overlay color names.

Definition at line 37 of file effects.c.