44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
// Copyright (c) 2021 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include <dawn/dawn.h>
|
|
|
|
/**
|
|
* Create a tileset. Tilesets will be pre-divided to save performance later.
|
|
*
|
|
* @param tileset Tileset to init into.
|
|
* @param columns Count of columns.
|
|
* @param rows Count of rows.
|
|
* @param width Width of the tileset.
|
|
* @param height Height of the tileset.
|
|
* @param gapX Space between each column.
|
|
* @param gapY Space between each row.
|
|
* @param borderX Space around the edge of the tileset.
|
|
* @param borderY Space around the edge of the tileset.
|
|
*/
|
|
void tilesetInit(tileset_t *tileset,
|
|
int32_t columns, int32_t rows,
|
|
int32_t width, int32_t height,
|
|
int32_t gapX, int32_t gapY,
|
|
int32_t borderX, int32_t borderY
|
|
);
|
|
|
|
/**
|
|
* Retreive the division for a given tileset coordinate.
|
|
*
|
|
* @param tileset Tileset to retreive from.
|
|
* @param column X axis of the tileset.
|
|
* @param row Y axis of the tileset.
|
|
* @returns The Tileset division.
|
|
*/
|
|
tilesetdiv_t tilesetGetDivision(tileset_t *tileset,int32_t column, int32_t row);
|
|
|
|
/**
|
|
* Cleans a previously created tileset
|
|
*
|
|
* @param tileset Cleanup the tileset.
|
|
*/
|
|
void tilesetDispose(tileset_t *tileset); |