issue #1310: make tests and HelloWorld work ok

This commit is contained in:
minggo 2012-06-11 10:41:52 +08:00
parent c8c696a2df
commit 94235d3602
11 changed files with 24 additions and 11 deletions

View File

@ -1 +1 @@
5e8bc2ebea93cf60f4c5992e1175c43fffffb7e8 e725a16819b832fcdbd8496ae63d0b24c76af31a

View File

@ -371,7 +371,7 @@ void CCDirector::setProjection(ccDirectorProjection kProjection)
kmGLLoadIdentity(); kmGLLoadIdentity();
// issue #1334 // issue #1334
kmMat4PerspectiveProjection( &matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, zeye*2); kmMat4PerspectiveProjection( &matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, zeye*2);
// kmMat4PerspectiveProjection( &matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, 1500); // kmMat4PerspectiveProjection( &matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, 1500);
//TODO: if (m_pobOpenGLView && m_pobOpenGLView->isIpad() && m_pobOpenGLView->getMainScreenScale() > 1.0f) //TODO: if (m_pobOpenGLView && m_pobOpenGLView->isIpad() && m_pobOpenGLView->getMainScreenScale() > 1.0f)

View File

@ -150,7 +150,7 @@ void CCPointArray::reverseInline()
} }
// CatmullRom Spline formula: // CatmullRom Spline formula:
inline CCPoint ccCardinalSplineAt(CCPoint &p0, CCPoint &p1, CCPoint &p2, CCPoint &p3, CCFloat tension, float t) CCPoint ccCardinalSplineAt(CCPoint &p0, CCPoint &p1, CCPoint &p2, CCPoint &p3, float tension, float t)
{ {
float t2 = t * t; float t2 = t * t;
float t3 = t2 * t; float t3 = t2 * t;

View File

@ -181,7 +181,7 @@ public:
}; };
/** Returns the Cardinal Spline position for a given set of control points, tension and time */ /** Returns the Cardinal Spline position for a given set of control points, tension and time */
extern CCPoint ccCardinalSplineAt(CCPoint &p0, CCPoint &p1, CCPoint &p2, CCPoint &p3, CCFloat tension, float t); extern CCPoint ccCardinalSplineAt(CCPoint &p0, CCPoint &p1, CCPoint &p2, CCPoint &p3, float tension, float t);
NS_CC_END; NS_CC_END;

View File

@ -212,6 +212,17 @@ static void static_addValueToCCDict(id key, id value, CCDictionary* pDict)
NS_CC_BEGIN NS_CC_BEGIN
CCFileUtils* CCFileUtils::sharedFileUtils()
{
static CCFileUtils *fileUtils = NULL;
if (fileUtils == NULL)
{
fileUtils = new CCFileUtils();
}
return fileUtils;
}
void CCFileUtils::setResourcePath(const char *pszResourcePath) void CCFileUtils::setResourcePath(const char *pszResourcePath)
{ {
assert(0); assert(0);
@ -389,7 +400,7 @@ const char *CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const
CCDictionary* ccFileUtils_dictionaryWithContentsOfFileThreadSafe(const char *pFileName) CCDictionary* ccFileUtils_dictionaryWithContentsOfFileThreadSafe(const char *pFileName)
{ {
const char* pszFullPath = CCFileUtils::fullPathFromRelativePath(pFileName); const char* pszFullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(pFileName);
NSString* pPath = [NSString stringWithUTF8String:pszFullPath]; NSString* pPath = [NSString stringWithUTF8String:pszFullPath];
NSDictionary* pDict = [NSDictionary dictionaryWithContentsOfFile:pPath]; NSDictionary* pDict = [NSDictionary dictionaryWithContentsOfFile:pPath];

View File

@ -29,6 +29,7 @@ THE SOFTWARE.
#define glDeleteVertexArrays glDeleteVertexArraysOES #define glDeleteVertexArrays glDeleteVertexArraysOES
#define glGenVertexArrays glGenVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES
#define glBindVertexArray glBindVertexArrayOES #define glBindVertexArray glBindVertexArrayOES
#define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
#include <OpenGLES/ES2/gl.h> #include <OpenGLES/ES2/gl.h>
#include <OPenGLES/ES2/glext.h> #include <OPenGLES/ES2/glext.h>

View File

@ -348,7 +348,8 @@ CCImage::~CCImage()
bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/) bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/)
{ {
unsigned long nSize; unsigned long nSize;
unsigned char *pBuffer = CCFileUtils::getFileData(CCFileUtils::fullPathFromRelativePath(strPath), "rb", &nSize); CCFileUtils *fileUtils = CCFileUtils::sharedFileUtils();
unsigned char *pBuffer = fileUtils->getFileData(fileUtils->fullPathFromRelativePath(strPath), "rb", &nSize);
return initWithImageData(pBuffer, nSize, eImgFmt); return initWithImageData(pBuffer, nSize, eImgFmt);
} }
@ -360,7 +361,7 @@ bool CCImage::initWithImageFileThreadSafe(const char *fullpath, EImageFormat ima
* CCFileUtils::fullPathFromRelativePath() is not thread-safe, it use autorelease(). * CCFileUtils::fullPathFromRelativePath() is not thread-safe, it use autorelease().
*/ */
unsigned long nSize; unsigned long nSize;
unsigned char *pBuffer = CCFileUtils::getFileData(fullpath, "rb", &nSize); unsigned char *pBuffer = CCFileUtils::sharedFileUtils()->getFileData(fullpath, "rb", &nSize);
return initWithImageData(pBuffer, nSize, imageType); return initWithImageData(pBuffer, nSize, imageType);
} }

View File

@ -1 +1 @@
2d4adf9bb3276c7884f16637eb15bd5090ad7ca2 2ef6f502d16098ac1a18aee1ab7a64815c241af6

View File

@ -1 +1 @@
f15b1b846b94b2d2b69438899124884963fd9f09 27f42f585ea7195531f863d34fff314117000630

View File

@ -1 +1 @@
59d857c1050d96d698c58eaf20c0c3cd1a808cbf 594b0f9fe97d6f6dd1d56c71ccd7e1c61b5522b3

View File

@ -1 +1 @@
277bc57b726290085c72db62cf656b66594440dc b77ecad7976dbe21bb61300c73e06ddbad3a4bd8