Add sub-cell offsets

This commit is contained in:
Shylie
2024-05-14 21:42:49 -05:00
parent 02b1532fdd
commit 8318011cf2
4 changed files with 117 additions and 34 deletions

View File

@@ -35,7 +35,7 @@ void glerminal_flush();
* @brief Set a cell's sprite
* @param x position of the cell in the range [0, 32)
* @param y position of the cell in the range [0, 20)
* @param layer layer of the cell in the range [0, 16)
* @param layer layer of the cell in the range [0, 8)
* @param sprite sprite's index in the range [0, 256)
*/
void glerminal_set(unsigned char x, unsigned char y, unsigned char layer, unsigned char sprite);
@@ -43,10 +43,19 @@ void glerminal_set(unsigned char x, unsigned char y, unsigned char layer, unsign
* @brief Get a cell's sprite
* @param x position of the cell in the range [0, 32)
* @param y position of the cell in the range [0, 20)
* @param layer layer of the cell in the range [0, 16)
* @param layer layer of the cell in the range [0, 8)
* @return sprite index currently assigned to the cell
*/
unsigned char glerminal_get(unsigned char x, unsigned char y, unsigned char layer);
/**
* @brief Set a cell's offset
* @param x position of the cell in the range [0, 32)
* @param y position of the cell in the range [0, 20)
* @param layer layer of the cell in the range [0, 8)
* @param x_offset offset of the cell on the x axis in the range [-128, 127], where 0 is no offset
* @param y_offset offset of the cell on the y axis in the range [-128, 127], where 0 is no offset
*/
void glerminal_offset(unsigned char x, unsigned char y, unsigned char layer, char x_offset, char y_offset);
/**
* @brief Upload sprite to the given sprite ID