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].offset
in the Sounds
array.
GameObjects
then can call
Audio.playsound(Sounds[SoundCollection[SoundCollectionHandle].offset + PlayerSounds::Jump])
for playing a jump sound.
The SoundCollection::count
is used as offset for next SoundCollection
and bound checking. The same thing I want to use for Sprites and Textures.
Are there any other methods you usually use in your games?