Advertisement
FatalSleep

Untitled

Aug 25th, 2014
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Prism DLL:
  2. // Creates a new Prism of the indicated size.
  3. // Returns the ID of the Prism created.
  4. PrismCreate(width,height,depth);
  5.  
  6. // Saves the indicated Prism to a file.
  7. // Returns 1 if successful, -1 if failed.
  8. /*
  9. Prism saves in "short" format, in short format every 8 cells
  10. are merged into one cell. This keeps the raw data from being
  11. read by normal humans, but keeps the raw data without data loss.
  12. Amount of bytes saved is the same decompressed and compressed.
  13. */
  14. PrismSave(id,fname);
  15.  
  16. // Loads a Prism from the indicated file.
  17. // Returns the ID of the newly loaded Prism if sucessful, -1 if failed.
  18. /*
  19. Loads the prism saved in short format in the indicated file.
  20. Amount of bytes saved is the same decompressed and compressed.
  21. */
  22. PrismLoad(fname);
  23.  
  24. // Deletes the indicated Prism from memory.
  25. // Returns 1 if successful, -1 if the Prism does not exist.
  26. /*
  27. The target is reset if the Prism being deleted is the current target.
  28. */
  29. PrismDelete(id);
  30.  
  31. // Checks to see if the given Prism exists.
  32. // Returns 1 if successful, -1 if failed.
  33. PrismExists(id);
  34.  
  35. // Sets the indicated Prism as the target for editing.
  36. // Returns 1 if the prism exists, -1 if the prism does not exist.
  37. PrismTarget(id);
  38.  
  39. // Sets the target for editing to null(no target).
  40. // Returns 1.
  41. PrismReset();
  42.  
  43. // Checks to see if a target is set.
  44. // Returns 1 if a target is set, -1 if not set.
  45. PrismHasTarget();
  46.  
  47. // Returns the ID of the current target.
  48. PrismAddress();
  49.  
  50. // Resets the target to null and deletes all existing Prisms from memory.
  51. // Returns the number of Prisms deleted from memory.
  52. PrismDeallocate();
  53.  
  54. // Returns the size of the target in cells(width * height * depth).
  55. // Returns -1 if the prism does not exist.
  56. PrismCells();
  57.  
  58. // Returns the width of the target.
  59. // Returns -1 if the prism does not exist.
  60. PrismWidth();
  61.  
  62. // Returns the height of the target.
  63. // Returns -1 if the prism does not exist.
  64. PrismHeight();
  65.  
  66. // Returns the depth of the target.
  67. // Returns -1 if the prism does not exist.
  68. PrismDepth();
  69.  
  70. // Copies the contents of the source Prism to the destination Prism.
  71. // Returns the total number of cells that could be copied if successful, -1 if failed.
  72. // NOTE: Setting the target is not necessary for this function.
  73. /*
  74. This will copy the ocntents of Prisms of different sizes.
  75. However not all data can always be copied.
  76. For example: a Prism of size 14x16x2 cannot be 100% copied
  77. into a Prism of size 12x20x5.
  78. */
  79. PrismCopy(srce,dest);
  80.  
  81. // Copies the contents of an area of the source Prism to an area of the destination Prism.
  82. // Returns the total number of cells that could be copied if successful, -1 if failed.
  83. // NOTE: Setting the target is not necessary for this function.
  84. /*
  85. NOTE: Out of bounds cells are not registered as set.
  86. */
  87. PrismCopyExt(srce,dest,srcex,srcey,srcez,destx,desty,destz,width,height,depth);
  88.  
  89. // Returns the value of the specified cell.
  90. // Returns -1 if no target is set.
  91. PrismGet(x,y,z);
  92.  
  93. // Returns the value of the specified cell.
  94. /* This function will "wrap" the x,y,z position from one end of the structure to the other
  95. if the position exceeds the size of the structure.
  96. Structure Size: Width: 100, Height: 100, Depth: 100
  97. Example: x: -10, y: -10, z: -10
  98. Wrap Of x,y,z: 90, 90, 90 */
  99. // Returns -1 if no target is set.
  100. PrismGetWrap(x,y,z);
  101.  
  102. // Sets the specified cell to a value.
  103. // Returns -1 if no target is set.
  104. PrismSet(x,y,z,val);
  105.  
  106. // Sets the specified cell to a value.
  107. /* This function will "wrap" the x,y,z position from one end of the structure to the other
  108. if the position exceeds the size of the structure.
  109. Structure Size: Width: 100, Height: 100, Depth: 100
  110. Example: x: -10, y: -10, z: -10
  111. Wrap Of x,y,z: 90, 90, 90 */
  112. // Returns -1 if no target is set.
  113. PrismSetWrap(x,y,z);
  114.  
  115. // Adds a value to the current value to the specified cell.
  116. // Returns -1 if no target is set.
  117. PrismAdd(x,y,z,val);
  118.  
  119. // Subtracts a value from the current value of the specified cell.
  120. // Returns -1 if no target is set.
  121. PrismSubtract(x,y,z,val);
  122.  
  123. // Multiplies the value of the specified cell by a value.
  124. // Returns -1 if no target is set.
  125. PrismMultiply(x,y,z,val);
  126.  
  127. // Divides the value of the specified cell by a value.
  128. // Returns -1 if no target is set.
  129. PrismDivide(z,y,x,val);
  130.  
  131. // Performs a modulo operation on the value of the current cell by a value.
  132. // Returns -1 if no target is set.
  133. PrismModulo(x,y,z,val);
  134.  
  135. // Bit-shifts the value of the specified cell by a value in the desired direction.
  136. // Returns -1 if no target is set.
  137. /*
  138. Shift if set to 0, shifts left, if set to 1, shifts right.
  139. */
  140. PrismBitShift(x,y,z,val,shift);
  141.  
  142. // Performs a bitwise AND operation on the value of the current cell by a value.
  143. // Returns -1 if no target is set.
  144. PrismBitAnd(x,y,z,val);
  145.  
  146. // Performs a bitwise OR operation on the value of the current cell by a value.
  147. // Returns -1 if no target is set.
  148. PrismBitOr(x,y,z,val);
  149.  
  150. // Performs a bitwise XOR operation o nthe value of the current cell by a value.
  151. // Returns -1 if no target is set.
  152. PrismBitXor(x,y,z,val);
  153.  
  154. // Sets an area of cells of the target to a value.
  155. // Returns the number of in-bounds cells that could be set.
  156. // Returns -1 if no target is set.
  157. PrismAreaSet(x,y,z,width,height,depth,val);
  158.  
  159. // Adds a value to an area of cells of the target.
  160. // Returns the number of in-bounds cells that could be added.
  161. // Returns -1 if no target is set.
  162. PrismAreaAdd(x,y,z,width,height,depth,val);
  163.  
  164. // Subtracts a value from an area of cells of the target.
  165. // Returns the number of in-bounds cells that could be subtracted.
  166. // Returns -1 if no target is set.
  167. PrismAreaSubtract(x,y,z,width,height,depth,val);
  168.  
  169. // Multiplies a value to an area of cells of the target.
  170. // Returns the number of in-bounds cells that could be multiplied.
  171. // Returns -1 if no target is set.
  172. PrismAreaMultiply(x,y,z,width,height,depth,val);
  173.  
  174. // Divides a value from an area of cells of the target.
  175. // Returns the number of in-bounds cells that could be divided.
  176. // Returns -1 if no target is set.
  177. PrismAreaDivide(x,y,z,width,height,depth,val);
  178.  
  179. // Performs a modulo operation on an area of cells of the target.
  180. // Returns the number of in-bounds cells that could be modulo'd.
  181. // Returns -1 if no target is set.
  182. PrismAreaModulo(x,y,z,width,height,depth,val);
  183.  
  184. // Bitshifts an area of cells of the target by a value.
  185. // Returns the number of in-bounds cells that could be bit-shifted.
  186. // Returns -1 if no target is set.
  187. PrismAreaBitshift(x,y,z,width,height,depth,val,shift);
  188.  
  189. // Performs a bitwise AND operation on an area of cells by a value.
  190. // Returns the number of in-bounds cells that could be bitwise AND set.
  191. // Returns -1 if no target is set.
  192. PrismAreaBitAnd(x,y,z,width,height,depth,val);
  193.  
  194. // Performs a bitwise OR operation on an area of cells by a value.
  195. // Returns the number of in-bounds cells that could be bitwise OR set.
  196. // Returns -1 if no target is set.
  197. PrismAreaBitOr(x,y,z,width,height,depth,val);
  198.  
  199. // Performs a bitwise XOR operation on an area of cells by a value.
  200. // Returns the number of in-bounds cells that could be bitwise XOR set.
  201. // Returns -1 if no target is set.
  202. PrismAreaBitXor(x,y,z,width,height,depth,val);
  203.  
  204. // Returns the sum of the indicated area of cells.
  205. // Returns -1 if no target is set.
  206. PrismAreaSum(x,y,z,width,height,depth);
  207.  
  208. // Returns the minimum value of the indicated area of cells.
  209. // Returns -1 if no target is set.
  210. PrismAreaMin(x,y,z,width,height,depth);
  211.  
  212. // Returns the maximum value of the indicated area of cells.
  213. // Returns -1 if no target is set.
  214. PrismAreaMax(x,y,z,width,height,depth);
  215.  
  216. // Returns the mean(average) value of the indicated area of cells.
  217. // Returns -1 if no target is set.
  218. PrismAreaMean(x,y,z,width,height,depth);
  219.  
  220. // Returns 1 if all of the cells of an area are within a minimum and maximum range.
  221. // Returns -1 if no target is set.
  222. PrismAreaRange(x,y,z,width,height,depth,min,max);
  223.  
  224. // Sets a spherical-area of cells of the target to a value.
  225. // Returns the number of in-bounds cells that could be set.
  226. // Returns -1 if no target is set.
  227. PrismSphereSet(x,y,z,radius,val);
  228.  
  229. // Adds a value to a spherical-area of cells of the target.
  230. // Returns the number of in-bounds cells that could be added.
  231. // Returns -1 if no target is set.
  232. PrismSphereAdd(x,y,z,radius,val);
  233.  
  234. // Subtracts a value from a spherical-area of cells of the target.
  235. // Returns the number of in-bounds cells that could be subtracted.
  236. // Returns -1 if no target is set.
  237. PrismSphereSubtract(x,y,z,radius,val);
  238.  
  239. // Multiplies a value to a spherical-area of cells of the target.
  240. // Returns the number of in-bounds cells that could be multiplied.
  241. // Returns -1 if no target is set.
  242. PrismSphereMultiply(x,y,z,radius,val);
  243.  
  244. // Divides a value from a spherical-area of cells of the target.
  245. // Returns the number of in-bounds cells that could be divided.
  246. // Returns -1 if no target is set.
  247. PrismSphereDivide(x,y,z,radius,val);
  248.  
  249. // Performs a modulo operation on a spherical-area of cells of the target.
  250. // Returns the number of in-bounds cells that could be modulo'd.
  251. // Returns -1 if no target is set.
  252. PrismSphereModulo(x,y,z,radius,val);
  253.  
  254. // Bitshifts a spherical-area of cells of the target by a value.
  255. // Returns the number of in-bounds cells that could be bit-shifted.
  256. // Returns -1 if no target is set.
  257. PrismSphereBitshift(x,y,z,radius,val,shift);
  258.  
  259. // Performs a bitwise AND operation on a spherical-area of cells by a value.
  260. // Returns the number of in-bounds cells that could be bitwise AND set.
  261. // Returns -1 if no target is set.
  262. PrismSphereBitAnd(x,y,z,radius,val);
  263.  
  264. // Performs a bitwise OR operation on a spherical-area of cells by a value.
  265. // Returns the number of in-bounds cells that could be bitwise OR set.
  266. // Returns -1 if no target is set.
  267. PrismSphereBitOr(x,y,z,radius,val);
  268.  
  269. // Performs a bitwise XOR operation on a spherical-area of cells by a value.
  270. // Returns the number of in-bounds cells that could be bitwise XOR set.
  271. // Returns -1 if no target is set.
  272. PrismSphereBitXor(x,y,z,val);
  273.  
  274. // Returns the sum of the indicated spherical-area of cells.
  275. // Returns -1 if no target is set.
  276. PrismSphereSum(x,y,z,radius);
  277.  
  278. // Returns the minimum value of the indicated spherical-area of cells.
  279. // Returns -1 if no target is set.
  280. PrismSphereMin(x,y,z,radius);
  281.  
  282. // Returns the maximum value of the indicated spherical-area of cells.
  283. // Returns -1 if no target is set.
  284. PrismSphereMax(x,y,z,radius);
  285.  
  286. // Returns the mean(average) value of the indicated spherical-area of cells.
  287. // Returns -1 if no target is set.
  288. PrismSphereMean(x,y,z,radius);
  289.  
  290. // Returns 1 if all of the cells of a spherical-area are within a minimum and maximum range.
  291. // Returns -1 if no target is set.
  292. PrismSphereRange(x,y,z,raidus,min,max);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement