2010-10-12 10:55:23 +02:00
|
|
|
/*
|
2011-03-05 13:44:21 +01:00
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 04:52:08 +01:00
|
|
|
* See COPYING for further information.
|
2011-03-05 13:44:21 +01:00
|
|
|
* ---
|
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>.
|
2010-10-12 10:55:23 +02:00
|
|
|
*/
|
|
|
|
|
2017-09-27 14:14:53 +02:00
|
|
|
#pragma once
|
2010-10-12 10:55:23 +02:00
|
|
|
|
|
|
|
#include "texture.h"
|
|
|
|
|
2011-03-19 16:21:48 +01:00
|
|
|
struct Animation;
|
|
|
|
|
|
|
|
typedef struct Animation {
|
2010-10-12 10:55:23 +02:00
|
|
|
int rows;
|
|
|
|
int cols;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2017-02-28 18:47:47 +01:00
|
|
|
int w;
|
2017-10-03 17:25:38 +02:00
|
|
|
int h;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
int speed;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2011-03-19 16:21:48 +01:00
|
|
|
Texture *tex;
|
2010-10-12 10:55:23 +02:00
|
|
|
} Animation;
|
|
|
|
|
2017-03-02 11:23:30 +01:00
|
|
|
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-03-02 11:23:30 +01:00
|
|
|
|
2017-02-28 18:47:47 +01:00
|
|
|
Animation *get_ani(const char *name);
|
2017-03-02 11:23:30 +01:00
|
|
|
|
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);
|
2010-10-12 10:55:23 +02:00
|
|
|
|
2017-03-02 11:23:30 +01:00
|
|
|
#define ANI_PATH_PREFIX TEX_PATH_PREFIX
|
2017-03-11 22:39:38 +01:00
|
|
|
#define ANI_EXTENSION ".ani"
|