| 121 | } |
| 122 | |
| 123 | void cSound_PC::Sound_Play( int16 pTileset, int16 pSoundEffect, int16 pVolume, int16 pIndex) { |
| 124 | sChunkPlaying Playing; |
| 125 | auto eax = word_42316[pTileset][pSoundEffect]; |
| 126 | if (!eax || !eax->size() || mSound == false ) |
| 127 | return; |
| 128 | |
| 129 | SDL_RWops *rw = SDL_RWFromMem( eax->data(), (int) eax->size() ); |
| 130 | |
| 131 | Playing.mCurrentChunk = Mix_LoadWAV_RW( rw, 1 ); |
| 132 | Playing.mChannel = Mix_PlayChannel( -1, Playing.mCurrentChunk , 0 ); |
| 133 | Mix_Volume(Playing.mChannel, pVolume ); |
| 134 | |
| 135 | if (Playing.mChannel == -1) { |
| 136 | Mix_FreeChunk( Playing.mCurrentChunk ); |
| 137 | return; |
| 138 | } |
| 139 | |
| 140 | mMixerChunks.push_back( Playing ); |
| 141 | } |
| 142 | |
| 143 | void cSound_PC::Music_PlayFile( const std::string& pFilename ) { |
| 144 | |