You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 lines
9.7KB

  1. #[derive(Debug, Clone, Copy)]
  2. pub struct SpriteLocation {
  3. // location of sprite on tilesheet
  4. pub row: i32,
  5. pub col: i32,
  6. }
  7. #[derive(Debug, Clone, Copy, PartialEq, Eq)]
  8. pub enum Sprite {
  9. // row 0
  10. Blank,
  11. BlockTopDownWood,
  12. BlockTopDownRed,
  13. BlockTopDownBlue,
  14. BlockTopDownGreen,
  15. BlockTopDownStone,
  16. BlockAngledWood,
  17. BlockAngledRed,
  18. BlockAngledBlue,
  19. BlockAngledGreen,
  20. BlockAngledStone,
  21. Hole,
  22. Black,
  23. // row 1
  24. MarkerFaded2,
  25. BlockTopDownDarkWood,
  26. BlockTopDownDarkRed,
  27. BlockTopDownDarkBlue,
  28. BlockTopDownDarkGreen,
  29. BlockTopDownDarkStone,
  30. BlockAngledDarkWood,
  31. BlockAngledDarkRed,
  32. BlockAngledDarkBlue,
  33. BlockAngledDarkGreen,
  34. BlockAngledDarkStone,
  35. HoleWood,
  36. BlockTopDownSpotWood,
  37. // row 2
  38. MarkerFaded1,
  39. BlockTopDownDirtyWood,
  40. BlockTopDownDirtyRed,
  41. BlockTopDownDirtyBlue,
  42. BlockTopDownDirtyGreen,
  43. BlockTopDownDirtyStone,
  44. BlockAngledDirtyWood,
  45. BlockAngledDirtyRed,
  46. BlockAngledDirtyBlue,
  47. BlockAngledDirtyGreen,
  48. BlockAngledDirtyStone,
  49. HoleRed,
  50. BlockTopDownSpotRed,
  51. // row 3
  52. Marker,
  53. BlockTopDownMarkerWood,
  54. BlockTopDownMarkerRed,
  55. BlockTopDownMarkerBlue,
  56. BlockTopDownMarkerGreen,
  57. BlockTopDownMarkerStone,
  58. BlockAngledFlatWood,
  59. BlockAngledFlatRed,
  60. BlockAngledFlatBlue,
  61. BlockAngledFlatGreen,
  62. BlockAngledFlatStone,
  63. HoleBlue,
  64. BlockTopDownSpotBlue,
  65. // row 4
  66. HeroSouth0,
  67. HeroSouth1,
  68. HeroSouth2,
  69. HeroNorth0,
  70. HeroNorth1,
  71. HeroNorth2,
  72. BlockAngledSunkWood,
  73. BlockAngledSunkRed,
  74. BlockAngledSunkBlue,
  75. BlockAngledSunkGreen,
  76. BlockAngledSunkStone,
  77. HoleGreen,
  78. BlockTopDownSpotGreen,
  79. // row 5
  80. HeroOutlinedSouth0,
  81. HeroOutlinedSouth1,
  82. HeroOutlinedSouth2,
  83. HeroOutlinedNorth0,
  84. HeroOutlinedNorth1,
  85. HeroOutlinedNorth2,
  86. HeroHead,
  87. HeroOutlinedHead,
  88. HeroHeadAlpha,
  89. Coin,
  90. CoinOutlined,
  91. HoleStone,
  92. BlockTopDownSpotStone,
  93. // row 6
  94. HeroEast0,
  95. HeroEast1,
  96. HeroEast2,
  97. HeroWest0,
  98. HeroWest1,
  99. HeroWest2,
  100. WallRed0,
  101. WallRed,
  102. WallStone,
  103. WallWood,
  104. FloorGreen,
  105. FloorStone,
  106. FloorWood,
  107. // row 7
  108. HeroOutlinedEast0,
  109. HeroOutlinedEast1,
  110. HeroOutlinedEast2,
  111. HeroOutlinedWest0,
  112. HeroOutlinedWest1,
  113. HeroOutlinedWest2,
  114. ChimneyRed0,
  115. ChimneyRed,
  116. ChimneyStone,
  117. ChimneyWood,
  118. FloorMarkerGreen,
  119. FloorMarkerStone,
  120. FloorMarkerWood,
  121. }
  122. pub fn get_sprite_location(sprite: Sprite) -> SpriteLocation {
  123. match sprite {
  124. Sprite::Blank => SpriteLocation { row: 0, col: 0 },
  125. Sprite::BlockTopDownWood => SpriteLocation { row: 0, col: 1 },
  126. Sprite::BlockTopDownRed => SpriteLocation { row: 0, col: 2 },
  127. Sprite::BlockTopDownBlue => SpriteLocation { row: 0, col: 3 },
  128. Sprite::BlockTopDownGreen => SpriteLocation { row: 0, col: 4 },
  129. Sprite::BlockTopDownStone => SpriteLocation { row: 0, col: 5 },
  130. Sprite::BlockAngledWood => SpriteLocation { row: 0, col: 6 },
  131. Sprite::BlockAngledRed => SpriteLocation { row: 0, col: 7 },
  132. Sprite::BlockAngledBlue => SpriteLocation { row: 0, col: 8 },
  133. Sprite::BlockAngledGreen => SpriteLocation { row: 0, col: 9 },
  134. Sprite::BlockAngledStone => SpriteLocation { row: 0, col: 10 },
  135. Sprite::Hole => SpriteLocation { row: 0, col: 11 },
  136. Sprite::Black => SpriteLocation { row: 0, col: 12 },
  137. Sprite::MarkerFaded2 => SpriteLocation { row: 1, col: 0 },
  138. Sprite::BlockTopDownDarkWood => SpriteLocation { row: 1, col: 1 },
  139. Sprite::BlockTopDownDarkRed => SpriteLocation { row: 1, col: 2 },
  140. Sprite::BlockTopDownDarkBlue => SpriteLocation { row: 1, col: 3 },
  141. Sprite::BlockTopDownDarkGreen => SpriteLocation { row: 1, col: 4 },
  142. Sprite::BlockTopDownDarkStone => SpriteLocation { row: 1, col: 5 },
  143. Sprite::BlockAngledDarkWood => SpriteLocation { row: 1, col: 6 },
  144. Sprite::BlockAngledDarkRed => SpriteLocation { row: 1, col: 7 },
  145. Sprite::BlockAngledDarkBlue => SpriteLocation { row: 1, col: 8 },
  146. Sprite::BlockAngledDarkGreen => SpriteLocation { row: 1, col: 9 },
  147. Sprite::BlockAngledDarkStone => SpriteLocation { row: 1, col: 10 },
  148. Sprite::HoleWood => SpriteLocation { row: 1, col: 11 },
  149. Sprite::BlockTopDownSpotWood => SpriteLocation { row: 1, col: 12 },
  150. Sprite::MarkerFaded1 => SpriteLocation { row: 2, col: 0 },
  151. Sprite::BlockTopDownDirtyWood => SpriteLocation { row: 2, col: 1 },
  152. Sprite::BlockTopDownDirtyRed => SpriteLocation { row: 2, col: 2 },
  153. Sprite::BlockTopDownDirtyBlue => SpriteLocation { row: 2, col: 3 },
  154. Sprite::BlockTopDownDirtyGreen => SpriteLocation { row: 2, col: 4 },
  155. Sprite::BlockTopDownDirtyStone => SpriteLocation { row: 2, col: 5 },
  156. Sprite::BlockAngledDirtyWood => SpriteLocation { row: 2, col: 6 },
  157. Sprite::BlockAngledDirtyRed => SpriteLocation { row: 2, col: 7 },
  158. Sprite::BlockAngledDirtyBlue => SpriteLocation { row: 2, col: 8 },
  159. Sprite::BlockAngledDirtyGreen => SpriteLocation { row: 2, col: 9 },
  160. Sprite::BlockAngledDirtyStone => SpriteLocation { row: 2, col: 10 },
  161. Sprite::HoleRed => SpriteLocation { row: 2, col: 11 },
  162. Sprite::BlockTopDownSpotRed => SpriteLocation { row: 2, col: 12 },
  163. Sprite::Marker => SpriteLocation { row: 3, col: 0 },
  164. Sprite::BlockTopDownMarkerWood => SpriteLocation { row: 3, col: 1 },
  165. Sprite::BlockTopDownMarkerRed => SpriteLocation { row: 3, col: 2 },
  166. Sprite::BlockTopDownMarkerBlue => SpriteLocation { row: 3, col: 3 },
  167. Sprite::BlockTopDownMarkerGreen => SpriteLocation { row: 3, col: 4 },
  168. Sprite::BlockTopDownMarkerStone => SpriteLocation { row: 3, col: 5 },
  169. Sprite::BlockAngledFlatWood => SpriteLocation { row: 3, col: 6 },
  170. Sprite::BlockAngledFlatRed => SpriteLocation { row: 3, col: 7 },
  171. Sprite::BlockAngledFlatBlue => SpriteLocation { row: 3, col: 8 },
  172. Sprite::BlockAngledFlatGreen => SpriteLocation { row: 3, col: 9 },
  173. Sprite::BlockAngledFlatStone => SpriteLocation { row: 3, col: 10 },
  174. Sprite::HoleBlue => SpriteLocation { row: 3, col: 11 },
  175. Sprite::BlockTopDownSpotBlue => SpriteLocation { row: 3, col: 12 },
  176. Sprite::HeroSouth0 => SpriteLocation { row: 4, col: 0 },
  177. Sprite::HeroSouth1 => SpriteLocation { row: 4, col: 1 },
  178. Sprite::HeroSouth2 => SpriteLocation { row: 4, col: 2 },
  179. Sprite::HeroNorth0 => SpriteLocation { row: 4, col: 3 },
  180. Sprite::HeroNorth1 => SpriteLocation { row: 4, col: 4 },
  181. Sprite::HeroNorth2 => SpriteLocation { row: 4, col: 5 },
  182. Sprite::BlockAngledSunkWood => SpriteLocation { row: 4, col: 6 },
  183. Sprite::BlockAngledSunkRed => SpriteLocation { row: 4, col: 7 },
  184. Sprite::BlockAngledSunkBlue => SpriteLocation { row: 4, col: 8 },
  185. Sprite::BlockAngledSunkGreen => SpriteLocation { row: 4, col: 9 },
  186. Sprite::BlockAngledSunkStone => SpriteLocation { row: 4, col: 10 },
  187. Sprite::HoleGreen => SpriteLocation { row: 4, col: 11 },
  188. Sprite::BlockTopDownSpotGreen => SpriteLocation { row: 4, col: 12 },
  189. Sprite::HeroOutlinedSouth0 => SpriteLocation { row: 5, col: 0 },
  190. Sprite::HeroOutlinedSouth1 => SpriteLocation { row: 5, col: 1 },
  191. Sprite::HeroOutlinedSouth2 => SpriteLocation { row: 5, col: 2 },
  192. Sprite::HeroOutlinedNorth0 => SpriteLocation { row: 5, col: 3 },
  193. Sprite::HeroOutlinedNorth1 => SpriteLocation { row: 5, col: 4 },
  194. Sprite::HeroOutlinedNorth2 => SpriteLocation { row: 5, col: 5 },
  195. Sprite::HeroHead => SpriteLocation { row: 5, col: 6 },
  196. Sprite::HeroOutlinedHead => SpriteLocation { row: 5, col: 7 },
  197. Sprite::HeroHeadAlpha => SpriteLocation { row: 5, col: 8 },
  198. Sprite::Coin => SpriteLocation { row: 5, col: 9 },
  199. Sprite::CoinOutlined => SpriteLocation { row: 5, col: 10 },
  200. Sprite::HoleStone => SpriteLocation { row: 5, col: 11 },
  201. Sprite::BlockTopDownSpotStone => SpriteLocation { row: 5, col: 12 },
  202. Sprite::HeroEast0 => SpriteLocation { row: 6, col: 0 },
  203. Sprite::HeroEast1 => SpriteLocation { row: 6, col: 1 },
  204. Sprite::HeroEast2 => SpriteLocation { row: 6, col: 2 },
  205. Sprite::HeroWest0 => SpriteLocation { row: 6, col: 3 },
  206. Sprite::HeroWest1 => SpriteLocation { row: 6, col: 4 },
  207. Sprite::HeroWest2 => SpriteLocation { row: 6, col: 5 },
  208. Sprite::WallRed0 => SpriteLocation { row: 6, col: 6 },
  209. Sprite::WallRed => SpriteLocation { row: 6, col: 7 },
  210. Sprite::WallStone => SpriteLocation { row: 6, col: 8 },
  211. Sprite::WallWood => SpriteLocation { row: 6, col: 9 },
  212. Sprite::FloorGreen => SpriteLocation { row: 6, col: 10 },
  213. Sprite::FloorStone => SpriteLocation { row: 6, col: 11 },
  214. Sprite::FloorWood => SpriteLocation { row: 6, col: 12 },
  215. Sprite::HeroOutlinedEast0 => SpriteLocation { row: 7, col: 0 },
  216. Sprite::HeroOutlinedEast1 => SpriteLocation { row: 7, col: 1 },
  217. Sprite::HeroOutlinedEast2 => SpriteLocation { row: 7, col: 2 },
  218. Sprite::HeroOutlinedWest0 => SpriteLocation { row: 7, col: 3 },
  219. Sprite::HeroOutlinedWest1 => SpriteLocation { row: 7, col: 4 },
  220. Sprite::HeroOutlinedWest2 => SpriteLocation { row: 7, col: 5 },
  221. Sprite::ChimneyRed0 => SpriteLocation { row: 7, col: 6 },
  222. Sprite::ChimneyRed => SpriteLocation { row: 7, col: 7 },
  223. Sprite::ChimneyStone => SpriteLocation { row: 7, col: 8 },
  224. Sprite::ChimneyWood => SpriteLocation { row: 7, col: 9 },
  225. Sprite::FloorMarkerGreen => SpriteLocation { row: 7, col: 10 },
  226. Sprite::FloorMarkerStone => SpriteLocation { row: 7, col: 11 },
  227. Sprite::FloorMarkerWood => SpriteLocation { row: 7, col: 12 },
  228. }
  229. }