dsekai
World engine for retrocomputers.
Loading...
Searching...
No Matches
animate.h File Reference

Tools for making common animations and effects. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ANIMATION
 Internal representation of an animation. Do not call directly; use animate_create() instead. More...
 

Macros

#define ANIMATE_CB_TABLE(f)
 
#define ANIMATE_ERROR   -1
 Return from animate_create() indicating a problem.
 
#define ANIMATE_COLOR_BLACK   0
 
#define ANIMATE_COLOR_CYAN   1
 
#define ANIMATE_COLOR_MAGENTA   2
 
#define ANIMATE_COLOR_WHITE   3
 
#define ANIMATE_TEMP_LOW()
 
#define ANIMATE_TEMP_MED()
 
#define ANIMATE_TEMP_HIGH()
 
#define ANIMATE_FLAG_CLOUDS_ROTATE   0x0010
 
#define ANIMATE_TILE_W   16
 
#define ANIMATE_TILE_H   16
 
#define ANIMATE_TILE_SZ   (ANIMATE_TILE_W * ANIMATE_TILE_H)
 
#define ANIMATE_FIRE_COOLING_MAX   10
 
#define ANIMATE_FIRE_COOLING_MIN   5
 
#define ANIMATE_FIRE_WIND   1
 
#define ANIMATE_TEXT_HEADER_Y_OFFSET   0
 
#define ANIMATE_TEXT_HEADER_Y_COUNT   1
 
#define ANIMATE_TEXT_HEADER_STR_SZ   2
 
#define ANIMATE_TEXT_HEADER_COLOR_IDX   3
 
#define ANIMATE_TEXT_HEADER_STR   4
 
#define ANIMATE_TEXT_MAX_SZ   (ANIMATE_TILE_SZ - ANIMATE_TEXT_HEADER_STR)
 
#define ANIMATE_CLOUD_WISP_LEN   8
 
#define ANIMATE_CB_TABLE_DRAW_PROTOTYPES(idx, name)
 
#define ANIMATE_CB_TABLE_TYPES(idx, name)
 

Typedefs

typedef void(* ANIMATE_CB) (struct ANIMATION *a)
 Callback to call on active animations for every frame.
 

Functions

void animate_set_string (int8_t a_idx, char *str_in, uint8_t str_sz_in, uint8_t color_idx_in)
 Setup string animation.
 
int8_t animate_create (uint8_t type, uint16_t flags, int16_t x, int16_t y, int16_t w, int16_t h)
 Create a new animation in the global animations list.
 
void animate_tesselate (struct ANIMATION *a, int16_t y_orig)
 Draw the animation tile to the screen, tiled to fill its area.
 
void animate_frame (uint16_t flags)
 Should be called during every frame to overlay animations on screen.
 
void animate_pause (uint16_t flags)
 Pause all animations with the given flags without deleting them.
 
void animate_resume (uint16_t flags)
 Resume all animations with the given flags that have been paused with animate_pause().
 
void animate_stop (int8_t idx)
 Stop the animation with the given internal index.
 
void animate_stop_all ()
 Stop all currently running animations on screen.
 

Variables

const ANIMATE_CB gc_animate_draw []
 Internal animation callback table.
 
struct ANIMATION g_animations [ANIMATE_ANIMATIONS_MAX]
 Internal running animation list.
 

Detailed Description

Tools for making common animations and effects.