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

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

#include "n_common.h"
#include "n_log.h"
#include "allegro5/allegro.h"
Include dependency graph for n_atlas.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  N_ATLAS
 a set of atlas pages addressed as (page, cell index) More...
struct  N_ATLAS_PAGE
 one atlas page: a bitmap holding cols*rows equally sized cells More...

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.h.