/
xverizex
/
c_game_engine
Обзор
Документация
Войти
/
xverizex
/
c_game_engine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/engine/include/sprite.h
76 строк
2 KB
Dmitry
Add isometric
10 авг 2025, 15:54
10 авг 2025, 15:54
8efc962
Код
Авторство
О чём код?
#ifndef SPRITE_H #define SPRITE_H #include <stdint.h> #include <shader.h> #include <resource-manager.h> #include <camera.h> struct game; struct sprite { struct game *g; struct resource *resource; struct shader *shader; uint32_t *textures0; uint32_t num_res; float ortho[16]; float transform[16]; float scale[16]; float model[16]; float p[3]; uint32_t vao; uint32_t vbo; uint32_t tex_width; uint32_t tex_height; uint32_t real_width; uint32_t real_height; float float_width; float float_height; uint8_t *buf; uint8_t *res_data; uint32_t flip_h; uint32_t flip_v; uint32_t cur_tex; uint32_t cam_indx; float aspect_float; struct doxy_animation *an; }; struct sprite *sprite_init (struct game *); struct sprite *sprite_init_with_texture (struct game *, uint32_t type, uint32_t texture, uint32_t shader_type); void sprite_set_texture (struct sprite *sp, uint32_t type, uint32_t res); void sprite_set_scale (struct sprite *sp, float sc); void sprite_set_float_size_width (struct sprite *sp, float _w); void sprite_set_float_size_height (struct sprite *sp, float _h); void sprite_set_float_size (struct sprite *sp, float _h); struct sprite *sprite_init_with_ui_int_coord (struct game *g, uint32_t w, uint32_t h, uint32_t shader, uint32_t type, uint32_t texture); void sprite_set_texture_without_size_int (struct sprite *sp, uint32_t type, uint32_t res); struct sprite * sprite_init_with_texture_foreign (struct game *g, uint32_t texture, uint32_t width, uint32_t height); void sprite_set_pos_each (struct sprite *sp, int x, int y); void sprite_set_float_pos_each (struct sprite *sp, float x, float y); void sprite_set_pos_with_z_each (struct sprite *sp, int x, int y, int z); void sprite_set_pos (struct sprite *sp, float *p); void sprite_set_vao_vbo (struct sprite *sp); void sprite_render (struct sprite *sp, struct camera *cam, void *child); struct sprite *sprite_init_with_framebuffer (struct game *g, uint32_t w, uint32_t h, uint32_t shader, uint32_t texture); struct sprite *sprite_init_with_framebuffer_int_coord (struct game *g, uint32_t w, uint32_t h, uint32_t shader, uint32_t texture); void sprite_set_vao_vbo_framebuffer (struct sprite *); void sprite_set_vao_vbo_framebuffer_int (struct sprite *sp); void sprite_new_div (struct sprite *s); #endif