mirror of https://github.com/axmolengine/axmol.git
issue #1683: Using full path in CocosDenshion API.
This commit is contained in:
parent
f2dad83610
commit
fa7175f6f7
|
@ -24,6 +24,8 @@ THE SOFTWARE.
|
|||
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "SimpleAudioEngine_objc.h"
|
||||
#include "cocos2d.h"
|
||||
USING_NS_CC;
|
||||
|
||||
static void static_end()
|
||||
{
|
||||
|
@ -174,12 +176,16 @@ void SimpleAudioEngine::end()
|
|||
|
||||
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
|
||||
{
|
||||
static_preloadBackgroundMusic(pszFilePath);
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
static_preloadBackgroundMusic(fullPath.c_str());
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
static_playBackgroundMusic(pszFilePath, bLoop);
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
static_playBackgroundMusic(fullPath.c_str(), bLoop);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
|
||||
|
@ -224,32 +230,38 @@ void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
|
|||
|
||||
float SimpleAudioEngine::getEffectsVolume()
|
||||
{
|
||||
return static_getEffectsVolume();
|
||||
return static_getEffectsVolume();
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::setEffectsVolume(float volume)
|
||||
{
|
||||
static_setEffectsVolume(volume);
|
||||
static_setEffectsVolume(volume);
|
||||
}
|
||||
|
||||
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop)
|
||||
{
|
||||
return static_playEffect(pszFilePath, bLoop);
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
return static_playEffect(fullPath.c_str(), bLoop);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
|
||||
{
|
||||
static_stopEffect(nSoundId);
|
||||
static_stopEffect(nSoundId);
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
||||
{
|
||||
static_preloadEffect(pszFilePath);
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
static_preloadEffect(fullPath.c_str());
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
|
||||
{
|
||||
static_unloadEffect(pszFilePath);
|
||||
// Changing file path to full path
|
||||
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath);
|
||||
static_unloadEffect(fullPath.c_str());
|
||||
}
|
||||
|
||||
void SimpleAudioEngine::pauseEffect(unsigned int uSoundId)
|
||||
|
|
Loading…
Reference in New Issue