Merge remote branch 'origin/master'

This commit is contained in:
Walzer 2011-07-08 18:01:52 +08:00
commit e39fca389f
50 changed files with 600 additions and 145 deletions

View File

@ -201,17 +201,14 @@ const char * _FullPath(const char * szPath)
{
if (! s_szRootPath[0])
{
s_dwRootLen = GetModuleFileName(NULL, s_szRootPath, sizeof(s_szRootPath));
while (--s_dwRootLen)
{
if ('\\' == s_szRootPath[s_dwRootLen])
{
s_szRootPath[s_dwRootLen + 1] = 0;
strcpy_s(s_szFullPath, sizeof(s_szFullPath), s_szRootPath);
++s_dwRootLen;
break;
}
}
WCHAR wszPath[MAX_PATH];
s_dwRootLen = WideCharToMultiByte(CP_ACP, 0, wszPath,
GetCurrentDirectoryW(sizeof(wszPath), wszPath),
s_szRootPath, MAX_PATH, NULL, NULL);
s_szRootPath[s_dwRootLen] = '\\';
s_szRootPath[s_dwRootLen + 1] = 0;
strcpy_s(s_szFullPath, sizeof(s_szFullPath), s_szRootPath);
++s_dwRootLen;
}
if (0 != szPath[0] && ':' != szPath[1])

View File

@ -653,6 +653,20 @@ void CCScheduler::pauseTarget(SelectorProtocol *pTarget)
}
}
bool CCScheduler::isTargetPaused(SelectorProtocol *pTarget)
{
CCAssert( pTarget != NULL, "target must be non nil" );
// Custom selectors
tHashSelectorEntry *pElement = NULL;
HASH_FIND_INT(m_pHashForSelectors, &pTarget, pElement);
if( pElement )
{
return pElement->paused;
}
return false; // should never get here
}
// main loop
void CCScheduler::tick(ccTime dt)
{

View File

@ -151,7 +151,7 @@ namespace cocos2d
void CCGrid3DAction::setVertex(cocos2d::ccGridSize pos, cocos2d::ccVertex3F vertex)
{
CCGrid3D *g = (CCGrid3D*)m_pTarget->getGrid();
return g->setVertex(pos, vertex);
g->setVertex(pos, vertex);
}
// implementation of TiledGrid3DAction

View File

@ -542,28 +542,33 @@ bool CCSpawn:: initOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAct
assert(pAction1 != NULL);
assert(pAction2 != NULL);
bool bRet = false;
ccTime d1 = pAction1->getDuration();
ccTime d2 = pAction2->getDuration();
// __super::initWithDuration(fmaxf(d1, d2));
float maxd = (d1 >= d2 || isnan(d2)) ? d1 : d2;
CCActionInterval::initWithDuration(maxd);
m_pOne = pAction1;
m_pTwo = pAction2;
if (d1 > d2)
if (CCActionInterval::initWithDuration(MAX(d1, d2)))
{
m_pTwo = CCSequence::actionOneTwo(pAction2, CCDelayTime::actionWithDuration(d1 - d2));
} else
if (d1 < d2)
{
m_pOne = CCSequence::actionOneTwo(pAction1, CCDelayTime::actionWithDuration(d2 - d1));
m_pOne = pAction1;
m_pTwo = pAction2;
if (d1 > d2)
{
m_pTwo = CCSequence::actionOneTwo(pAction2, CCDelayTime::actionWithDuration(d1 - d2));
} else
if (d1 < d2)
{
m_pOne = CCSequence::actionOneTwo(pAction1, CCDelayTime::actionWithDuration(d2 - d1));
}
m_pOne->retain();
m_pTwo->retain();
bRet = true;
}
m_pOne->retain();
m_pTwo->retain();
return true;
return bRet;
}
CCObject* CCSpawn::copyWithZone(cocos2d::CCZone *pZone)

View File

@ -303,14 +303,10 @@ void CCActionManager::removeActionByTag(unsigned int tag, CCObject *pTarget)
if (pAction->getTag() == tag && pAction->getOriginalTarget() == pTarget)
{
return removeActionAtIndex(i, pElement);
removeActionAtIndex(i, pElement);
break;
}
}
CCLOG("cocos2d: removeActionByTag: Action not found!");
}
else
{
CCLOG("cocos2d: removeActionByTag: Target not found!");
}
}

View File

