新手求解答

cocos2dx 3.3 版 cocos忘记了什么版。用编辑器编辑了一个场景,里面只有一张图。报下面的错。

#include “cocostudio/CocoStudio.h”;
using namespace cocostudio;

auto rootNode = CSLoader::createNode(“Scene1.csb”);
addChild(rootNode);

Node* CSLoader::nodeWithFlatBuffersFile(const std::string &fileName)
{
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName);

CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath));

Data buf = FileUtils::getInstance()->getDataFromFile(fullPath);

auto csparsebinary = GetCSParseBinary(buf.getBytes());

// decode plist
auto textures = csparsebinary->textures();
int textureSize = csparsebinary->textures()->size();
CCLOG("textureSize = %d", textureSize);
for (int i = 0; i < textureSize; ++i)
{
    SpriteFrameCache::getInstance()->addSpriteFramesWithFile(textures->Get(i)->c_str());        
}

Node* node = nodeWithFlatBuffers(csparsebinary->nodeTree());

return node;

}

错在3的 SpriteFrameCache::getInstance()->addSpriteFramesWithFile(textures->Get(i)->c_str()); 这行,请问怎么解决?

额,好难破
1.3.3的引擎需要和cocos版本对应,不然会意外收获错误
2.根据你的代码,只能判断路径有问题。。。