摘要: 可能各位看官们有更好的方法,请不吝赐教。#ifdef _WIN32#include #else#include #include #include #include #endifwin32平台引用io.h里面的信息。主要定义了一个void dfsFolder(string folderPath, int depth = 0);方法对其进行递归遍历。具体的实现为 1 void dfsFolder( string folderPath, int depth) 2 { 3 #ifdef WIN32 4 _finddata_t FileInfo; 5 string strfind = ... 阅读全文
posted @ 2013-09-11 21:39 TickDream 阅读(3765) 评论(0) 推荐(0) 编辑
摘要: 代码未经进一步的整理,可能比较混乱。首先,2dx的socket库由BSSocket组成。可跨平台,在windows上已验证。 1 #ifndef _NET_BSSOCKET_H_ 2 #define _NET_BSSOCKET_H_ 3 4 #ifdef WIN32 5 #include 6 #include 7 typedef int socklen_t; 8 #else 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #inc... 阅读全文
posted @ 2013-09-10 22:12 TickDream 阅读(2352) 评论(0) 推荐(0) 编辑
摘要: 利用cocos2d-x里封装的unZip进行遍历文件,取出每一个文件 1 vector ToolUtils::getFiles( const char* zipFile, const char* floder ) 2 { 3 vector files; 4 unsigned char * pBuffer = NULL; 5 unzFile pFile = NULL; 6 string rejustFloder(floder); //floder必须以/结尾 7 if(rejustFloder.find_last_not_of("/")) { 8 ... 阅读全文
posted @ 2013-05-25 22:51 TickDream 阅读(1752) 评论(2) 推荐(0) 编辑
摘要: 第一步:首先定位类简写与完整类名的映射 public static Properties relectProperties; static { relectProperties = new Properties(); InputStream in = ReflectUtils.class.getResourceAsStream("reflect.properties"); try { relectProperties.load(in); } catch (IOException e) { ... 阅读全文
posted @ 2013-05-06 22:58 TickDream 阅读(801) 评论(0) 推荐(0) 编辑
摘要: cocos2d-x版本为2.0.4此画图调用的是opengl es 2.0版本,支持三角形画图。故必须有一个顶点数组。此定义定义在CCSprite.h中ccV3F_C4B_T2F_Quad m_sQuad;而这个顶点数组的定义为//! 4 ccVertex3FTex2FColor4Btypedef struct _ccV3F_C4B_T2F_Quad{ //! top left ccV3F_C4B_T2F tl; //! bottom left ccV3F_C4B_T2F bl; //! top right ccV3F_C4B_T2F tr... 阅读全文
posted @ 2012-12-11 15:24 TickDream 阅读(818) 评论(0) 推荐(0) 编辑