YohannDR / mzm

Creative Commons Zero v1.0 Universal
68 stars 12 forks source link

Add SPRITESET_IDX() macro for indexing sprites in room data files #14

Closed 0xb01u closed 10 months ago

0xb01u commented 10 months ago

The room spriteset data indexes the sprites in the used spriteset starting from 17 (16 offset + start-at-1, if I recall correctly). This PR adds the SPRITESET_IDX ("spriteset index") macro, for easier indexing in room data.

#define SPRITESET_IDX(idx) (16 + idx + 1)

Now, to specify the sprite at index 0 in the spriteset, one can write SPRITESET_IDX(0), which I think is clearer. (See changed files for examples.)

All respective room data files have been changed to use this macro.