Hi again,
I have built a (theoretically) wonderful gfx framework for my upcoming games to make life easier, that was the purpose anyway. I’ll explain what it’s all about.
I read a book on ActionScript 3 the other day and there I found a rather good solution for chaining Sprites together, they call it DisplayList in AS. The whole idea is that you’ve got the “stage” where each and every one of the DisplayObjects belong. Then you’ve got DisplayObjectContainers that can hold other DisplayObjectContainers or DisplayObjects. It’s very easy to add or remove sprites to/ from this displayList, swap objects, etc. I copied this idea and I built my own little DislpayList in Java. Works perfectly, it is very comfortable to use, I am a hundred percent satisified with it apart from one thing: it’s fuckin slow.
The problem is ArrayList: I’m using it to keep references of children objects. So every time the program attempts to repaint what’s on the displaylist it has to iterate through all the members which process proved to be a lot slower than what I expected. (I tested it with and without arrayLists, if I use arraylists with only 2-3 objects added to the list I lose 8-10 frames per second… and there are meant to be DOZENS of objects in the displayList, not 2-3!!! )
I KNOW how much quicker simple arrays are but they’ve got a fixed size which makes them absolutely useless in this case. I need a flexible solution but a lot quicker than this stupid arraylist.
Any solution?
Or did anyone understand this gibberish post at all?
Well, any answers are welcome
Greg