Coh3n
2010-06-30 05:53:27
Hey guys,
I'm not sure exactly where I stand on this, and this has been bounced around since MSI started. Nava was watching me do some work on MSI on the weekend, and he suggested using global arrays for things such as items, objects, script, etc. Now, up until last weekend, there was always an MSI_Item array that stored the loaded items. Up until about now, I didn't know why it was like this, but I'm starting to think that we could have kept it that way.
Pros
That is all,
Coh3n
I'm not sure exactly where I stand on this, and this has been bounced around since MSI started. Nava was watching me do some work on MSI on the weekend, and he suggested using global arrays for things such as items, objects, script, etc. Now, up until last weekend, there was always an MSI_Item array that stored the loaded items. Up until about now, I didn't know why it was like this, but I'm starting to think that we could have kept it that way.
var
MSI_Item: array[0..(ITEM_COUNT - 1)] of TItem;
MSI_Object: array[0..(OBJECT_COUNT)] of TMSObject;
MSI_Script: array[0..(SCRIPT_COUNT)] of TScript;
This would avoid loading and freeing (TItem) all the time. Just loading everything in the memory once would probably save some time. I just wanted to see what other people think about this. Would it be better to use global arrays, or just stick with what we currently have?Pros
- No loading/freeing. Everthing's only loaded once.
- To use, all that would be needed:
MSI_Object[OBJ_TREE_NORMAL].Colors;
Cons- May slow down the script by having everything already in memory (still not sure about this).
That is all,
Coh3n