This function copies the given MP grid into a DS grid.
A cell in the DS grid will contain the value -1 if it's flagged as occupied in the MP grid, or 0 if it isn't.
NOTE To convert from MP grid to DS grid, see ds_grid_to_mp_grid.
WARNING The DS grid and MP grid must have the same width and height. If the grids' dimensions don't match, the conversion will fail and an error "Error, grid sizes do not match" is thrown.
mp_grid_to_ds_grid(source, destination);
Argument | Type | Description |
---|---|---|
source | MP Grid ID | Index of the mp_grid that is to be used |
destination | DS Grid | Index of the ds_grid that is to be used to copy the grid data to. |
motion_grid = ds_grid_create(room_width / 32, room_height / 32);
mp_grid_to_ds_grid(mp_grid, motion_grid);
The above code will create a new DS grid motion_grid and then copy the MP grid data contained in the variable mp_grid into the new DS grid.