Skip to content

Commit 43daf28

Browse files
improve graphx tilemap docs
1 parent 7ab463e commit 43daf28

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

src/graphx/graphx.h

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -388,20 +388,20 @@ uint8_t name##_data[2 + (data_size)]; \
388388
gfx_rletsprite_t *name = (gfx_rletsprite_t *)name##_data
389389

390390
/**
391-
* Sets a particular tile's value given an initialized tilemap
392-
* structure and pixel offsets
391+
* Sets a particular tile's sprite tileset index.
392+
* This function bases position on the pixel offset from the top-left of the tilemap.
393393
*
394394
* @param tilemap Pointer to initialized tilemap structure.
395395
* @param x_offset Offset in pixels from the left of the tilemap.
396396
* @param y_offset Offset in pixels from the top of the tilemap.
397-
* @param value Value to set tile to.
397+
* @param value Sprite index in tileset.
398398
*/
399399
#define gfx_SetTile(tilemap, x_offset, y_offset, value) \
400400
(*(gfx_TilePtr((tilemap), (x_offset), (y_offset))) = (uint8_t)(value))
401401

402402
/**
403-
* Gets a particular tile's value given an initialized tilemap
404-
* structure and pixel offsets.
403+
* Gets a particular tile's sprite tileset index.
404+
* This function bases position on the pixel offset from the top-left of the tilemap.
405405
*
406406
* @param[in] tilemap Pointer to an initialized tilemap structure.
407407
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -411,20 +411,20 @@ gfx_rletsprite_t *name = (gfx_rletsprite_t *)name##_data
411411
(*(gfx_TilePtr((tilemap), (x_offset), (y_offset))))
412412

413413
/**
414-
* Sets a particular tile's value given an initialized tilemap structure
415-
* and mapped offsets.
414+
* Sets a particular tile's sprite tileset index.
415+
* This function uses the corrdinates from the tilemap array.
416416
*
417417
* @param[in] tilemap Pointer to initialized tilemap structure.
418418
* @param[in] col Column of tile in tilemap.
419419
* @param[in] row Row of tile in tilemap.
420-
* @param[in] value Value to set tile to.
420+
* @param[in] value Sprite index in tileset.
421421
*/
422422
#define gfx_SetTileMapped(tilemap, col, row, value) \
423423
(*(gfx_TilePtrMapped((tilemap), (col), (row))) = (uint8_t)(value))
424424

425425
/**
426-
* Gets a particular tile's value given an initialized tilemap structure
427-
* and mapped offsets.
426+
* Gets a particular tile's sprite tileset index.
427+
* This function uses the corrdinates from the tilemap array.
428428
*
429429
* @param[in] tilemap Pointer to an initialized tilemap structure.
430430
* @param[in] col Column of tile in tilemap.
@@ -626,7 +626,7 @@ gfx_sprite_t *gfx_AllocSprite(uint8_t width,
626626
void *(*malloc_routine)(size_t));
627627

628628
/**
629-
* Draws a tilemap given an initialized tilemap structure.
629+
* Draws a tilemap.
630630
*
631631
* @param[in] tilemap Pointer to initialized tilemap structure.
632632
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -638,7 +638,7 @@ void gfx_Tilemap(const gfx_tilemap_t *tilemap,
638638
uint24_t y_offset);
639639

640640
/**
641-
* Draws an unclipped tilemap given an initialized tilemap structure.
641+
* Draws an unclipped tilemap.
642642
*
643643
* @param[in] tilemap Pointer to initialized tilemap structure.
644644
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -650,7 +650,7 @@ void gfx_Tilemap_NoClip(const gfx_tilemap_t *tilemap,
650650
uint24_t y_offset);
651651

652652
/**
653-
* Draws a transparent tilemap given an initialized tilemap structure.
653+
* Draws a transparent tilemap.
654654
*
655655
* @param[in] tilemap Pointer to initialized tilemap structure.
656656
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -662,8 +662,7 @@ void gfx_TransparentTilemap(const gfx_tilemap_t *tilemap,
662662
uint24_t y_offset);
663663

664664
/**
665-
* Draws an unclipped transparent tilemap given an initialized tilemap
666-
* structure.
665+
* Draws an unclipped transparent tilemap.
667666
*
668667
* @param[in] tilemap Pointer to initialized tilemap structure.
669668
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -675,9 +674,8 @@ void gfx_TransparentTilemap_NoClip(const gfx_tilemap_t *tilemap,
675674
uint24_t y_offset);
676675

677676
/**
678-
* Gets a pointer to a particular tile given an initialized tilemap
679-
* structure and pixel offsets. Measurement is done from the actual
680-
* tilemap, not the drawn offset location.
677+
* Gets a pointer to a particular sprite tileset index.
678+
* This function bases position on the pixel offset from the top-left of the tilemap.
681679
*
682680
* @param[in] tilemap Pointer to initialized tilemap structure.
683681
* @param[in] x_offset Offset in pixels from the left of the tilemap.
@@ -688,8 +686,8 @@ uint8_t *gfx_TilePtr(const gfx_tilemap_t *tilemap,
688686
uint24_t y_offset);
689687

690688
/**
691-
* Gets a pointer to a particular tile given an initialized tilemap
692-
* structure and mapped offsets.
689+
* Gets a pointer to a particular sprite tileset index.
690+
* This function uses the corrdinates from the tilemap array.
693691
*
694692
* @param[in] tilemap Pointer to an initialized tilemap structure.
695693
* @param[in] col Column of tile in tilemap.

0 commit comments

Comments
 (0)