[Cocos2dx Bug] [win32] Function CCFileUtils::fullPathFromRelativeFile forget consider the path separated by '\\'
[Cocos2dx 2.2.4]
[win32平台Bug]
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
方法中,没有考虑windows下的 path separated is '\\'
源码:
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
{
std::string relativeFile = pszRelativeFile;
CCString *pRet = CCString::create("");
pRet->m_sString = relativeFile.substr(, relativeFile.rfind('/') + );
pRet->m_sString += getNewFilename(pszFilename);
return pRet->getCString();
}
修改为:
const char* CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
{
std::string relativeFile = pszRelativeFile;
CCString *pRet = CCString::create("");
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
pRet->m_sString = relativeFile.substr(, relativeFile.rfind('\\') + );
#else
pRet->m_sString = relativeFile.substr(, relativeFile.rfind('/') + );
#endif
pRet->m_sString += getNewFilename(pszFilename);
return pRet->getCString();
}
[Cocos2dx Bug] [win32] Function CCFileUtils::fullPathFromRelativeFile forget consider the path separated by '\\'的更多相关文章
- dwc_otg驱动 "BUG: sleeping function called from invalid context at mm/page_alloc.c"
方案商的开发板上otg功能只能做device,硬件看过后说没有5v供电,加上后能够识别U盘了,但是内核报了错 [ 3.264000] usb 2-1: new high-speed USB devic ...
- Cocos2d-x在win32,android和IOS下的文件读写问题
最近在学习和使用Cocos2d-x框架,虽然说的是跨平台,但是在用VS进行开发,然后移植到android或IOS下,也可能会出现各种问题,需要做细微的调整. 例如我在做文件读写操作的时候,很可能在wi ...
- cocos2d-x 从win32到android移植的全套解决方案
引言:我们使用cocos2d-x引擎制作了一款飞行射击游戏,其中创新性地融入了手势识别功能.但是我们在移植过程中遇到了很多的问题,同时也发现网上的资料少而不全.所以在项目行将结束的时候,我们特地写了这 ...
- cocos2d-x的win32编译环境
1> 检查或配置VS 1.1>头文件 [c/c++]->附加包含目录 1.2>依赖库 [链接器]->[输入]->[附加依赖项] 2> 可能出现 ...
- cocos2d-x在win32和iOS、android下获取当前系统时间的方法
最近在游戏里要显示当前系统时间的功能,网上一搜很多写着获取的方法,大都是如下 struct cc_timeval now; CCTime::gettimeofdayCocos2d(&now, ...
- cocos2dx创建win32项目一般步奏
1.导入一个新项目步奏:解决方案:右键->添加->添加现有项目->添加依赖项目libCocoStudioD:\work\CannonDefender\cocos2d\cocos\ed ...
- cocos2d-x 发布win32 release版本后找不到msvcr110.dll
解决方法: 安装Visual C++ Redistributable for Visual Studio 2012 //下载地址 http://www.microsoft.com/zh-CN/down ...
- [AST Babel] Add function name into the console log 'path.findParent(t.isFunctionDeclaration)'
Continue with the previous post: https://www.cnblogs.com/Answer1215/p/12337243.html What we want to ...
- Android Stuio让我濒临崩溃的bug之cause: unable to find valid certification path to requested target
•问题描述 像往常一样,打开 $android studio$ 开启愉快的开发之旅: 写着写着,右下角弹出一个对话,说 $android studio$ 有新版本可更新: 有新版本为何不用,果断点击 ...
随机推荐
- DOM编程艺术-setTimeout,"moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")"
DOM编程艺术一个小demo,看到这里的时候不理解 "moveElement('"+elementID+"',"+final_x+","+f ...
- EF写统计
EF的特性是,你from的第一个表为主表,接下来的所有表以左联或者内联或者交叉连接的方式去显示,不会出现右联, 在编写的时候,可以先确定个数据源,然后对这个数据源进行数据的统计, 例如SQL: -- ...
- ssh: connect to host localhost port 22: Connection refused
1.hadoop安装好之后,执行ssh localhost无法执行, 提示“ssh: connect to host localhost port 22: Connection refused”. 2 ...
- MySql-8.0.12 安装教程随笔
下载地址: https://www.mysql.com/downloads/ 现在最下边的社区版本,也就是免费版本 之后我们会看到有两个选择的下载,一个为zip压缩包格式,一个是Install版本,个 ...
- java基础面试题:java中实现多态的机制是什么?
靠的是父类或接口的引用指向子类或实现类的对象, 调用的方法是内存中正在运行的那个对象的方法.
- Node第二天
一.http模块: 步骤一:创建http服务器 const https = require('https'); 步骤二:const fs = require('fs'); 步骤三:创建请求=> ...
- BZOJ3679: 数字之积(数位dp)
题意 题目链接 Sol 推什么结论啊. 直接大力dp,$f[i][j]$表示第$i$位,乘积为$j$,第二维直接开map 能赢! /* */ #include<iostream> #inc ...
- Java 获取Web项目相对webapp地址
例如, import java.io.File; import java.io.FileInputStream; import javax.servlet.http.HttpServletReques ...
- git提交时报错 permission denied
git push 时报错:permission denied xxx 目前很多解决办法是生成公钥和秘钥,这种方法安全可靠,比较适用于一台电脑对应一个git账户,但是多个账户在同一台电脑上提交使用git ...
- zabbix 密码忘记了如何恢复
1.进入数据库 2.使用zabbix的数据库 use zabbix: 3.查看表信息 show tables; 4.搜索users表 select * from users; 5.修改userid为1 ...