/* * This software is licensed under the terms of the MIT-License * See COPYING for further information. * --- * Copyright (c) 2011-2018, Lukas Weber . * Copyright (c) 2012-2018, Andrei Alexeyev . */ #pragma once #include "taisei.h" #include "resource.h" #include "texture.h" typedef struct Sprite { Texture *tex; FloatRect tex_area; float w; float h; } Sprite; char* sprite_path(const char *name); void* load_sprite_begin(const char *path, uint flags); void* load_sprite_end(void *opaque, const char *path, uint flags); bool check_sprite_path(const char *path); void draw_sprite(float x, float y, const char *name); void draw_sprite_p(float x, float y, Sprite *spr); void draw_sprite_batched(float x, float y, const char *name); void draw_sprite_batched_p(float x, float y, Sprite *spr); void draw_sprite_ex(float x, float y, float scale_x, float scale_y, bool batched, Sprite *spr); void begin_draw_sprite(float x, float y, float scale_x, float scale_y, Sprite *spr); void end_draw_sprite(void); Sprite* get_sprite(const char *name); Sprite* prefix_get_sprite(const char *name, const char *prefix); extern ResourceHandler sprite_res_handler; #define SPRITE_PATH_PREFIX "res/gfx/" #define SPRITE_EXTENSION ".spr"