1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-28 08:49:30 +00:00

Support for special characters in gfx.text; added scrolling to the default shell; updated sftdlib.

There is a known bug with different text size in sftdlib.
This commit is contained in:
Reuh 2015-08-22 16:45:32 +02:00
parent 56b47153b7
commit 2a5513473d
10 changed files with 516 additions and 39 deletions

View file

@ -0,0 +1,36 @@
#ifndef TEXTURE_ATLAS_H
#define TEXTURE_ATLAS_H
#include "sf2d.h"
#include "bin_packing_2d.h"
#include "int_htab.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct atlas_htab_entry {
bp2d_rectangle rect;
int bitmap_left;
int bitmap_top;
int advance_x;
int advance_y;
} atlas_htab_entry;
typedef struct texture_atlas {
sf2d_texture *tex;
bp2d_node *bp_root;
int_htab *htab;
} texture_atlas;
texture_atlas *texture_atlas_create(int width, int height, sf2d_texfmt format, sf2d_place place);
void texture_atlas_free(texture_atlas *atlas);
int texture_atlas_insert(texture_atlas *atlas, unsigned int character, const void *image, int width, int height, int bitmap_left, int bitmap_top, int advance_x, int advance_y);
int texture_atlas_exists(texture_atlas *atlas, unsigned int character);
void texture_atlas_get(texture_atlas *atlas, unsigned int character, bp2d_rectangle *rect, int *bitmap_left, int *bitmap_top, int *advance_x, int *advance_y);
#ifdef __cplusplus
}
#endif
#endif