Mercurial > mm7
changeset 2516:56b6d74ce716
.
author | Ritor1 |
---|---|
date | Thu, 02 Oct 2014 22:01:06 +0600 |
parents | b96f6cb1855d |
children | 09c3114c6e4e |
files | GUI/UI/UiGame.cpp Media/Audio/AudioPlayer.cpp |
diffstat | 2 files changed, 26 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/GUI/UI/UiGame.cpp Thu Oct 02 21:16:27 2014 +0600 +++ b/GUI/UI/UiGame.cpp Thu Oct 02 22:01:06 2014 +0600 @@ -1911,19 +1911,19 @@ unsigned int rotate = pParty->sRotationY & stru_5C6E00->uDoublePiMask; if ( (signed int)rotate <= 1920 ) arrow_idx = 6; - else if ( (signed int)rotate < 1664 ) + if ( (signed int)rotate < 1664 ) arrow_idx = 5; - else if ( (signed int)rotate <= 1408 ) + if ( (signed int)rotate <= 1408 ) arrow_idx = 4; - else if ( (signed int)rotate < 1152 ) + if ( (signed int)rotate < 1152 ) arrow_idx = 3; - else if ( (signed int)rotate <= 896 ) + if ( (signed int)rotate <= 896 ) arrow_idx = 2; - else if ( (signed int)rotate < 640 ) + if ( (signed int)rotate < 640 ) arrow_idx = 1; - else if ( (signed int)rotate <= 384 ) + if ( (signed int)rotate <= 384 ) arrow_idx = 0; - else if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) + if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) arrow_idx = 7; pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//стрелка
--- a/Media/Audio/AudioPlayer.cpp Thu Oct 02 21:16:27 2014 +0600 +++ b/Media/Audio/AudioPlayer.cpp Thu Oct 02 22:01:06 2014 +0600 @@ -429,13 +429,13 @@ fclose(File); return 1; } -//char в wchar_t +//char to wchar_t bool char2wchar_t(char *str1, wchar_t *str2) { - std::wstringstream st; - st << str1; - return !(st >> str2).fail(); -}; + std::wstringstream st; + st << str1; + return !(st >> str2).fail(); +} //----- (004AA13F) -------------------------------------------------------- void AudioPlayer::PlayMusicTrack(MusicID eTrack) { @@ -443,33 +443,31 @@ if (!bNoSound && bPlayerReady && uMusicVolimeMultiplier) { if ( use_music_folder ) - { + { alSourceStop(mSourceID); - sprintf(string, "Music\\%d.mp3", eTrack); + sprintf(string, "Music\\%d.mp3", eTrack); if (!FileExists(string)) - { + { Log::Warning(L"File 14.mp3 in Music\\ folder not found"); - return; - } - LPWSTR wStr = new WCHAR[255]; - //wchar_t *wStr = new wchar_t; - char2wchar_t(string,wStr); - PlayAudio(wStr); - delete []wStr; - alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); - } - else if ( hAILRedbook ) - { + return; + } + LPWSTR wStr = new WCHAR[255]; + char2wchar_t(string, wStr); + PlayAudio(wStr); + delete []wStr; + alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); + } + else if ( hAILRedbook ) + { AIL_redbook_stop(hAILRedbook); AIL_redbook_set_volume(hAILRedbook, (signed)pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); AIL_redbook_track_info(hAILRedbook, eTrack, &uCurrentMusicTrackStartMS, &uCurrentMusicTrackEndMS); AIL_redbook_play(hAILRedbook, uCurrentMusicTrackStartMS + 1, uCurrentMusicTrackEndMS); uCurrentMusicTrackLength = ((uCurrentMusicTrackEndMS - uCurrentMusicTrackStartMS) * 128) / 1000; - } + } } } - //----- (004AA1F3) -------------------------------------------------------- void AudioPlayer::SetMusicVolume(int vol) {