40# define __JO_LEVEL_H__
42#ifdef JO_COMPILE_WITH_FS_SUPPORT
47# define JO_LEVEL_MAX_COPIES (16)
96 const void *
const defaults);
107 const void *
const defaults,
unsigned int *
const count);
125# define JO_LEVEL_HEADER(LEVEL, ID, NAME) ({ static const jo_level_##NAME##_header __defaults = JO_LEVEL_##ID##_HEADER_DEFAULTS; \
126 (const jo_level_##NAME##_header *)jo_level_get_header((LEVEL), JO_LEVEL_SECTION_##ID, \
127 sizeof(jo_level_##NAME##_header), &__defaults); })
130# define JO_LEVEL_RECORDS(LEVEL, ID, NAME, COUNT) ({ static const jo_level_##NAME##_record __defaults = JO_LEVEL_##ID##_RECORD_DEFAULTS; \
131 (const jo_level_##NAME##_record *)jo_level_get_records((LEVEL), JO_LEVEL_SECTION_##ID, \
132 sizeof(jo_level_##NAME##_record), &__defaults, (COUNT)); })
162 const int first,
const int count,
int *
const sprite_ids);
189 int *
const sprite_ids);
const jo_level_directory_entry * jo_level_find_section(const jo_level *const level, const unsigned int id)
Find a section (also a section of the game: identifier with a lowercase letter).
void jo_level_free(jo_level *const level)
Free a level (the pointers given by the functions below are not valid any more).
const void * jo_level_get_array(const jo_level *const level, const unsigned int id, const unsigned int offset)
Array of a section (an offset field of its header).
const char * strings
Definition level.h:56
const void * jo_level_section_data(const jo_level *const level, const unsigned int id)
Start of a section in the file.
bool jo_level_add_textures8(jo_level *const level, const int first, const int count, int *const sprite_ids)
Make the sprites of textures of 256 colors of a level, and of their smaller copies (the sprites after...
bool jo_level_set_textures8_palette(jo_level *const level, const jo_palette *const palette)
Copy the palette of the textures of 256 colors of a level in a palette.
void * copies[(16)]
Definition level.h:58
#define JO_LEVEL_MAX_COPIES
Maximum number of normalized copies of headers and records of a level (older files,...
Definition level.h:47
const void * jo_level_get_header(jo_level *const level, const unsigned int id, const unsigned int size, const void *const defaults)
Header of a section, with the fields of this engine.
bool jo_level_set_textures16_palette(jo_level *const level, const jo_palette *const palette)
Copy the palette of the textures of 16 colors of a level in a palette.
jo_level * jo_level_load(const char *const filename)
Load a level file (in the current directory of the CD, see jo_fs_cd()).
const void * jo_level_get_records(jo_level *const level, const unsigned int id, const unsigned int size, const void *const defaults, unsigned int *const count)
Records of a section, with the fields of this engine.
unsigned int section_count
Definition level.h:55
unsigned int strings_size
Definition level.h:57
unsigned int copy_count
Definition level.h:59
bool jo_level_add_textures16(jo_level *const level, const jo_palette *const palette, const int first, const int count, int *const sprite_ids)
Make the sprites of textures of 16 colors of a level, each one with its color lookup table.
unsigned int size
Definition level.h:53
const char * jo_level_string(const jo_level *const level, const unsigned int offset)
A string of the level (field of type string).
const jo_level_directory_entry * directory
Definition level.h:54
unsigned char * data
Definition level.h:52
A loaded level.
Definition level.h:51
Directory entry (one per section, after the file header) (24 bytes).
Definition level_format.h:37
Palette contents struct.
Definition types.h:268