1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#ifndef __SPRITE_H
#define __SPRITE_H
#ifndef WIN32
#include "config.h"
#endif
/* one scanline of bitmap */
struct line
{
int len;
unsigned char *attr;
unsigned char *bmp;
};
/* one sprite animation position */
struct pos
{
int xo,yo;
int n;
struct line *lines;
};
/* sprite structure */
struct sprite
{
int n_positions; /* Number of defined positions */
struct pos *positions;
int n_steps;
unsigned short *steps;
};
/* load sprite from a file */
extern void load_sprite(unsigned char *,struct sprite *);
/* put sprite on given position */
#ifdef HAVE_INLINE
extern inline void
#else
extern void
#endif
put_sprite(int,int,struct pos *,unsigned char);
/* put image into given memory */
#ifdef HAVE_INLINE
extern inline void
#else
extern void
#endif
_put_sprite(int,int,unsigned char *,unsigned char *,int,int,struct pos *,unsigned char,unsigned char);
/* copy window of static map visible by player into screenbuffer */
/* accepts x and y coordinate of upper left corner of the window */
extern void show_window(int x,int y);
/* initalize sprites */
extern void init_sprites(void);
extern void shutdown_sprites(void);
extern void free_sprite(struct sprite *);
#endif
|