Jo Engine Image definition and tools.
More...
Go to the source code of this file.
|
void | jo_replace_color (const jo_img *const img, const jo_color src_color, const jo_color dest_color) |
| Add a sprite. More...
|
|
bool | jo_bin_loader (jo_img *img, const char *const sub_dir, const char *const filename, const jo_color transparent_color) |
| Load a BIN image. More...
|
|
int | jo_sprite_add_bin_tileset (const char *const sub_dir, const char *const filename, const jo_color transparent_color, const jo_tile *const tileset, const unsigned int tile_count) |
| Add tileset sprites from a BIN file. More...
|
|
int | jo_sprite_add_bin (const char *const sub_dir, const char *const filename, const jo_color transparent_color) |
| Add a sprite from a BIN file. More...
|
|
int | jo_sprite_add_image_pack (const char *const sub_dir, const char *const filename, const jo_color transparent_color) |
| Add a set of image from a TEX file format. More...
|
|
bool | jo_bin_loader_from_stream (jo_img *img, char *stream, const jo_color transparent_color) |
| Load a BIN image from stream. More...
|
|
int | jo_sprite_add_bin_from_stream (char *stream, const jo_color transparent_color) |
| Add a sprite from a BIN file. More...
|
|
void | jo_free_img (void *const img) |
| Free an image loaded from CD. More...
|
|
Jo Engine Image definition and tools.
- Author
- Johannes Fetz
- Bug:
- No known bugs.
◆ JO_TILE_COUNT
#define JO_TILE_COUNT |
( |
|
TILE_TABLE | ) |
|
Get tile count in table (see Tileset Demo)
- Parameters
-
◆ jo_bin_loader()
bool jo_bin_loader |
( |
jo_img * |
img, |
|
|
const char *const |
sub_dir, |
|
|
const char *const |
filename, |
|
|
const jo_color |
transparent_color |
|
) |
| |
Load a BIN image.
- Parameters
-
img | Image (set data to NULL for dynamic allocation) |
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
filename | Filename (upper case and shorter as possible like "A.BIN") |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
- Returns
- true if succeeded otherwise false
◆ jo_bin_loader_from_stream()
bool jo_bin_loader_from_stream |
( |
jo_img * |
img, |
|
|
char * |
stream, |
|
|
const jo_color |
transparent_color |
|
) |
| |
Load a BIN image from stream.
- Parameters
-
img | Image (set data to NULL for dynamic allocation) |
stream | Raw bin file contents |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
- Returns
- true if succeeded otherwise false
◆ jo_free_img()
void jo_free_img |
( |
void *const |
img | ) |
|
Free an image loaded from CD.
- Parameters
-
◆ jo_replace_color()
Add a sprite.
- Parameters
-
img | Pointer to an image struct |
src_color | Color to replace |
dest_color | New color |
◆ jo_sprite_add_bin()
int jo_sprite_add_bin |
( |
const char *const |
sub_dir, |
|
|
const char *const |
filename, |
|
|
const jo_color |
transparent_color |
|
) |
| |
Add a sprite from a BIN file.
- Parameters
-
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
filename | Filename (upper case and shorter as possible like "A.BIN") |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
- Returns
- Sprite Id or -1 if failed
◆ jo_sprite_add_bin_from_stream()
int jo_sprite_add_bin_from_stream |
( |
char * |
stream, |
|
|
const jo_color |
transparent_color |
|
) |
| |
Add a sprite from a BIN file.
- Parameters
-
stream | Raw bin file contents |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
- Returns
- Sprite Id or -1 if failed
◆ jo_sprite_add_bin_tileset()
int jo_sprite_add_bin_tileset |
( |
const char *const |
sub_dir, |
|
|
const char *const |
filename, |
|
|
const jo_color |
transparent_color, |
|
|
const jo_tile *const |
tileset, |
|
|
const unsigned int |
tile_count |
|
) |
| |
Add tileset sprites from a BIN file.
- Parameters
-
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
filename | Filename (upper case and shorter as possible like "A.BIN") |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
tileset | Table of tiles |
tile_count | Number of tile in the entire image |
- Returns
- Sprite Id of the first image or -1 if failed
◆ jo_sprite_add_image_pack()
int jo_sprite_add_image_pack |
( |
const char *const |
sub_dir, |
|
|
const char *const |
filename, |
|
|
const jo_color |
transparent_color |
|
) |
| |
Add a set of image from a TEX file format.
- Parameters
-
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
filename | Filename (upper case and shorter as possible like "A.TEX") |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
- Returns
- Sprite Id of the first image or -1 if failed