@ -32,6 +32,17 @@ A convience macro to iterate over a CCArray using. It is faster than the "fast e
@since v0.99.4
*/
/*
In cocos2d-iphone 1.0.0, This macro have been update to like this:
#define CCARRAY_FOREACH(__array__, __object__) \
if (__array__ && __array__->data->num > 0) \
for(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \
__arr__ <= end && ((__object__ = *__arr__) != nil || true); \
__arr__++)
I found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin
*/
#define CCARRAY_FOREACH(__array__, __object__) \
if (__array__ && __array__->data->num > 0) \
for(CCObject** arr = __array__->data->arr, **end = __array__->data->arr + __array__->data->num-1; \

View File

@ -37,7 +37,7 @@ namespace cocos2d{
- CCLabelAtlas "characters" have a fixed height and width
- CCLabelAtlas "characters" can be anything you want since they are taken from an image file
A more flexible class is CCBitmapFontAtlas. It supports variable width characters and it also has a nice editor.
A more flexible class is CCLabelBMFont. It supports variable width characters and it also has a nice editor.
*/
class CC_DLL CCLabelAtlas : public CCAtlasNode, public CCLabelProtocol
{

View File

@ -22,6 +22,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Use any of these editors to generate BMFonts:
http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
http://www.angelcode.com/products/bmfont/ (Free, Windows only)
****************************************************************************/
#ifndef __CCBITMAP_FONT_ATLAS_H__
#define __CCBITMAP_FONT_ATLAS_H__
@ -127,10 +134,11 @@ namespace cocos2d{
CCLabelBMFont has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite.
If in doubt, use CCLabelBMFont instead of CCLabelAtlas / CCLabel.
Supported editors:
- http://www.n4te.com/hiero/hiero.jnlp
- http://slick.cokeandcode.com/demos/hiero.jnlp
- http://www.angelcode.com/products/bmfont/
Supported editors:
http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
http://www.angelcode.com/products/bmfont/ (Free, Windows only)
@since v0.8
*/

View File

@ -33,7 +33,7 @@ namespace cocos2d{
*
* All features from CCTextureNode are valid in CCLabelTTF
*
* CCLabelTTF objects are slow. Consider using CCLabelAtlas or CCBitmapFontAtlas instead.
* CCLabelTTF objects are slow. Consider using CCLabelAtlas or CCLabelBMFont instead.
*/
class CC_DLL CCLabelTTF : public CCSprite, public CCLabelProtocol
{

View File

@ -301,10 +301,22 @@ CCPoint CC_DLL ccpRotateByAngle(const CCPoint& v, const CCPoint& pivot, float an
the hit point also is p1 + s * (p2 - p1);
@since v0.99.1
*/
bool CC_DLL ccpLineIntersect(CCPoint p1, CCPoint p2,
CCPoint p3, CCPoint p4,
bool CC_DLL ccpLineIntersect(const CCPoint& p1, const CCPoint& p2,
const CCPoint& p3, const CCPoint& p4,
float *s, float *t);
/*
ccpSegmentIntersect returns YES if Segment A-B intersects with segment C-D
@since v1.0.0
*/
bool ccpSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
/*
ccpIntersectPoint returns the intersection point of line A-B, C-D
@since v1.0.0
*/
CCPoint ccpIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
}//namespace cocos2d
#endif // __SUPPORT_CGPOINTEXTENSION_H__

View File

@ -177,6 +177,11 @@ public:
*/
void resumeTarget(SelectorProtocol *pTarget);
/** Returns whether or not the target is paused
@since v1.0.0
*/
bool isTargetPaused(SelectorProtocol *pTarget);
public:
/** returns a shared instance of the Scheduler */
static CCScheduler* sharedScheduler(void);

View File

@ -45,10 +45,7 @@ class CCSize;
class CCTexture2D;
struct transformValues_;
enum {
/// CCSprite invalid index on the CCSpriteBatchNode
CCSpriteIndexNotInitialized = 0xffffffff,
};
#define CCSpriteIndexNotInitialized 0xffffffff /// CCSprite invalid index on the CCSpriteBatchode
/**
Whether or not an CCSprite will rotate, scale or translate with it's parent.

View File

@ -147,6 +147,8 @@ protected:
void forceRemoveDelegate(CCTouchDelegate *pDelegate);
void forceAddHandler(CCTouchHandler *pHandler, CCMutableArray<CCTouchHandler*> *pArray);
void forceRemoveAllDelegates(void);
void rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray);
CCTouchHandler* findHandler(CCTouchDelegate *pDelegate);
protected:
CCMutableArray<CCTouchHandler*> *m_pTargetedHandlers;

View File

@ -40,7 +40,7 @@ This formula prevents artifacts by using 99% of the texture.
The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
Affected nodes:
- CCSprite / CCSpriteBatchNode and subclasses: CCBitmapFontAtlas, CCTMXTiledMap
- CCSprite / CCSpriteBatchNode and subclasses: CCLabelBMFont, CCTMXTiledMap
- CCLabelAtlas
- CCQuadParticleSystem
- CCTileMap
@ -143,7 +143,7 @@ Disabled by default on iPhone with ARMv6 processors.
Using the translate/rotate/scale requires 5 GL calls.
But computing the Affine matrix is relative expensive.
But according to performance tests, Affine matrix performs better.
This parameter doesn't affect SpriteSheet nodes.
This parameter doesn't affect CCSpriteBatchNode nodes.
To enable set it to a value different than 0. Enabled by default.
@ -177,6 +177,11 @@ To enable set it to a value different than 0. Enabled by default.
To enable set it to a value different than 0. Disabled by default.
This value governs only the PNG, GIF, BMP, images.
This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value.
@deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it.
@since v0.99.2
*/
#define CC_TEXTURE_NPOT_SUPPORT 0
@ -187,6 +192,11 @@ For performance reasons, it's recommended disable it in games without retina dis
To enable set it to 1. Use 0 to disable it. Enabled by default.
This value governs only the PNG, GIF, BMP, images.
This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value.
@deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it.
@since v0.99.5
*/
#define CC_RETINA_DISPLAY_SUPPORT 1
@ -220,8 +230,14 @@ Platforms: Only used on ARM Neon architectures like iPhone 3GS or newer and iPad
If enabled, all subclasses of CCSprite will draw a bounding box
Useful for debugging purposes only. It is recommened to leave it disabled.
To enable set it to a value different than 0. Disabled by default.
*/
To enable set it to a value different than 0. Disabled by default:
0 -- disabled
1 -- draw bounding box
2 -- draw texture box
0 -- disabled
1 -- draw bounding box
2 -- draw texture box
*/
#define CC_SPRITE_DEBUG_DRAW 0
/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW

View File

@ -22,6 +22,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Use any of these editors to generate BMFonts:
http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
http://www.angelcode.com/products/bmfont/ (Free, Windows only)
****************************************************************************/
#include "CCLabelBMFont.h"
@ -206,7 +213,7 @@ namespace cocos2d{
int index = line.find('=')+1;
int index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
CCAssert(atoi(value.c_str()) == 0, "BitmapFontAtlas file could not be found");
CCAssert(atoi(value.c_str()) == 0, "LabelBMFont file could not be found");
// file
index = line.find('"')+1;
index2 = line.find('"', index);
@ -366,13 +373,13 @@ namespace cocos2d{
//CCLabelBMFont
//
//BitmapFontAtlas - Purge Cache
//LabelBMFont - Purge Cache
void CCLabelBMFont::purgeCachedData()
{
FNTConfigRemoveCache();
}
//BitmapFontAtlas - Creation & Init
//LabelBMFont - Creation & Init
CCLabelBMFont *CCLabelBMFont::labelWithString(const char *str, const char *fntFile)
{
CCLabelBMFont *pRet = new CCLabelBMFont();
@ -396,7 +403,7 @@ namespace cocos2d{
CC_SAFE_RELEASE(m_pConfiguration);// allow re-init
m_pConfiguration = FNTConfigLoadFile(fntFile);
m_pConfiguration->retain();
CCAssert( m_pConfiguration, "Error creating config for BitmapFontAtlas");
CCAssert( m_pConfiguration, "Error creating config for LabelBMFont");
if (CCSpriteBatchNode::initWithFile(m_pConfiguration->m_sAtlasName.c_str(), strlen(theString)))
{
@ -416,7 +423,7 @@ namespace cocos2d{
CC_SAFE_RELEASE(m_pConfiguration);
}
// BitmapFontAtlas - Atlas generation
// LabelBMFont - Atlas generation
int CCLabelBMFont::kerningAmountForFirst(unsigned short first, unsigned short second)
{
int ret = 0;
@ -466,7 +473,7 @@ namespace cocos2d{
for(int i=0; i<len; i++)
{
unsigned short c = m_sString[i];
CCAssert( c < kCCBMFontMaxChars, "BitmapFontAtlas: character outside bounds");
CCAssert( c < kCCBMFontMaxChars, "LabelBMFont: character outside bounds");
if (c == '\n')
{
@ -535,7 +542,7 @@ namespace cocos2d{
this->setContentSizeInPixels(tmpSize);
}
//BitmapFontAtlas - CCLabelProtocol protocol
//LabelBMFont - CCLabelProtocol protocol
void CCLabelBMFont::setString(const char *newString)
{
m_sString.clear();
@ -565,7 +572,7 @@ namespace cocos2d{
setString(label);
}
//BitmapFontAtlas - CCRGBAProtocol protocol
//LabelBMFont - CCRGBAProtocol protocol
void CCLabelBMFont::setColor(ccColor3B var)
{
m_tColor = var;
@ -633,7 +640,7 @@ namespace cocos2d{
return m_bIsOpacityModifyRGB;
}
// BitmapFontAtlas - AnchorPoint
// LabelBMFont - AnchorPoint
void CCLabelBMFont::setAnchorPoint(CCPoint point)
{
if( ! CCPoint::CCPointEqualToPoint(point, m_tAnchorPoint) )
@ -643,7 +650,7 @@ namespace cocos2d{
}
}
//BitmapFontAtlas - Debug draw
//LabelBMFont - Debug draw
#if CC_LABELBMFONT_DEBUG_DRAW
void CCLabelBMFont::draw()
{

View File

@ -39,9 +39,7 @@ THE SOFTWARE.
#include "CCActionTiledGrid.h"
namespace cocos2d {
enum {
kSceneFade = 0xFADEFADE,
};
const unsigned int kSceneFade = 0xFADEFADE;
#define IMPLEMENT_TRANSITIONWITHDURATION(_Type)\
_Type* _Type::transitionWithDuration(ccTime t, CCScene* scene)\

View File

@ -223,7 +223,7 @@ namespace cocos2d{
//Menu - Alignment
void CCMenu::alignItemsVertically()
{
return this->alignItemsVerticallyWithPadding(kDefaultPadding);
this->alignItemsVerticallyWithPadding(kDefaultPadding);
}
void CCMenu::alignItemsVerticallyWithPadding(float padding)
@ -260,7 +260,7 @@ namespace cocos2d{
void CCMenu::alignItemsHorizontally(void)
{
return this->alignItemsHorizontallyWithPadding(kDefaultPadding);
this->alignItemsHorizontallyWithPadding(kDefaultPadding);
}
void CCMenu::alignItemsHorizontallyWithPadding(float padding)

View File

@ -40,13 +40,9 @@ namespace cocos2d{
static std::string _fontName = "Marker Felt";
static bool _fontNameRelease = false;
enum {
kCurrentItem = 0xc0c05001,
};
const unsigned int kCurrentItem = 0xc0c05001;
const unsigned int kZoomActionTag = 0xc0c05002;
enum {
kZoomActionTag = 0xc0c05002,
};
//
// CCMenuItem
//

View File

@ -165,6 +165,10 @@ CCSprite* CCSprite::spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame)
CCSprite* CCSprite::spriteWithSpriteFrameName(const char *pszSpriteFrameName)
{
CCSpriteFrame *pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName);
char msg[256] = {0};
sprintf(msg, "Invalid spriteFrameName: %s", pszSpriteFrameName);
CCAssert(pFrame != NULL, msg);
return spriteWithSpriteFrame(pFrame);
}
@ -695,13 +699,23 @@ void CCSprite::draw(void)
glBlendFunc(CC_BLEND_SRC, CC_BLEND_DST);
}
#if CC_SPRITE_DEBUG_DRAW
CCSize s = m_tContentSize;
CCPoint vertices[4]={
ccp(0,0),ccp(s.width,0),
ccp(s.width,s.height),ccp(0,s.height),
};
ccDrawPoly(vertices, 4, true);
#if CC_SPRITE_DEBUG_DRAW == 1
// draw bounding box
CCSize s = m_tContentSize;
CCPoint vertices[4] = {
ccp(0,0), ccp(s.width,0),
ccp(s.width,s.height), ccp(0,s.height)
};
ccDrawPoly(vertices, 4, true);
#elif CC_SPRITE_DEBUG_DRAW == 2
// draw texture box
CCSize s = m_obRect.size;
CCPoint offsetPix = getOffsetPositionInPixels();
CCPoint vertices[4] = {
ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y),
ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height)
};
ccDrawPoly(vertices, 4, true);
#endif // CC_SPRITE_DEBUG_DRAW
}

View File

@ -199,7 +199,7 @@ void CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist, CCTexture
const char *pszPath = CCFileUtils::fullPathFromRelativePath(pszPlist);
CCDictionary<std::string, CCObject*> *dict = CCFileUtils::dictionaryWithContentsOfFile(pszPath);
return addSpriteFramesWithDictionary(dict, pobTexture);
addSpriteFramesWithDictionary(dict, pobTexture);
}
void CCSpriteFrameCache::addSpriteFramesWithFile(const char* plist, const char* textureFileName)

View File

@ -124,8 +124,36 @@ CCPoint ccpRotateByAngle(const CCPoint& v, const CCPoint& pivot, float angle)
return r;
}
bool ccpLineIntersect(CCPoint A, CCPoint B,
CCPoint C, CCPoint D,
bool ccpSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D)
{
float S, T;
if( ccpLineIntersect(A, B, C, D, &S, &T )
&& (S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f) )
return true;
return false;
}
CCPoint ccpIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D)
{
float S, T;
if( ccpLineIntersect(A, B, C, D, &S, &T) )
{
// Point of intersection
CCPoint P;
P.x = A.x + S * (B.x - A.x);
P.y = A.y + S * (B.y - A.y);
return P;
}
return CCPointZero;
}
bool ccpLineIntersect(const CCPoint& A, const CCPoint& B,
const CCPoint& C, const CCPoint& D,
float *S, float *T)
{
// FAIL: Line undefined
@ -133,51 +161,37 @@ bool ccpLineIntersect(CCPoint A, CCPoint B,
{
return false;
}
const float BAx = B.x - A.x;
const float BAy = B.y - A.y;
const float DCx = D.x - C.x;
const float DCy = D.y - C.y;
const float ACx = A.x - C.x;
const float ACy = A.y - C.y;
// Translate system to make A the origin
B.x-=A.x; B.y-=A.y;
C.x-=A.x; C.y-=A.y;
D.x-=A.x; D.y-=A.y;
const float denom = DCy*BAx - DCx*BAy;
// Cache
CCPoint C2 = C, D2 = D;
*S = DCx*ACy - DCy*ACx;
*T = BAx*ACy - BAy*ACx;
// Length of segment AB
float distAB = sqrtf(B.x*B.x+B.y*B.y);
// Rotate the system so that point B is on the positive X axis.
float theCos = B.x/distAB;
float theSin = B.y/distAB;
float newX = C.x*theCos+C.y*theSin;
C.y = C.y*theCos-C.x*theSin; C.x = newX;
newX = D.x*theCos+D.y*theSin;
D.y = D.y*theCos-D.x*theSin; D.x = newX;
// FAIL: Lines are parallel.
if (C.y == D.y)
if (denom == 0)
{
if (*S == 0 || *T == 0)
{
// Lines incident
return true;
}
// Lines parallel and not incident
return false;
}
// Discover position of the intersection in the line AB
float ABpos = D.x+(C.x-D.x)*D.y/(D.y-C.y);
*S = *S / denom;
*T = *T / denom;
// Vector CD
C.x = D2.x-C2.x;
C.y = D2.y-C2.y;
// Point of intersection
// CGPoint P;
// P.x = A.x + *S * (B.x - A.x);
// P.y = A.y + *S * (B.y - A.y);
// Vector between intersection and point C
A.x = ABpos*theCos-C2.x;
A.y = ABpos*theSin-C2.y;
newX = sqrtf((A.x*A.x+A.y*A.y)/(C.x*C.x+C.y*C.y));
if(((A.y<0) != (C.y<0)) || ((A.x<0) != (C.x<0)))
newX *= -1.0f;
*S = ABpos/distAB;
*T = newX;
// Success.
return true;
}

View File

@ -29,6 +29,8 @@ namespace cocos2d {
unsigned char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len );
int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len )
{
static char inalphabet[256], decoder[256];

View File

@ -339,17 +339,13 @@ static inline void ccCArrayFree(ccCArray *arr)
/** Doubles C array capacity */
static inline void ccCArrayDoubleCapacity(ccCArray *arr)
{
arr->max *= 2;
arr->arr = (void**) realloc(arr->arr, arr->max * sizeof(void*));
ccArrayDoubleCapacity((ccArray*)arr);
}
/** Increases array capacity such that max >= num + extra. */
static inline void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra)
{
while (arr->max < arr->num + extra)
{
ccCArrayDoubleCapacity(arr);
}
ccArrayEnsureExtraCapacity((ccArray*)arr,extra);
}
/** Returns index of first occurence of value, NSNotFound if value not found. */

View File

@ -30,6 +30,9 @@ THE SOFTWARE.
namespace cocos2d {
void tgaLoadRLEImageData(FILE *file, tImageTGA *info);
void tgaFlipImage( tImageTGA *info );
// load the image header field from stream
bool tgaLoadHeader(unsigned char* Buffer, unsigned long bufSize, tImageTGA *psInfo)
{

View File

@ -157,6 +157,7 @@ bool CCTexture2D::getHasPremultipliedAlpha()
bool CCTexture2D::initWithData(const void *data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, CCSize contentSize)
{
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glGenTextures(1, &m_uName);
glBindTexture(GL_TEXTURE_2D, m_uName);

View File

@ -32,6 +32,16 @@ THE SOFTWARE.
#include "support/data_support/ccCArray.h"
#include <assert.h>
#include <algorithm>
/**
* Used for sort
*/
static bool less(const cocos2d::CCTouchHandler *p1, const cocos2d::CCTouchHandler *p2)
{
return ((cocos2d::CCTouchHandler*)p1)->getPriority() < ((cocos2d::CCTouchHandler*)p2)->getPriority();
}
namespace cocos2d {
bool CCTouchDispatcher::isDispatchEvents(void)
@ -229,11 +239,48 @@ void CCTouchDispatcher::removeAllDelegates(void)
}
}
CCTouchHandler* CCTouchDispatcher::findHandler(CCTouchDelegate *pDelegate)
{
CCMutableArray<CCTouchHandler*>::CCMutableArrayIterator iter;
for (iter = m_pTargetedHandlers->begin(); iter != m_pTargetedHandlers->end(); ++iter)
{
if ((*iter)->getDelegate() == pDelegate)
{
return *iter;
}
}
for (iter = m_pStandardHandlers->begin(); iter != m_pStandardHandlers->end(); ++iter)
{
if ((*iter)->getDelegate() == pDelegate)
{
return *iter;
}
}
return NULL;
}
void CCTouchDispatcher::rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray)
{
sort(pArray->begin(), pArray->end(), less);
}
void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate)
{
CC_UNUSED_PARAM(nPriority);
CC_UNUSED_PARAM(pDelegate);
assert(0);
assert(pDelegate != NULL);
CCTouchHandler *handler = NULL;
handler = this->findHandler(pDelegate);
assert(handler != NULL);
handler->setPriority(nPriority);
this->rearrangeHandlers(m_pTargetedHandlers);
this->rearrangeHandlers(m_pStandardHandlers);
}
//

View File

@ -9,6 +9,10 @@ enum
kTagSequence,
};
CCLayer* nextActionManagerAction();
CCLayer* backActionManagerAction();
CCLayer* restartActionManagerAction();
static int sceneIdx = -1;
#define MAX_LAYER 5

View File

@ -1,6 +1,10 @@
#include "ActionsTest.h"
#include "../testResource.h"
CCLayer* NextAction();
CCLayer* BackAction();
CCLayer* RestartAction();
static int s_nActionIdx = -1;
CCLayer* CreateLayer(int nIndex)
@ -376,19 +380,19 @@ void ActionSkewRotateScale::onEnter()
CCSize boxSize = CCSizeMake(100.0f, 100.0f);
CCColorLayer *box = CCColorLayer::layerWithColor(ccc4(255, 255, 0, 255));
CCLayerColor *box = CCLayerColor::layerWithColor(ccc4(255, 255, 0, 255));
box->setAnchorPoint(ccp(0, 0));
box->setPosition(ccp(190, 110));
box->setContentSize(boxSize);
static float markrside = 10.0f;
CCColorLayer *uL = CCColorLayer::layerWithColor(ccc4(255, 0, 0, 255));
CCLayerColor *uL = CCLayerColor::layerWithColor(ccc4(255, 0, 0, 255));
box->addChild(uL);
uL->setContentSize(CCSizeMake(markrside, markrside));
uL->setPosition(ccp(0.f, boxSize.height - markrside));
uL->setAnchorPoint(ccp(0, 0));
CCColorLayer *uR = CCColorLayer::layerWithColor(ccc4(0, 0, 255, 255));
CCLayerColor *uR = CCLayerColor::layerWithColor(ccc4(0, 0, 255, 255));
box->addChild(uR);
uR->setContentSize(CCSizeMake(markrside, markrside));
uR->setPosition(ccp(boxSize.width - markrside, boxSize.height - markrside));

View File

@ -30,12 +30,12 @@ bool Bug1159Layer::init()
CCLayerColor *sprite_a = CCLayerColor::layerWithColorWidthHeight(ccc4(255, 0, 0, 255), 700, 700);
sprite_a->setAnchorPoint(ccp(0.5f, 0.5f));
sprite_a->setIsRelativeAnchorPoint(true);
sprite_a->setPosition(ccp(0.0, s.height/2));
sprite_a->setPosition(ccp(0.0f, s.height/2));
addChild(sprite_a);
sprite_a->runAction(CCRepeatForever::actionWithAction((CCActionInterval*) CCSequence::actions(
CCMoveTo::actionWithDuration(1.0f, ccp(1024.0, 384.0)),
CCMoveTo::actionWithDuration(1.0f, ccp(0.0, 384.0)),
CCMoveTo::actionWithDuration(1.0f, ccp(1024.0f, 384.0f)),
CCMoveTo::actionWithDuration(1.0f, ccp(0.0f, 384.0f)),
NULL)));
CCLayerColor *sprite_b = CCLayerColor::layerWithColorWidthHeight(ccc4(0, 0, 255, 255), 400, 400);
@ -46,7 +46,7 @@ bool Bug1159Layer::init()
CCMenuItemLabel *label = CCMenuItemLabel::itemWithLabel(CCLabelTTF::labelWithString("Flip Me", "Helvetica", 24), this, menu_selector(Bug1159Layer::callBack));
CCMenu *menu = CCMenu::menuWithItems(label, NULL);
menu->setPosition(ccp(s.width - 200, 50.0));
menu->setPosition(ccp(s.width - 200.0f, 50.0f));
addChild(menu);
return true;

View File

@ -5,6 +5,8 @@
#include "Bug-1174.h"
int check_for_error( CCPoint p1, CCPoint p2, CCPoint p3, CCPoint p4, float s, float t );
int check_for_error( CCPoint p1, CCPoint p2, CCPoint p3, CCPoint p4, float s, float t )
{
// the hit point is p3 + t * (p4 - p3);

View File

@ -9,6 +9,11 @@ enum
kTagSlider,
};
CCLayer* nextCocosNodeAction();
CCLayer* backCocosNodeAction();
CCLayer* restartCocosNodeAction();
//------------------------------------------------------------------
//
// TestCocosNodeDemo

View File

@ -3,6 +3,10 @@
#define MAX_LAYER 1
CCLayer* nextDirectorTestCase();
CCLayer* backDirectorTestCase();
CCLayer* restartDirectorTestCase();
static int sceneIdx=-1;
static ccDeviceOrientation s_currentOrientation = CCDeviceOrientationPortrait;

View File

@ -7,6 +7,10 @@ enum {
kTagSlider = 1,
};
CCLayer* nextEaseAction();
CCLayer* backEaseAction();
CCLayer* restartEaseAction();
//------------------------------------------------------------------
//
// SpriteEase

View File

@ -244,6 +244,10 @@ static int sceneIdx = -1;
#define MAX_LAYER 6
CCLayer* nextEffectAdvanceAction();
CCLayer* backEffectAdvanceAction();
CCLayer* restartEffectAdvanceAction();
CCLayer* createEffectAdvanceLayer(int nIndex)
{
switch(nIndex)

View File

@ -4,6 +4,10 @@
#define MAX_LAYERS 2;
static int sceneIdx = -1;
CCLayer* nextHiResAction();
CCLayer* restartHiResAction();
CCLayer* backHiResAction();
CCLayer* createHiResLayer(int idx)
{
CCLayer* pLayer = NULL;

View File

@ -33,6 +33,10 @@ enum
IDC_BACK,
IDC_RESTART
};
CCLayer* nextAtlasAction();
CCLayer* backAtlasAction();
CCLayer* restartAtlasAction();
static int sceneIdx = -1;
@ -351,6 +355,12 @@ std::string LabelAtlasColorTest::subtitle()
//------------------------------------------------------------------
//
// Atlas3
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
Atlas3::Atlas3()
@ -429,6 +439,12 @@ std::string Atlas3::subtitle()
//------------------------------------------------------------------
//
// Atlas4
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
Atlas4::Atlas4()
@ -515,6 +531,12 @@ std::string Atlas4::subtitle()
//------------------------------------------------------------------
//
// Atlas5
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
@ -541,6 +563,12 @@ std::string Atlas5::subtitle()
//------------------------------------------------------------------
//
// Atlas6
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
@ -578,16 +606,14 @@ std::string Atlas6::subtitle()
//------------------------------------------------------------------
//
// AtlasBitmapColor
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
/*
* Use any of these editors to generate bitmap font atlas:
* http://www.n4te.com/hiero/hiero.jnlp
* http://slick.cokeandcode.com/demos/hiero.jnlp
* http://www.angelcode.com/products/bmfont/
*/
AtlasBitmapColor::AtlasBitmapColor()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
@ -626,6 +652,12 @@ std::string AtlasBitmapColor::subtitle()
//------------------------------------------------------------------
//
// AtlasFastBitmap
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
@ -660,6 +692,12 @@ std::string AtlasFastBitmap::subtitle()
//------------------------------------------------------------------
//
// BitmapFontMultiLine
//
// Use any of these editors to generate BMFonts:
// http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
// http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
// http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
// http://www.angelcode.com/products/bmfont/ (Free, Windows only)
//
//------------------------------------------------------------------
BitmapFontMultiLine::BitmapFontMultiLine()
@ -767,7 +805,7 @@ std::string LabelsEmpty::title()
std::string LabelsEmpty::subtitle()
{
return "3 empty labels: LabelAtlas, Label and BitmapFontAtlas";
return "3 empty labels: LabelAtlas, LabelTTF and LabelBMFont";
}
//------------------------------------------------------------------

View File

@ -6,6 +6,10 @@ enum
kTagLayer = 1,
};
CCLayer* nextTestAction();
CCLayer* backTestAction();
CCLayer* restartTestAction();
static int sceneIdx = -1;
#define MAX_LAYER 4

View File

@ -28,6 +28,7 @@ MenuLayer1::MenuLayer1()
CCMenuItemFont::setFontSize( 30 );
CCMenuItemFont::setFontName("Courier New");
setIsTouchEnabled(true);
// Font Item
CCSprite* spriteNormal = CCSprite::spriteWithFile(s_MenuItem, CCRectMake(0,23*2,115,23));
@ -51,7 +52,7 @@ MenuLayer1::MenuLayer1()
// Font Item
CCMenuItem *item4 = CCMenuItemFont::itemFromString("I toggle enable items", this, menu_selector(MenuLayer1::menuCallbackEnable) );
// Label Item (BitmapFontAtlas)
// Label Item (CCLabelBMFont)
CCLabelBMFont* label = CCLabelBMFont::labelWithString("configuration", "fonts/bitmapFontTest3.fnt");
CCMenuItemLabel* item5 = CCMenuItemLabel::itemWithLabel(label, this, menu_selector(MenuLayer1::menuCallbackConfig));
@ -105,6 +106,28 @@ MenuLayer1::MenuLayer1()
}
void MenuLayer1::registerWithTouchDispatcher()
{
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, kCCMenuTouchPriority+1, true);
}
bool MenuLayer1::ccTouchBegan(CCTouch *touch, CCEvent * pEvent)
{
return true;
}
void MenuLayer1::ccTouchEnded(CCTouch *touch, CCEvent * pEvent)
{
}
void MenuLayer1::ccTouchCancelled(CCTouch *touch, CCEvent * pEvent)
{
}
void MenuLayer1::ccTouchMoved(CCTouch *touch, CCEvent * pEvent)
{
}
MenuLayer1::~MenuLayer1()
{
m_disabledItem->release();
@ -120,8 +143,19 @@ void MenuLayer1::menuCallbackConfig(CCObject* sender)
((CCLayerMultiplex*)m_pParent)->switchTo(3);
}
void MenuLayer1::allowTouches(ccTime dt)
{
CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority+1, this);
unscheduleAllSelectors();
CCLog("TOUCHES ALLOWED AGAIN");
}
void MenuLayer1::menuCallbackDisabled(CCObject* sender)
{
// hijack all touch events for 5 seconds
CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority-1, this);
schedule(schedule_selector(MenuLayer1::allowTouches), 5.0f);
CCLog("TOUCHES DISABLED FOR 5 SECONDS");
}
void MenuLayer1::menuCallbackEnable(CCObject* sender)

View File

@ -14,6 +14,13 @@ public:
~MenuLayer1();
public:
virtual void registerWithTouchDispatcher();
virtual bool ccTouchBegan(CCTouch *touch, CCEvent * pEvent);
virtual void ccTouchEnded(CCTouch *touch, CCEvent * pEvent);
virtual void ccTouchCancelled(CCTouch *touch, CCEvent * pEvent);
virtual void ccTouchMoved(CCTouch *touch, CCEvent * pEvent);
void allowTouches(ccTime dt);
void menuCallback(CCObject* pSender);
void menuCallbackConfig(CCObject* pSender);
void menuCallbackDisabled(CCObject* pSender);

View File

@ -1,6 +1,10 @@
#include "MotionStreakTest.h"
#include "../testResource.h"
CCLayer* nextMotionAction();
CCLayer* backMotionAction();
CCLayer* restartMotionAction();
//------------------------------------------------------------------
//
// MotionStreakTest1

View File

@ -7,6 +7,10 @@ enum
kTagGrossini,
};
CCLayer* nextParallaxAction();
CCLayer* backParallaxAction();
CCLayer* restartParallaxAction();
//------------------------------------------------------------------
//
// Parallax1

View File

@ -12,6 +12,10 @@ enum
kTagLabelAtlas = 1,
};
CCLayer* nextParticleAction();
CCLayer* backParticleAction();
CCLayer* restartParticleAction();
//------------------------------------------------------------------
//
// DemoFirework

View File

@ -5,6 +5,10 @@ static int sceneIdx = -1;
#define MAX_LAYER 3
CCLayer* nextAction();
CCLayer* backAction();
CCLayer* restartAction();
CCLayer* createLayer(int nIndex)
{
switch(nIndex)

View File

@ -1,9 +1,12 @@
#include "CCConfiguration.h"
#include "RenderTextureTest.h"
// Test #1 by Jason Booth (slipster216)
// Test #3 by David Deaco (ddeaco)
static int sceneIdx = -1;
#define MAX_LAYER 2
#define MAX_LAYER 3
CCLayer* createTestCase(int nIndex)
{
@ -12,6 +15,7 @@ CCLayer* createTestCase(int nIndex)
{
case 0: return new RenderTextureTest();
case 1: return new RenderTextureIssue937();
case 2: return new RenderTextureZbuffer();
}
return NULL;
@ -265,3 +269,143 @@ void RenderTextureScene::runThisTest()
CCDirector::sharedDirector()->replaceScene(this);
}
RenderTextureZbuffer::RenderTextureZbuffer()
{
this->setIsTouchEnabled(true);
CCSize size = CCDirector::sharedDirector()->getWinSize();
CCLabelTTF *label = CCLabelTTF::labelWithString("vertexZ = 50", "Marker Felt", 64);
label->setPosition(ccp(size.width / 2, size.height * 0.25f));
this->addChild(label);
CCLabelTTF *label2 = CCLabelTTF::labelWithString("vertexZ = 0", "Marker Felt", 64);
label2->setPosition(ccp(size.width / 2, size.height * 0.5f));
this->addChild(label2);
CCLabelTTF *label3 = CCLabelTTF::labelWithString("vertexZ = -50", "Marker Felt", 64);
label3->setPosition(ccp(size.width / 2, size.height * 0.75f));
this->addChild(label3);
label->setVertexZ(50);
label2->setVertexZ(0);
label3->setVertexZ(-50);
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("Images/bugs/circle.plist");
mgr = CCSpriteBatchNode::batchNodeWithFile("Images/bugs/circle.png", 9);
this->addChild(mgr);
sp1 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp2 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp3 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp4 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp5 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp6 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp7 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp8 = CCSprite::spriteWithSpriteFrameName("circle.png");
sp9 = CCSprite::spriteWithSpriteFrameName("circle.png");
mgr->addChild(sp1, 9);
mgr->addChild(sp2, 8);
mgr->addChild(sp3, 7);
mgr->addChild(sp4, 6);
mgr->addChild(sp5, 5);
mgr->addChild(sp6, 4);
mgr->addChild(sp7, 3);
mgr->addChild(sp8, 2);
mgr->addChild(sp9, 1);
sp1->setVertexZ(400);
sp2->setVertexZ(300);
sp3->setVertexZ(200);
sp4->setVertexZ(100);
sp5->setVertexZ(0);
sp6->setVertexZ(-100);
sp7->setVertexZ(-200);
sp8->setVertexZ(-300);
sp9->setVertexZ(-400);
sp9->setScale(2);
sp9->setColor(ccYELLOW);
}
string RenderTextureZbuffer::title()
{
return "Testing Z Buffer in Render Texture";
}
string RenderTextureZbuffer::subtitle()
{
return "Touch screen. It should be green";
}
void RenderTextureZbuffer::ccTouchesBegan(cocos2d::CCSet *touches, cocos2d::CCEvent *event)
{
CCSetIterator iter;
CCTouch *touch;
for (iter = touches->begin(); iter != touches->end(); ++iter)
{
touch = (CCTouch *)(*iter);
CCPoint location = touch->locationInView(touch->view());
location = CCDirector::sharedDirector()->convertToGL(location);
sp1->setPosition(location);
sp2->setPosition(location);
sp3->setPosition(location);
sp4->setPosition(location);
sp5->setPosition(location);
sp6->setPosition(location);
sp7->setPosition(location);
sp8->setPosition(location);
sp9->setPosition(location);
}
}
void RenderTextureZbuffer::ccTouchesMoved(CCSet* touches, CCEvent* event)
{
CCSetIterator iter;
CCTouch *touch;
for (iter = touches->begin(); iter != touches->end(); ++iter)
{
touch = (CCTouch *)(*iter);
CCPoint location = touch->locationInView(touch->view());
location = CCDirector::sharedDirector()->convertToGL(location);
sp1->setPosition(location);
sp2->setPosition(location);
sp3->setPosition(location);
sp4->setPosition(location);
sp5->setPosition(location);
sp6->setPosition(location);
sp7->setPosition(location);
sp8->setPosition(location);
sp9->setPosition(location);
}
}
void RenderTextureZbuffer::ccTouchesEnded(CCSet* touches, CCEvent* event)
{
this->renderScreenShot();
}
void RenderTextureZbuffer::renderScreenShot()
{
CCRenderTexture *texture = CCRenderTexture::renderTextureWithWidthAndHeight(512, 512);
texture->setAnchorPoint(ccp(0, 0));
texture->begin();
this->visit();
texture->end();
CCSprite *sprite = CCSprite::spriteWithTexture(texture->getSprite()->getTexture());
sprite->setPosition(ccp(256, 256));
sprite->setOpacity(182);
sprite->setFlipY(1);
this->addChild(sprite, 999999);
sprite->setColor(ccGREEN);
sprite->runAction(CCSequence::actions(CCFadeTo::actionWithDuration(2, 0),
CCHide::action(),
NULL));
}

View File

@ -45,4 +45,31 @@ public:
virtual void runThisTest();
};
class RenderTextureZbuffer : public RenderTextureTestDemo
{
public:
RenderTextureZbuffer();
virtual void ccTouchesMoved(CCSet* touches, CCEvent* event);
virtual void ccTouchesBegan(CCSet* touches, CCEvent* event);
virtual void ccTouchesEnded(CCSet* touches, CCEvent* event);
virtual std::string title();
virtual std::string subtitle();
void renderScreenShot();
private:
cocos2d::CCSpriteBatchNode *mgr;;
cocos2d::CCSprite *sp1;
cocos2d::CCSprite *sp2;
cocos2d::CCSprite *sp3;
cocos2d::CCSprite *sp4;
cocos2d::CCSprite *sp5;
cocos2d::CCSprite *sp6;
cocos2d::CCSprite *sp7;
cocos2d::CCSprite *sp8;
cocos2d::CCSprite *sp9;
};
#endif

View File

@ -8,6 +8,10 @@ enum {
#define MAX_TESTS 8
static int sceneIdx = -1;
CCLayer* nextSchedulerTest();
CCLayer* backSchedulerTest();
CCLayer* restartSchedulerTest();
CCLayer* createSchedulerTest(int nIndex)
{
CCLayer* pLayer = NULL;

View File

@ -1 +1 @@
a269232296e7dc61dea36f970051f49e0e3de527
3dfc0a1466d723c0efd4186440040fa78c875e13

View File

@ -6,6 +6,10 @@ enum
kTagTileMap = 1,
};
CCLayer* nextTileMapAction();
CCLayer* backTileMapAction();
CCLayer* restartTileMapAction();
//------------------------------------------------------------------
//
// TileMapTest

View File

@ -5,6 +5,10 @@
static int sceneIdx = -1;
CCLayer* nextZwoptexTest();
CCLayer* backZwoptexTest();
CCLayer* restartZwoptexTest();
CCLayer* createZwoptexLayer(int nIndex)
{
switch(nIndex)

View File

@ -0,0 +1 @@
eea7ee6d1eab766660efb216ab5fb16640957e75