Skip to content

Latest commit

 

History

History
76 lines (43 loc) · 2.59 KB

layers.rst

File metadata and controls

76 lines (43 loc) · 2.59 KB

Layers

Create a new CRLayer struct with the following attributes.

  • Grid: nullptr
  • entities.head: nullptr
  • entities.tail: nullptr
  • tile_index: 0
  • width: default layer width
  • height: default layer height
  • position: (0,0)
  • flags: 0
  • mask_count: 0

Calculate the size of the grid based on the width and height of the layers, then allocate the memory for it and fill the grid with zeros.

Creates a new layer using :cCRNewLayer(), then initializes the grid using :cCRInitGrid().

Checks if the index is within the world_layers array bounds, then overwrites whatever is in that index with the provided layer.

Checks if the index is within the ui_layers array bounds, then overwrites whatever is in that index with the provided layer.

Increases the size of the world_layer array in the cr_config struct by one, adding it to the end of the array.

Increases the size of the ui_layer array in the cr_config struct by one, adding it to the end of the array.

Creates a new layer using :cCRNewWorldLayer() and adds the provided layer to the index, shifting other layers to make room so nothing is overwritten.

Creates a new layer using :cCRNewUILayer() and adds the provided layer to the index, shifting other layers to make room so nothing is overwritten.

Creates a new layer using :cCRNewWorldLayer() and adds the provided layer to the end.

Creates a new layer using :cCRNewUILayer() and adds the provided layer to the end.

Check if there are already world layers. If not, create a new layer and append it to the world layers.

Check if there are already UI layers. If not, create a new layer and append it to the UI layers.

Set the flags in the provided layer to the integer flags.

Set the flags in world layer 0 to the integer flags.

Set the flags in UI layer 0 to the integer flags.