Update to 1.10.0-beta1
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
static SmallVector<SoundEntry, 8> _sounds;
|
||||
static std::vector<SoundEntry> _sounds;
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,15 +32,15 @@ static SmallVector<SoundEntry, 8> _sounds;
|
||||
*/
|
||||
SoundEntry *AllocateSound(uint num)
|
||||
{
|
||||
SoundEntry *sound = _sounds.Append(num);
|
||||
MemSetT(sound, 0, num);
|
||||
return sound;
|
||||
size_t pos = _sounds.size();
|
||||
_sounds.insert(_sounds.end(), num, SoundEntry());
|
||||
return &_sounds[pos];
|
||||
}
|
||||
|
||||
|
||||
void InitializeSoundPool()
|
||||
{
|
||||
_sounds.Clear();
|
||||
_sounds.clear();
|
||||
|
||||
/* Copy original sound data to the pool */
|
||||
SndCopyToPool();
|
||||
@@ -49,14 +49,14 @@ void InitializeSoundPool()
|
||||
|
||||
SoundEntry *GetSound(SoundID index)
|
||||
{
|
||||
if (index >= _sounds.Length()) return NULL;
|
||||
if (index >= _sounds.size()) return nullptr;
|
||||
return &_sounds[index];
|
||||
}
|
||||
|
||||
|
||||
uint GetNumSounds()
|
||||
{
|
||||
return _sounds.Length();
|
||||
return (uint)_sounds.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ SoundID GetNewGRFSoundID(const GRFFile *file, SoundID sound_id)
|
||||
if (sound_id < ORIGINAL_SAMPLE_COUNT) return sound_id;
|
||||
|
||||
sound_id -= ORIGINAL_SAMPLE_COUNT;
|
||||
if (file == NULL || sound_id >= file->num_sounds) return INVALID_SOUND;
|
||||
if (file == nullptr || sound_id >= file->num_sounds) return INVALID_SOUND;
|
||||
|
||||
return file->sound_offset + sound_id;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
|
||||
uint16 callback;
|
||||
|
||||
/* If the engine has no GRF ID associated it can't ever play any new sounds */
|
||||
if (file == NULL) return false;
|
||||
if (file == nullptr) return false;
|
||||
|
||||
/* Check that the vehicle type uses the sound effect callback */
|
||||
if (!HasBit(EngInfo(v->engine_type)->callback_mask, CBM_VEHICLE_SOUND_EFFECT)) return false;
|
||||
|
||||
Reference in New Issue
Block a user