Skip to content

Conversation

@bobtista
Copy link

Optimizes AudioManager::addAudioEvent() to avoid wasted allocations and computations for sounds that won't play locally.

Changes:

  • Use static string constant to avoid repeated "NoSound" string allocations
  • Check shouldPlayLocally() before expensive operations

//-------------------------------------------------------------------------------------------------
AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
{
#if RETAIL_COMPATIBLE_CRC
Copy link

@Mauller Mauller Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need retail compatible CRC here, audo at this point is client side only.

But to test just build the game in VC6 and run a set of replays back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize AudioManager::addAudioEvent()

2 participants