Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_atlas.c File Reference

Multi-page sprite atlas: random-access cell blitting from a grid. More...

#include "nilorea/n_atlas.h"
#include "allegro5/allegro_image.h"
#include "allegro5/allegro_memfile.h"
Include dependency graph for n_atlas.c:

Go to the source code of this file.

Functions

int n_atlas_cell_rect (const N_ATLAS *atlas, size_t page, size_t index, float *sx, float *sy, float *sw, float *sh)
 compute the source rectangle of one cell
void n_atlas_destroy (N_ATLAS **atlas)
 destroy an atlas and every bitmap it owns
int n_atlas_draw_cell (N_ATLAS *atlas, size_t page, size_t index, float x, float y, float size)
 draw one cell as a size x size square
int n_atlas_max_bitmap_size (void)
 get the largest bitmap dimension this display can hold
int n_atlas_page_ready (const N_ATLAS *atlas, size_t page)
 test whether a page holds a usable bitmap
int n_atlas_set_page (N_ATLAS *atlas, size_t page, const void *bytes, size_t len, const char *ext, uint16_t cols, uint16_t rows)
 decode bytes into one atlas page
N_ATLAS * new_n_atlas (size_t npages)
 allocate an atlas holding npages empty pages

Detailed Description

Multi-page sprite atlas: random-access cell blitting from a grid.

Author
Castagnier Mickael aka Gull Ra Driel
Version
1.0
Date
21/08/2026

Definition in file n_atlas.c.