have a problem using cocos2d-x on android. I am trying to load a .zip file using
CCFileUtils::sharedFileUtils()->getFileDataFromZip(…)
As this project is designed to be multiplatform, we also tried this code on an iPad3 and there it is working without problem. The problem is that the app gets an Segmentation Fault when loading the zip file.
Here is the whole code with some extra comments
@
std::stringstream filename;
filename << (int)startPoint.x << “_” << (int)startPoint.y << “.map”;
unsigned long filesize = 0;
const char* path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(“map1.zip”);
CCLog(path);
CCLog(filename.str().c_str());
// In the following two lines the error occurs
const char* buffer =(const char**) CCFileUtils::sharedFileUtils->getFileDataFromZip.c_str, &filesize);
std::istringstream fileBuffer;
CCLogfilesize);
std::string line;
// Here some code follows but this code does not produce the problem so I left it out
@
The used includes are:
@
#include
#include
#include
#include <map>
#include “cocos2d.h”
@
The values for**path* and filename are map1.zip and ~~128_~~128.map
map1.zip is in the assets folder and the .map file exists inside map1.zip
The .map is a simple text file containing bytes, it is a binary file
filesize always stays 0
Thanks in advance