src/newgrf_sound.cpp
changeset 7897 222641b84fc4
parent 6674 64f4781b4653
child 6870 ca3fd1fbe311
equal deleted inserted replaced
7896:2a4cdd5ca7d5 7897:222641b84fc4
    18 
    18 
    19 /* Allocate a new FileEntry */
    19 /* Allocate a new FileEntry */
    20 FileEntry *AllocateFileEntry()
    20 FileEntry *AllocateFileEntry()
    21 {
    21 {
    22 	if (_sound_count == GetSoundInternalPoolSize()) {
    22 	if (_sound_count == GetSoundInternalPoolSize()) {
    23 		if (!AddBlockToPool(&_SoundInternal_pool)) return NULL;
    23 		if (!_SoundInternal_pool.AddBlockToPool()) return NULL;
    24 	}
    24 	}
    25 
    25 
    26 	return GetSoundInternal(_sound_count++);
    26 	return GetSoundInternal(_sound_count++);
    27 }
    27 }
    28 
    28 
    29 
    29 
    30 void InitializeSoundPool()
    30 void InitializeSoundPool()
    31 {
    31 {
    32 	CleanPool(&_SoundInternal_pool);
    32 	_SoundInternal_pool.CleanPool();
    33 	_sound_count = 0;
    33 	_sound_count = 0;
    34 
    34 
    35 	/* Copy original sound data to the pool */
    35 	/* Copy original sound data to the pool */
    36 	SndCopyToPool();
    36 	SndCopyToPool();
    37 }
    37 }