为什么我的C ++代码中只出现红色切换错误?

时间:2019-01-08 20:39:26

标签: android-ndk

我想知道哪里出了问题,有人在帮忙吗?

#include "Resource.hpp"
#include "SoundManager.hpp"
#include "Sound.hpp"


SoundManager::SoundManager(android_app* pApplication)  :
    mApplication(pApplication),
    mEngineObj(NULL), mEngine(NULL), mOutputMixObj(NULL),
    mSoundQueues(), mCurrentQueue(0), mSounds(), mSoundCount(0) {
};

SoundManager::~SoundManager() {
    for (int32_t i=0, i<mSoundCount; ++i) {
        delete mSounds[i];
    }
    mSoundCount = 0;
}

void SoundManager::stop() {
    for (int32_t i=0; i< QUEUE_COUNT; ++i) {
        mSoundQueues[i].finalize();
    }
    //Destroys audio output and engine.
    for(int32_t i=0; i<mSoundCount; ++i){
        mSounds[i]->unload();
    }
}

registerSound():

Sound* SoundManager::registerSound(Resource& pResource) {
    for(int32_t i=0; i<mSoundCount; ++i){
        if(strcmp(pResource.getPath().mSounds->getPath() = 0) {
            return mSounds[i];
        }
    }
    Sound* sound = new Sound(mApplication, &pResource);
    mSounds[mSoundCount++] = sound;
    return sound;
}

void SoundManager::playSound(Sound* pSound) {
    int32_t currentQueue = ++mCurrentQueue;
    SoundQueue& soundQueue = mSoundQueues[currentQueue%QUEUE_COUNT];
    soundQueue.playSound(pSound);
}
在registerSound()多个实例之后出现

错误,在这些实例中,斑点下面几乎没有阴影红色,表示我需要符号,或者是预期的东西,但我只是不太明白,任何帮助将非常感谢。错误发生... -以星号表示声音*

-资源后的&符号

-之后的)和{在pResource之后的

之前

-at

-在;在mSoundcount之后

  • ++ i

-再次在)和{

之间

-如果...

-在。在pResource和。在mSounds和->和0

之前
  • return和[和]

-之后的两个}

-在[和++]和=

处的mSounds之后
  • 再次返回

和}

0 个答案:

没有答案