Macaw OS C reference

Function mget

#include <macaw.h>
int mget(int x, int y, const char *layer);

Reads one tile of the map.

Parameters

xint
The tile's column, counting from 0.
yint
The tile's row, counting from 0.
layerconst char *
The layer's name, or NULL for the first layer.

Returns int

The tile's sprite number, or 0 if it's empty, off the map, or there's no such layer.

In Sprites and the map, with spr, sprex, sspr, fget, fset, map, mset, mapwidth, mapheight, maplayers, maplayername.