pea
developer
Why are sprite tiles stored in horizontal strips?
When the image is converted from a bmp to a c array, are the pixels stored in vertical cols? This is the only way that I can see that it is more beneficial to store tiles in the same tileset horizontally rather than vertically.
BMP with 2 tiles:
123ABC
456DEF
789GHI
c array as vertical cols:
147258369ADGBEHCFI
This way an offset can be specified (in this case 9) to get the second tile.
If the pixels were stored horizontally:
123ABC456DEF789GHI
You would need to do an offset calculation for every single row of the tile!
Am I correct?
When the image is converted from a bmp to a c array, are the pixels stored in vertical cols? This is the only way that I can see that it is more beneficial to store tiles in the same tileset horizontally rather than vertically.
BMP with 2 tiles:
123ABC
456DEF
789GHI
c array as vertical cols:
147258369ADGBEHCFI
This way an offset can be specified (in this case 9) to get the second tile.
If the pixels were stored horizontally:
123ABC456DEF789GHI
You would need to do an offset calculation for every single row of the tile!
Am I correct?