I'm making a simple opengl-engine and I need to be able to store series of integers for every class, containing animation frames.
Example: I create the class Dog. The Dog has 3 animations consisting of a number of frame indexes, representing the frame's position in the texture atlas. In the class file I want to define these animations like this:
const int animations[3] = {
{1,2,3}, //walk
{4,5,6}, //jump
{1,7,8,9,10,11} //take a wiz
}
@implementation...
This is ofc not proper Obj-C, but is there a way to do something similar? Every instance of Dog will have the same animations so I dont want to waste memory by storing the animations in instance variables. If possible, I'd like to avoid using NSArray's.
Is there a way to store 2 dimensional, variable length arrays of ints like this at class level?