My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + index of sounds array).
The SoundCollection structure looks like this:
struct SoundCollection{
unsigned char name[64];
unsigned int offset;
unsigned int count;
};
GameObjects can aqcuire a SoundCollectionHandle and use the SoundCollection[SoundCollectionHandle].Offsetoffset in the SoundsSounds array.
GameObjectsGameObjects then can call Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])
Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])
for playing a jump sound. The
The SoundCollection::count is used as offset for next SoundCollectionSoundCollection and bound checking.
The The same thing iI want to use for Sprites and Textures.
Are there any other methods you usealyusually use in your games?