blocks.cpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. #include "blocks.h"
  2. int atlasData[] =
  3. {
  4. //front
  5. 0, 0,
  6. 3, 15, //grass
  7. 2, 15, // dirt
  8. 1, 15, //stone
  9. 3, 11, //ice
  10. 4, 14,//log
  11. 4, 15,//wooden_plank
  12. 0, 14,//cobblestone
  13. 7, 14,//gold_block
  14. 7, 15,//bricks
  15. 2, 14,//sand
  16. 0, 3,//sand_stone
  17. 4, 11,//snow_dirt
  18. 5, 12,//leaves
  19. 0, 13, // gold ore
  20. 2, 13, // coal ore
  21. 6, 12, //stone brick
  22. 1, 13, // iron ore
  23. 2, 12, // diamond ore
  24. 3, 13, //block shelf
  25. 5, 8, //birch wood
  26. 3, 14, //gravel
  27. 7, 13,//herbs
  28. 12, 15,//rose
  29. 6, 14,//iron block
  30. 9, 9, //glowstone
  31. 3, 12,//redstone ore
  32. 11, 12,//crafting table
  33. 13, 12,//furnace on
  34. 12, 13,//furnace off
  35. 5, 4, //glass
  36. 0, 7, //hay
  37. //back
  38. 0, 0,
  39. 3, 15, //grass
  40. 2, 15, // dirt
  41. 1, 15, //stone
  42. 3, 11, //ice
  43. 4, 14,//log
  44. 4, 15,//wooden_plank
  45. 0, 14,//cobblestone
  46. 7, 14,//gold_block
  47. 7, 15,//bricks
  48. 2, 14,//sand
  49. 0, 3,//sand_stone
  50. 4, 11,//snow_dirt
  51. 5, 12,//leaves
  52. 0, 13, // gold ore
  53. 2, 13, // coal ore
  54. 6, 12, //stone brick
  55. 1, 13, // iron ore
  56. 2, 12, // diamond ore
  57. 3, 13, //block shelf
  58. 5, 8, //birch wood
  59. 3, 14, //gravel
  60. 7, 13,//herbs
  61. 12, 15,//rose
  62. 6, 14,//iron block
  63. 9, 9, //glowstone
  64. 3, 12,//redstone ore
  65. 11, 12,//crafting table
  66. 13, 13,//furnace on
  67. 13, 13,//furnace off
  68. 5, 4, //glass
  69. 0, 7, //hay
  70. //top
  71. 0, 0,
  72. 0, 15, //grass
  73. 2, 15, // dirt
  74. 1, 15, //stone
  75. 3, 11, //ice
  76. 4, 14,//log
  77. 4, 15,//wooden_plank
  78. 0, 14,//cobblestone
  79. 7, 14,//gold_block
  80. 7, 15,//bricks
  81. 2, 14,//sand
  82. 0, 4,//sand_stone
  83. 2, 11,// snow_grass
  84. 5, 12,//leaves
  85. 0, 13, // gold ore
  86. 2, 13, // coal ore
  87. 6, 12, //stone brick
  88. 1, 13, // iron ore
  89. 2, 12, // diamond ore
  90. 4, 15, //block shelf
  91. 5, 14, //birch wood
  92. 3, 14, //gravel
  93. 7, 13,//herbs
  94. 12, 15,//rose
  95. 6, 14,//iron block
  96. 9, 9, //glowstone
  97. 3, 12,//redstone ore
  98. 11, 13,//crafting table
  99. 14, 12,//furnace on
  100. 14, 12,//furnace off
  101. 5, 4, //glass
  102. 0, 8, //hay
  103. //bottom
  104. 0, 0,
  105. 2, 15, //grass
  106. 2, 15, // dirt
  107. 1, 15, //stone
  108. 3, 11, //ice
  109. 5, 14,//log
  110. 4, 15,//wooden_plank
  111. 0, 14,//cobblestone
  112. 7, 14,//gold_block
  113. 7, 15,//bricks
  114. 2, 14,//sand
  115. 0, 2,//sand_stone
  116. 2, 15, // snow_grass
  117. 5, 12,//leaves
  118. 0, 13, // gold ore
  119. 2, 13, // coal ore
  120. 6, 12, //stone brick
  121. 1, 13, // iron ore
  122. 2, 12, // diamond ore
  123. 4, 15, //block shelf
  124. 5, 14, //birch wood
  125. 3, 14, //gravel
  126. 7, 13,//herbs
  127. 12, 15,//rose
  128. 6, 14,//iron block
  129. 9, 9, //glowstone
  130. 3, 12,//redstone ore
  131. 4, 15,//crafting table
  132. 14, 12,//furnace on
  133. 14, 12,//furnace off
  134. 5, 4, //glass
  135. 0, 8, //hay
  136. //left
  137. 0, 0,
  138. 3, 15, //grass
  139. 2, 15, // dirt
  140. 1, 15, //stone
  141. 3, 11, //ice
  142. 4, 14,//log
  143. 4, 15,//wooden_plank
  144. 0, 14,//cobblestone
  145. 7, 14,//gold_block
  146. 7, 15,//bricks
  147. 2, 14,//sand
  148. 0, 3,//sand_stone
  149. 4, 11,//snow_dirt
  150. 5, 12,//leaves
  151. 0, 13, // gold ore
  152. 2, 13, // coal ore
  153. 6, 12, //stone brick
  154. 1, 13, // iron ore
  155. 2, 12, // diamond ore
  156. 3, 13, //block shelf
  157. 5, 8, //birch wood
  158. 3, 14, //gravel
  159. 7, 13,//herbs
  160. 12, 15,//rose
  161. 6, 14,//iron block
  162. 9, 9, //glowstone
  163. 3, 12,//redstone ore
  164. 12, 12,//crafting table
  165. 13, 13,//furnace on
  166. 13, 13,//furnace off
  167. 5, 4, //glass
  168. 0, 7, //hay
  169. //right
  170. 0, 0,
  171. 3, 15, //grass
  172. 2, 15, // dirt
  173. 1, 15, //stone
  174. 3, 11, //ice
  175. 4, 14,//log
  176. 4, 15,//wooden_plank
  177. 0, 14,//cobblestone
  178. 7, 14,//gold_block
  179. 7, 15,//bricks
  180. 2, 14,//sand
  181. 0, 3,//sand_stone
  182. 4, 11,//snow_dirt
  183. 5, 12,//leaves
  184. 0, 13, // gold ore
  185. 2, 13, // coal ore
  186. 6, 12, //stone brick
  187. 1, 13, // iron ore
  188. 2, 12, // diamond ore
  189. 3, 13, //block shelf
  190. 5, 8, //birch wood
  191. 3, 14, //gravel
  192. 7, 13,//herbs
  193. 12, 15,//rose
  194. 6, 14,//iron block
  195. 9, 9, //glowstone
  196. 3, 12,//redstone ore
  197. 12, 12,//crafting table
  198. 13, 13,//furnace on
  199. 13, 13,//furnace off
  200. 5, 4, //glass
  201. 0, 7, //hay
  202. };
  203. const int padd = BlockTypes::BlocksCount * 2;
  204. glm::vec2 getAtlasTop(int type)
  205. {
  206. return glm::vec2( atlasData[padd * 2 + type * 2] , atlasData[padd * 2 + type * 2 + 1] );
  207. }
  208. glm::vec2 getAtlasBottom(int type)
  209. {
  210. return glm::vec2(atlasData[padd * 3 + type * 2], atlasData[padd * 3 + type * 2 + 1]);
  211. }
  212. glm::vec2 getAtlasLeft(int type)
  213. {
  214. return glm::vec2(atlasData[padd * 4 + type * 2], atlasData[padd * 4 + type * 2 + 1]);
  215. }
  216. glm::vec2 getAtlasRight(int type)
  217. {
  218. return glm::vec2(atlasData[padd * 5 + type * 2], atlasData[padd * 5 + type * 2 + 1]);
  219. }
  220. glm::vec2 getAtlasFront(int type)
  221. {
  222. return glm::vec2(atlasData[type * 2], atlasData[type * 2 + 1]);
  223. }
  224. glm::vec2 getAtlasBack(int type)
  225. {
  226. return glm::vec2(atlasData[padd + type * 2], atlasData[padd + type * 2 + 1]);
  227. }