Skip to content

Releases: monkey0506/ags-module-stack

v2.0

Choose a tag to compare

@monkey0506 monkey0506 released this 30 Jun 14:53

The biggest news is that this version of the module is fast because I can use dynamic arrays in structs now. The current limitations on managed structs led me to some suboptimal code when working with Strings, but I can pretty consistently push one million ints (the current max size for a dynamic array btw) into a Stack in a single for loop in only about 30 seconds! By way of comparison, with v1.3 I tried pushing a measly ten thousand ints into a Stack and the program froze for more than half an hour before I force-closed it with Task Manager. I can push ten thousand ints with this version in under a second.

To really optimize the speed, I made it possible to set the capacity of a Stack (setting the size of the underlying dynamic array) and avoid additional copying. Considering how much unnecessary copying was taking place in v1.3 of this module, anyone who actually used the older module should be quite happy with the improvements I've made.

v1.3

Choose a tag to compare

@monkey0506 monkey0506 released this 30 Jun 14:28

v1.3 is more bug fixing. Specifically String.Format has a limit on the length of the returned String, so where applicable I've replaced it with instances of String.Append (which has no limit). Further I modified the way that stack objects get pushed in to make it more secure. Previously if you pushed the same stack copy onto a stack multiple times it could potentially corrupt the internal data structure. This version completely resolves that possibility.

v1.2

Choose a tag to compare

@monkey0506 monkey0506 released this 30 Jun 14:27

v1.2 of the module includes:

  • The new functions Stack.GetItemsArray, File.WriteStack, File.ReadStackBack, and Stack.LoadFromFile.
  • Improved formatting of Stack.Copy to further prevent fatal error-inducing collisions.
  • Bug fix for Stack.Push where if you were specifying an index the ItemCount was still getting increased.
  • Adds the data type eStackDataInvalid to denote when the data stored is not valid StackData.

v1.0

Choose a tag to compare

@monkey0506 monkey0506 released this 30 Jun 14:26

Initial release of the module.

v1.2a

Choose a tag to compare

@monkey0506 monkey0506 released this 30 Jun 14:27

v1.2a is just a quick bug fix. Stack.GetItemsArray would request a zero-sized array which AGS doesn't like for some reason so I just put a quick check to prevent that.