#ifndef TERMBOX_RENDER_H #define TERMBOX_RENDER_H #include #include #include #include #include "termbox.h" #include "oct_termbox_sprite.h" #define OCT_MAX_SPRITE_SIZE 101 #define OCT_NUM_SPRITES 100 void oct_render_termbox_sprite(struct oct_tb_sprite* ots) { char shape_copy[OCT_MAX_SPRITE_SIZE]; strncpy(shape_copy, ots->shape, OCT_MAX_SPRITE_SIZE-1); char* line = NULL; line = strtok(shape_copy, "\n\r"); int x = ots->x; int y = ots->y; while (line) { tb_print(x, y++, ots->fg, ots->bg, line); line = strtok(NULL, "\n\r"); } } #endif