taisei/src/resource/animation.h

39 lines
908 B
C
Raw Normal View History

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
2017-09-12 03:28:15 +02:00
* Copyright (c) 2011-2017, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2017, Andrei Alexeyev <akari@alienslab.net>.
*/
2017-09-27 14:14:53 +02:00
#pragma once
#include "texture.h"
struct Animation;
typedef struct Animation {
int rows;
int cols;
2017-02-28 18:47:47 +01:00
int w;
2017-10-03 17:25:38 +02:00
int h;
int speed;
Texture *tex;
} Animation;
char* animation_path(const char *name);
bool check_animation_path(const char *path);
2017-03-13 06:44:39 +01:00
void* load_animation_begin(const char *filename, unsigned int flags);
void* load_animation_end(void *opaque, const char *filename, unsigned int flags);
2017-02-28 18:47:47 +01:00
Animation *get_ani(const char *name);
2017-10-03 17:25:38 +02:00
void draw_animation(float x, float y, int col, int row, const char *name);
void draw_animation_p(float x, float y, int col, int row, Animation *ani);
#define ANI_PATH_PREFIX TEX_PATH_PREFIX
#define ANI_EXTENSION ".ani"