LibTMJ  1.0.0
A library for loading JSON Tiled maps
Data Structures | Typedefs | Enumerations | Functions | Variables
tmj.h File Reference

The libtmj API. More...

#include <stdbool.h>
#include <stdint.h>
#include <jansson.h>
Include dependency graph for tmj.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Property
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#property More...
 
struct  Chunk
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#chunk More...
 
struct  Point
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#point More...
 
struct  Text
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#text More...
 
struct  Object
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#object More...
 
struct  Layer
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#layer More...
 
struct  Transformations
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#transformations More...
 
struct  Terrain
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#terrain More...
 
struct  Frame
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#frame More...
 
struct  Tile
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tile-definition More...
 
struct  WangTile
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-tile More...
 
struct  WangColor
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-color More...
 
struct  WangSet
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-set More...
 
struct  Grid
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#grid More...
 
struct  TileOffset
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tile-offset More...
 
struct  Tileset
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tileset More...
 
struct  Map
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#json-map-format More...
 
struct  ObjectTemplate
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#object-template More...
 

Typedefs

typedef struct Property Property
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#property More...
 
typedef struct Chunk Chunk
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#chunk More...
 
typedef struct Point Point
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#point More...
 
typedef struct Text Text
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#text More...
 
typedef struct Object Object
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#object More...
 
typedef struct Layer Layer
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#layer More...
 
typedef struct Transformations Transformations
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#transformations More...
 
typedef struct Terrain Terrain
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#terrain More...
 
typedef struct Frame Frame
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#frame More...
 
typedef struct Tile Tile
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tile-definition More...
 
typedef struct WangTile WangTile
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-tile More...
 
typedef struct WangColor WangColor
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-color More...
 
typedef struct WangSet WangSet
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#wang-set More...
 
typedef struct Grid Grid
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#grid More...
 
typedef struct TileOffset TileOffset
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tile-offset More...
 
typedef struct Tileset Tileset
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#tileset More...
 
typedef struct Map Map
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#json-map-format More...
 
typedef struct ObjectTemplate ObjectTemplate
 https://doc.mapeditor.org/en/stable/reference/json-map-format/#object-template More...
 
typedef enum TMJ_LOG_PRIORITY tmj_log_priority
 

Enumerations

enum  TMJ_LOG_PRIORITY {
  TMJ_LOG_DEBUG , TMJ_LOG_INFO , TMJ_LOG_WARNING , TMJ_LOG_ERR ,
  TMJ_LOG_CRIT
}
 

Functions

Maptmj_map_loadf (const char *path, bool check_extension)
 Loads the Tiled map from the file at the given path. More...
 
Maptmj_map_load (const char *map, const char *name)
 Loads the Tiled map from the given JSON object string. More...
 
Tilesettmj_tileset_loadf (const char *path, bool check_extension)
 Loads the Tiled tileset at the given path. More...
 
Tilesettmj_tileset_load (const char *tileset)
 Loads the Tiled tileset from the given JSON object string. More...
 
void tmj_map_free (Map *map)
 Frees the memory associated with the given map. More...
 
void tmj_tileset_free (Tileset *tileset)
 Frees the memory associated with the given tileset. More...
 
void tmj_log_regcb (bool debug, void(*callback)(tmj_log_priority, const char *))
 Registers a callback function to handle logging events. More...
 
uint32_t * tmj_decode_layer (const char *data, const char *encoding, const char *compression, size_t *size)
 Decodes layer data from a Tiled map layer. More...
 

Variables

const unsigned int TMJ_VERSION_MAJOR
 ‍** More...
 
const unsigned int TMJ_VERSION_MINOR
 The library minor version. More...
 
const unsigned int TMJ_VERSION_PATCH
 The library patch version. More...
 
const char *const TMJ_VERSION
 The full library version. More...
 

Detailed Description

The libtmj API.

The structures returned by the functions defined in this interface are not meant to be modified by the user. Use only the provided functions to do so.

Definition in file tmj.h.

Typedef Documentation

◆ Property

typedef struct Property Property

◆ Chunk

typedef struct Chunk Chunk

◆ Point

typedef struct Point Point

◆ Text

typedef struct Text Text

◆ Object

typedef struct Object Object

◆ Layer

typedef struct Layer Layer

◆ Transformations

◆ Terrain

typedef struct Terrain Terrain

◆ Frame

typedef struct Frame Frame

◆ Tile

typedef struct Tile Tile

◆ WangTile

typedef struct WangTile WangTile

◆ WangColor

typedef struct WangColor WangColor

◆ WangSet

typedef struct WangSet WangSet

◆ Grid

typedef struct Grid Grid

◆ TileOffset

typedef struct TileOffset TileOffset

◆ Tileset

typedef struct Tileset Tileset

https://doc.mapeditor.org/en/stable/reference/json-map-format/#tileset

Note that for sheets, tiles are numbered left-to-right, top-to-bottom

◆ Map

typedef struct Map Map

◆ ObjectTemplate