Data storing method

Hey guys, I am developing a game and I got a question.
So, I am loading data files, but not sure about its data storing, here's example: ( pseudocode )
texture.h
1
2
3
4
5
6
// Single texture.
class ncTexture {
byte *data;
int bpp;
... etc
};

So the following "question" is here:

1
2
3
4
// Texture manager.
class ncTextureManager {
void Load( const char * name .. etc 
..

There are three data storing methods, I am not sure which is better to use.
1
2
3
4
5
6
7
8
9
// First, simple array, allocate per texture and set it to array ( tex = new ncTexture(); textureStore[i] = &tex; )
ncTexture textureStore[128];

// Second, allocate an array then point every ncTexture to it while creating ( newTexture = ncTexture(); textureStore[i] = *newTexture )
ncTexture *textureStore = new ncTexture[128];

// Or even, a list ( custom linked list, not stl )
List<ncTexture> textureStore;
}


What method is better to use?
One file(texture) size is ~1-2 mb

Would it affect performance of engine somehow? - Not sure.
Thanks in advance!
Last edited on
Topic archived. No new replies allowed.