error: ‘bool cocos2d::CCMenu::m_bEnabled’ is private ? – #2 by slackmoehrle – cocos2d-x


Hello, I am compiling some older projects and when I use the build_native.sh to compile the files, it gets stuck on a line;

cocos2dv2/cocos2dx/menu_nodes/CCMenu.h: In member function ‘virtual bool AISBeganMenu::ccTouchBegan(cocos2d::CCTouch*, cocos2d::CCEvent*)’:

cocos2dv2/cocos2dx/menu_nodes/CCMenu.h:59:10: error: ‘bool cocos2d::CCMenu::m_bEnabled’ is private

bool m_bEnabled;
^
jni/…/…/…/Classes/AISBeganMenu.cpp:97:61: error: within this context
if (m_eState != kCCMenuStateWaiting || ! m_bVisible || !m_bEnabled)

The code it refers to is;

bool AISBeganMenu::ccTouchBegan(CCTouch* touch, CCEvent* event)
{
    CC_UNUSED_PARAM(event);
    if (m_eState != kCCMenuStateWaiting || ! m_bVisible || !m_bEnabled)
    {
        return false;
    }
    for (CCNode *c = this->m_pParent; c != NULL; c = c->getParent())
    {
        if (c->isVisible() == false)
        {
            return false;
        }
    }
    m_pSelectedItem = this->itemForTouch(touch);
    if (m_pSelectedItem)
    {
        m_eState = kCCMenuStateTrackingTouch;
        m_pSelectedItem->selected();
        m_pSelectedItem->activate();

        return true;
    }
    return false;
}

Is there any way I can get rid of this error to compile, without butchering the code itself (and removing things like references to m_bEnabled as when I tried that I am convinced it ruined the touch parts of the game.

Much appreciate any help!



Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email