sgdk: MapDefinition Struct Reference

sgdk

- Main Page
- Related Pages
- Classes
- Files

- Class List

Public Attributes
MapDefinition Struct Reference

MapDefinition structure which contains data for large level background.
It's optimized to encode large map using 128x128 block chunk (block chunk are organized in metatile). More...

`#include <map.h>`

List of all members.

## Public Attributes

u16 | w
u16 | h
u16 | hp
u16 | compression
u16 | numMetaTile
u16 | numBlock
Palette * | palette
TileSet * | tileset
u16 * | metaTiles
void * | blocks
void * | blockIndexes
u16 * | blockRowOffsets

## Detailed Description

MapDefinition structure which contains data for large level background.
It's optimized to encode large map using 128x128 block chunk (block chunk are organized in metatile).

Parameters:

  w | map width in block (128x128 pixels block).
  h | map height in block (128x128 pixels block).
  hp | map height in block (128x128 pixels block) removing duplicated rows

  compression

  b0-b3=compression type for metaTiles
  b4-b7=compression for blocks data
  b8-b11=compression for blockIndexes data
  Accepted values:
  COMPRESSION_NONE
  COMPRESSION_APLIB
  COMPRESSION_LZ4W

  numMetaTile | number of MetaTile
  numBlock | number of Block (128x128 pixels chunk)
  palette | Palette data.
  tileset | TileSet data structure (contains tiles definition for the image).

  metaTiles

  metatiles definition, each metatile is encoded as 2x2 tiles block:
  - b15: priority
  - b14-b13: palette
  - b12: vflip
  - b11: hflip
  - b10-b0: tile index (from tileset)

  blocks | blocks definition, each block is encoded as 8x8 metatiles: if numMetaTile <= 256 --> 8 bit index for metaTile else --> 16 bit index for metaTile
  blockIndexes | block index array (referencing blocks) for the w * hp sized map if numBlock <= 256 --> 8 bit index for block else --> 16 bit index for block
  blockRowOffsets | block row offsets used internally for fast retrieval of block data (index = blockIndexes[blockRowOffsets[y] + x])

The documentation for this struct was generated from the following file:

- map.h

All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines