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
|
|
|
* ---
|
2018-01-04 18:14:31 +01:00
|
|
|
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
|
2010-10-12 10:55:23 +02:00
|
|
|
*/
|
|
|
|
|
2017-09-27 14:14:53 +02:00
|
|
|
#pragma once
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2010-10-12 10:55:23 +02:00
|
|
|
|
2018-02-06 07:19:25 +01:00
|
|
|
#include "sprite.h"
|
2010-10-12 10:55:23 +02:00
|
|
|
|
2011-03-19 16:21:48 +01:00
|
|
|
struct Animation;
|
|
|
|
|
|
|
|
typedef struct Animation {
|
2018-02-06 07:19:25 +01:00
|
|
|
// i'm emulating lao's fixed rows/cols table system,
|
|
|
|
// even though animations could have arbitrarily sized framegroups now.
|
|
|
|
// i just don't want to rewrite the whole animation system from scratch.
|
|
|
|
// be my guest if you want to try and do this the right way.
|
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
int rows;
|
|
|
|
int cols;
|
|
|
|
int speed;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2018-02-06 07:19:25 +01:00
|
|
|
Sprite **frames;
|
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);
|
2018-02-06 07:19:25 +01:00
|
|
|
void unload_animation(void *vani);
|
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"
|