taisei/src/animation.h
laochailan ec85251571 dynamic texture loader
The static texture loading was replaced by a dynamic loader. Every png file in gfx/ is (recursively) loaded at the beginning and accessed via get_tex(name) or get_ani(name).name for "gfx/stage1/border.png" would be "stage1/border".

Sprite information is to be specified in the filename in the pattern: ani_${row count}_${col count}_${animation frequency}_${name}.png
2011-03-19 16:21:48 +01:00

36 lines
No EOL
662 B
C

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
*/
#ifndef ANIMATION_H
#define ANIMATION_H
#include "texture.h"
struct Animation;
typedef struct Animation {
struct Animation *next;
struct Animation *prev;
int rows;
int cols;
int w,h;
int speed;
char *name;
Texture *tex;
} Animation;
Animation *init_animation(char *filename);
Animation *get_ani(char *name);
void delete_animations();
void draw_animation(float x, float y, int row, char *name);
void draw_animation_p(float x, float y, int row, Animation *ani);
#endif