mirror of https://github.com/axmolengine/axmol.git
issue #427, airplay port ok
This commit is contained in:
parent
db4fb7cc9c
commit
799fb0994f
|
@ -204,15 +204,15 @@ do { \
|
|||
|
||||
//---- todo: replace with wophone window
|
||||
|
||||
|
||||
// #define CC_DIRECTOR_END() \
|
||||
// do { \
|
||||
// CCDirector *__director = [CCDirector sharedDirector]; \
|
||||
// CC_GLVIEW *__view = [__director openGLView]; \
|
||||
// [__view removeFromSuperview]; \
|
||||
// [__director end]; \
|
||||
// } while(0)
|
||||
|
||||
/*
|
||||
#define CC_DIRECTOR_END() \
|
||||
do { \
|
||||
CCDirector *__director = [CCDirector sharedDirector]; \
|
||||
CC_GLVIEW *__view = [__director openGLView]; \
|
||||
[__view removeFromSuperview]; \
|
||||
[__director end]; \
|
||||
} while(0)
|
||||
*/
|
||||
|
||||
#ifndef FLT_EPSILON
|
||||
#define FLT_EPSILON 1.192092896e-07F
|
||||
|
|
|
@ -13,7 +13,7 @@ NS_CC_BEGIN;
|
|||
(CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
typedef unsigned char CC_XML_CHAR;
|
||||
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY)
|
||||
typedef char CC_XML_CHAR
|
||||
typedef char CC_XML_CHAR;
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "support/file_support/FileData.h"
|
||||
#include "support/zip_support/unzip.h"
|
||||
#include "CCSAXParser_airplay.h"
|
||||
#include "../CCSAXParser.h"
|
||||
#include "CCApplication.h"
|
||||
#include "CCMutableArray.h"
|
||||
|
||||
|
|
|
@ -33,10 +33,11 @@ bool CCSAXParser::parse(const char *pszFile)
|
|||
{
|
||||
bool bRet = false;
|
||||
char* buf = NULL;
|
||||
s3eFile* file = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
s3eFile* file = s3eFileOpen(pszFile, "r");
|
||||
file = s3eFileOpen(pszFile, "r");
|
||||
|
||||
if (!file)
|
||||
{
|
||||
|
@ -75,16 +76,16 @@ bool CCSAXParser::parse(const char *pszFile)
|
|||
}
|
||||
void CCSAXParser::startElement(void *ctx, const char *name, const char **atts)
|
||||
{
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->startElement(ctx, (XML_Char)name, atts);
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->startElement(ctx, (const char*)name, (const char**)atts);
|
||||
}
|
||||
|
||||
void CCSAXParser::endElement(void *ctx, const char *name)
|
||||
{
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->endElement(ctx, (XML_Char)name);
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->endElement(ctx, (const char*)name);
|
||||
}
|
||||
void CCSAXParser::textHandler(void *ctx, const char *name, int len)
|
||||
{
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->textHandler(ctx, (XML_Char)name, len);
|
||||
((CCSAXParser*)(ctx))->m_pDelegator->textHandler(ctx, (const char*)name, len);
|
||||
}
|
||||
void CCSAXParser::setDelegator(CCSAXDelegator* pDelegator)
|
||||
{
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef __CCSAXPARSER_AIRPLAY_H__
|
||||
#define __CCSAXPARSER_AIRPLAY_H__
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY) //for ios proj
|
||||
|
||||
#include "expat.h"
|
||||
#include "CCMutableDictionary.h"
|
||||
|
||||
NS_CC_BEGIN;
|
||||
|
||||
class CCSAXDelegator
|
||||
{
|
||||
public:
|
||||
virtual void startElement(void *ctx, const XML_Char *name, const XML_Char **atts) = 0;
|
||||
virtual void endElement(void *ctx,const XML_Char *name) = 0;
|
||||
virtual void textHandler(void *ctx,const XML_Char *s, int len) = 0;
|
||||
};
|
||||
|
||||
class CCSAXParser
|
||||
{
|
||||
XML_Parser m_parser;
|
||||
CCSAXDelegator* m_pDelegator;
|
||||
public:
|
||||
|
||||
CCSAXParser();
|
||||
~CCSAXParser(void);
|
||||
|
||||
void init(const char *pszEncoding);
|
||||
void parse(const char *pszFile);
|
||||
void setDelegator(CCSAXDelegator* pDelegator);
|
||||
|
||||
static void startElement(void *ctx, const XML_Char *name, const XML_Char **atts);
|
||||
static void endElement(void *ctx, const XML_Char *name);
|
||||
static void textHandler(void *ctx, const XML_Char *name, int len);
|
||||
};
|
||||
NS_CC_END;
|
||||
#endif //CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY
|
||||
#endif //__CCSAXPARSER_AIRPLAY_H__
|
Loading…
Reference in New Issue