issue #171, modify object-c code in annotate.

This commit is contained in:
Walzer 2010-09-28 04:14:12 +00:00
parent 569ac8d1eb
commit 01eb8da314
16 changed files with 98 additions and 98 deletions

View File

@ -58,11 +58,11 @@ public:
/** If isTouchEnabled, this method is called onEnter. Override it to change the /** If isTouchEnabled, this method is called onEnter. Override it to change the
way CCLayer receives touch events. way CCLayer receives touch events.
( Default: [[TouchDispatcher sharedDispatcher] addStandardDelegate:self priority:0] ) ( Default: CCTouchDispatcher::getSharedDispatcher()->addStandardDelegate(this,0); )
Example: Example:
-(void) registerWithTouchDispatcher void CCLayer::registerWithTouchDispatcher()
{ {
[[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES]; CCTouchDispatcher::getSharedDispatcher()->addTargetedDelegate(this,INT_MIN+1,true);
} }
@since v0.8.0 @since v0.8.0
*/ */

View File

@ -124,8 +124,11 @@ class CCX_DLL CCNode : public SelectorProtocol, public NSObject
/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. */ /** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. */
CCX_PROPERTY(float, m_fRotation, Rotation) CCX_PROPERTY(float, m_fRotation, Rotation)
/** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */ /** Get the scale factor of the node.
@warning: Assert when m_fScaleX != m_fScaleY.
*/
float getScale(); float getScale();
/** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */
void setScale(float scale); void setScale(float scale);
/** The scale factor of the node. 1.0 is the default scale factor. It only modifies the X scale factor. */ /** The scale factor of the node. 1.0 is the default scale factor. It only modifies the X scale factor. */

View File

@ -35,7 +35,7 @@ namespace cocos2d {
* This uses a 3DAction so it's strongly recommended that depth buffering * This uses a 3DAction so it's strongly recommended that depth buffering
* is turned on in CCDirector using: * is turned on in CCDirector using:
* *
* [[CCDirector sharedDirector] setDepthBufferFormat:kDepthBuffer16]; * CCDirector::getSharedDirector()->setDepthBufferFormat(kDepthBuffer16);
* *
* @since v0.8.2 * @since v0.8.2
*/ */
@ -43,7 +43,7 @@ class CCX_DLL CCPageTurnTransition : public CCTransitionScene
{ {
protected: protected:
bool m_bBack; bool m_bBack;
public: public:
CCPageTurnTransition(); CCPageTurnTransition();
virtual ~CCPageTurnTransition(); virtual ~CCPageTurnTransition();

View File

@ -70,7 +70,7 @@ namespace cocos2d {
} }
}; };
//! A sun particle system //! A sun particle system
class CCX_DLL CCParticleSun : public CCQuadParticleSystem class CCX_DLL CCParticleSun : public CCQuadParticleSystem
{ {
public: public:
@ -91,7 +91,7 @@ namespace cocos2d {
} }
}; };
//! A galaxy particle system //! A galaxy particle system
class CCX_DLL CCParticleGalaxy : public CCQuadParticleSystem class CCX_DLL CCParticleGalaxy : public CCQuadParticleSystem
{ {
public: public:
@ -112,7 +112,7 @@ namespace cocos2d {
} }
}; };
//! A flower particle system //! A flower particle system
class CCX_DLL CCParticleFlower : public CCQuadParticleSystem class CCX_DLL CCParticleFlower : public CCQuadParticleSystem
{ {
public: public:
@ -133,7 +133,7 @@ namespace cocos2d {
} }
}; };
//! A meteor particle system //! A meteor particle system
class CCX_DLL CCParticleMeteor : public CCQuadParticleSystem class CCX_DLL CCParticleMeteor : public CCQuadParticleSystem
{ {
public: public:
@ -154,7 +154,7 @@ namespace cocos2d {
} }
}; };
//! An spiral particle system //! An spiral particle system
class CCX_DLL CCParticleSpiral : public CCQuadParticleSystem class CCX_DLL CCParticleSpiral : public CCQuadParticleSystem
{ {
public: public:
@ -175,7 +175,7 @@ namespace cocos2d {
} }
}; };
//! An explosion particle system //! An explosion particle system
class CCX_DLL CCParticleExplosion : public CCQuadParticleSystem class CCX_DLL CCParticleExplosion : public CCQuadParticleSystem
{ {
public: public:
@ -196,7 +196,7 @@ namespace cocos2d {
} }
}; };
//! An smoke particle system //! An smoke particle system
class CCX_DLL CCParticleSmoke : public CCQuadParticleSystem class CCX_DLL CCParticleSmoke : public CCQuadParticleSystem
{ {
public: public:
@ -217,7 +217,7 @@ namespace cocos2d {
} }
}; };
//! An snow particle system //! An snow particle system
class CCX_DLL CCParticleSnow : public CCQuadParticleSystem class CCX_DLL CCParticleSnow : public CCQuadParticleSystem
{ {
public: public:
@ -238,7 +238,7 @@ namespace cocos2d {
} }
}; };
//! A rain particle system //! A rain particle system
class CCX_DLL CCParticleRain : public CCQuadParticleSystem class CCX_DLL CCParticleRain : public CCQuadParticleSystem
{ {
public: public:

View File

@ -331,7 +331,7 @@ namespace cocos2d {
*/ */
CCX_PROPERTY(tCCPositionType, m_ePositionType, PositionType) CCX_PROPERTY(tCCPositionType, m_ePositionType, PositionType)
/** whether or not the node will be auto-removed when it has no particles left. /** whether or not the node will be auto-removed when it has no particles left.
By default it is NO. By default it is false.
@since v0.8 @since v0.8
*/ */
CCX_PROPERTY(bool, m_bIsAutoRemoveOnFinish, IsAutoRemoveOnFinish) CCX_PROPERTY(bool, m_bIsAutoRemoveOnFinish, IsAutoRemoveOnFinish)
@ -383,6 +383,9 @@ namespace cocos2d {
virtual void update(ccTime dt); virtual void update(ccTime dt);
private: private:
/** Private method, return the string found by key in dict.
@return "" if not found; return the string if found.
*/
inline const char * valueForKey(const char *key, NSDictionary<std::string, NSObject*> *dict) inline const char * valueForKey(const char *key, NSDictionary<std::string, NSObject*> *dict)
{ {
if (dict) if (dict)

View File

@ -35,8 +35,8 @@ namespace cocos2d {
class CCX_DLL CCRadialCCWTransition : public CCTransitionScene class CCX_DLL CCRadialCCWTransition : public CCTransitionScene
{ {
public: public:
CCRadialCCWTransition(); CCRadialCCWTransition(){}
virtual ~CCRadialCCWTransition(); virtual ~CCRadialCCWTransition(){}
virtual void onEnter(); virtual void onEnter();
virtual void onExit(); virtual void onExit();
@ -54,8 +54,8 @@ protected:
class CCX_DLL CCRadialCWTransition : public CCRadialCCWTransition class CCX_DLL CCRadialCWTransition : public CCRadialCCWTransition
{ {
public: public:
// CCRadialCWTransition(); CCRadialCWTransition(){}
// virtual ~CCRadialCWTransition(); virtual ~CCRadialCWTransition(){}
static CCRadialCWTransition* transitionWithDuration(ccTime t, CCScene* scene); static CCRadialCWTransition* transitionWithDuration(ccTime t, CCScene* scene);
protected: protected:

View File

@ -56,7 +56,7 @@ namespace cocos2d {
bool initWithWidthAndHeight(int width, int height); bool initWithWidthAndHeight(int width, int height);
void begin(); void begin();
void end(); void end();
/* get buffer as UIImage */ /** get buffer as UIImage */
UIImage *getUIImageFromBuffer(); UIImage *getUIImageFromBuffer();
/** saves the texture into a file */ /** saves the texture into a file */
bool saveBuffer(const char *name); bool saveBuffer(const char *name);

View File

@ -82,7 +82,7 @@ namespace cocos2d {
/** dealloc the map that contains the tile position from memory. /** dealloc the map that contains the tile position from memory.
Unless you want to know at runtime the tiles positions, you can safely call this method. Unless you want to know at runtime the tiles positions, you can safely call this method.
If you are going to call [layer tileGIDAt:] then, don't release the map If you are going to call layer->tileGIDAt() then, don't release the map
*/ */
void releaseMap(); void releaseMap();
@ -90,14 +90,14 @@ namespace cocos2d {
The returned CCSprite will be already added to the CCTMXLayer. Don't add it again. The returned CCSprite will be already added to the CCTMXLayer. Don't add it again.
The CCSprite can be treated like any other CCSprite: rotated, scaled, translated, opacity, color, etc. The CCSprite can be treated like any other CCSprite: rotated, scaled, translated, opacity, color, etc.
You can remove either by calling: You can remove either by calling:
- [layer removeChild:sprite cleanup:cleanup]; - layer->removeChild(sprite, cleanup);
- or [layer removeTileAt:ccp(x,y)]; - or layer->removeTileAt(ccp(x,y));
*/ */
CCSprite* tileAt(CGPoint tileCoordinate); CCSprite* tileAt(CGPoint tileCoordinate);
/** returns the tile gid at a given tile coordinate. /** returns the tile gid at a given tile coordinate.
if it returns 0, it means that the tile is empty. if it returns 0, it means that the tile is empty.
This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]) This method requires the the tile map has not been previously released (eg. don't call layer->releaseMap())
*/ */
unsigned int tileGIDAt(CGPoint tileCoordinate); unsigned int tileGIDAt(CGPoint tileCoordinate);
@ -120,7 +120,7 @@ namespace cocos2d {
void setupTiles(); void setupTiles();
/** CCTMXLayer doesn't support adding a CCSprite manually. /** CCTMXLayer doesn't support adding a CCSprite manually.
@warning addchild:z:tag: is not supported on CCTMXLayer. Instead of setTileGID:at:/tileAt: @warning addchild(z, tag); is not supported on CCTMXLayer. Instead of setTileGID.
*/ */
CCNode * addChild(CCNode * child, int zOrder, int tag); CCNode * addChild(CCNode * child, int zOrder, int tag);
// super method // super method
@ -149,10 +149,10 @@ namespace cocos2d {
unsigned int atlasIndexForExistantZ(unsigned int z); unsigned int atlasIndexForExistantZ(unsigned int z);
unsigned int atlasIndexForNewZ(int z); unsigned int atlasIndexForNewZ(int z);
protected: protected:
/** name of the layer */ // name of the layer
std::string m_sLayerName; std::string m_sLayerName;
// TMX Layer supports opacity
unsigned char m_cOpacity; // TMX Layer supports opacity unsigned char m_cOpacity;
unsigned int m_uMinGID; unsigned int m_uMinGID;
unsigned int m_uMaxGID; unsigned int m_uMaxGID;

View File

@ -55,7 +55,7 @@ namespace cocos2d {
Features: Features:
- Each tile will be treated as an CCSprite - Each tile will be treated as an CCSprite
- The sprites are created on demand. They will be created only when you call "[layer tileAt:]" - The sprites are created on demand. They will be created only when you call "layer->tileAt(position)"
- Each tile can be rotated / moved / scaled / tinted / "opacitied", since each tile is a CCSprite - Each tile can be rotated / moved / scaled / tinted / "opacitied", since each tile is a CCSprite
- Tiles can be added/removed in runtime - Tiles can be added/removed in runtime
- The z-order of the tiles can be modified in runtime - The z-order of the tiles can be modified in runtime
@ -79,22 +79,22 @@ namespace cocos2d {
Each layer is created using an CCTMXLayer (subclass of CCSpriteSheet). If you have 5 layers, then 5 CCTMXLayer will be created, Each layer is created using an CCTMXLayer (subclass of CCSpriteSheet). If you have 5 layers, then 5 CCTMXLayer will be created,
unless the layer visibility is off. In that case, the layer won't be created at all. unless the layer visibility is off. In that case, the layer won't be created at all.
You can obtain the layers (CCTMXLayer objects) at runtime by: You can obtain the layers (CCTMXLayer objects) at runtime by:
- [map getChildByTag: tag_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc... - map->getChildByTag(tag_number); // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...
- [map layerNamed: name_of_the_layer]; - map->layerNamed(name_of_the_layer);
Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray. Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray.
You can obtain the object groups at runtime by: You can obtain the object groups at runtime by:
- [map objectGroupNamed: name_of_the_object_group]; - map->objectGroupNamed(name_of_the_object_group);
Each object is a CCTMXObject. Each object is a CCTMXObject.
Each property is stored as a key-value pair in an NSMutableDictionary. Each property is stored as a key-value pair in an NSMutableDictionary.
You can obtain the properties at runtime by: You can obtain the properties at runtime by:
[map propertyNamed: name_of_the_property]; map->propertyNamed(name_of_the_property);
[layer propertyNamed: name_of_the_property]; layer->propertyNamed(name_of_the_property);
[objectGroup propertyNamed: name_of_the_property]; objectGroup->propertyNamed(name_of_the_property);
[object propertyNamed: name_of_the_property]; object->propertyNamed(name_of_the_property);
@since v0.8.1 @since v0.8.1
*/ */

View File

@ -37,7 +37,6 @@ namespace cocos2d {
* *
*/ */
enum { enum {
TMXLayerAttribNone = 1 << 0, TMXLayerAttribNone = 1 << 0,
TMXLayerAttribBase64 = 1 << 1, TMXLayerAttribBase64 = 1 << 1,
@ -123,27 +122,27 @@ namespace cocos2d {
class CCX_DLL CCTMXMapInfo : public NSObject class CCX_DLL CCTMXMapInfo : public NSObject
{ {
public: public:
// map orientation /// map orientation
CCX_SYNTHESIZE(int, m_nOrientation, Orientation); CCX_SYNTHESIZE(int, m_nOrientation, Orientation);
// map width & height /// map width & height
CCX_SYNTHESIZE(CGSize, m_tMapSize, MapSize); CCX_SYNTHESIZE(CGSize, m_tMapSize, MapSize);
// tiles width & height /// tiles width & height
CCX_SYNTHESIZE(CGSize, m_tTileSize, TileSize); CCX_SYNTHESIZE(CGSize, m_tTileSize, TileSize);
// Layers /// Layers
CCX_PROPERTY(NSMutableArray<CCTMXLayerInfo*>*, m_pLayers, Layers); CCX_PROPERTY(NSMutableArray<CCTMXLayerInfo*>*, m_pLayers, Layers);
// tilesets /// tilesets
CCX_PROPERTY(NSMutableArray<CCTMXTilesetInfo*>*, m_pTilesets, Tilesets); CCX_PROPERTY(NSMutableArray<CCTMXTilesetInfo*>*, m_pTilesets, Tilesets);
// ObjectGroups /// ObjectGroups
CCX_PROPERTY(NSMutableArray<CCTMXObjectGroup*>*, m_pObjectGroups, ObjectGroups); CCX_PROPERTY(NSMutableArray<CCTMXObjectGroup*>*, m_pObjectGroups, ObjectGroups);
// parent element /// parent element
CCX_SYNTHESIZE(int, m_nParentElement, ParentElement); CCX_SYNTHESIZE(int, m_nParentElement, ParentElement);
// parent GID /// parent GID
CCX_SYNTHESIZE(unsigned int, m_uParentGID, ParentGID); CCX_SYNTHESIZE(unsigned int, m_uParentGID, ParentGID);
// layer attribs /// layer attribs
CCX_SYNTHESIZE(int, m_nLayerAttribs, LayerAttribs); CCX_SYNTHESIZE(int, m_nLayerAttribs, LayerAttribs);
// is stroing characters? /// is stroing characters?
CCX_SYNTHESIZE(bool, m_bStoringCharacters, StoringCharacters); CCX_SYNTHESIZE(bool, m_bStoringCharacters, StoringCharacters);
// properties /// properties
CCX_PROPERTY(CCXStringToStringDictionary*, m_pProperties, Properties); CCX_PROPERTY(CCXStringToStringDictionary*, m_pProperties, Properties);
public: public:
CCTMXMapInfo(); CCTMXMapInfo();
@ -152,7 +151,7 @@ namespace cocos2d {
static CCTMXMapInfo * formatWithTMXFile(const char *tmxFile); static CCTMXMapInfo * formatWithTMXFile(const char *tmxFile);
/** initializes a TMX format witha tmx file */ /** initializes a TMX format witha tmx file */
bool initWithTMXFile(const char *tmxFile); bool initWithTMXFile(const char *tmxFile);
/* initalises parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */ /** initalises parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */
bool parseXMLFile(const char *xmlFilename); bool parseXMLFile(const char *xmlFilename);
NSDictionary<int, CCXStringToStringDictionary*> * getTileProperties(); NSDictionary<int, CCXStringToStringDictionary*> * getTileProperties();

View File

@ -188,6 +188,7 @@ public:
/** sets the default pixel format for UIImages that contains alpha channel. /** sets the default pixel format for UIImages that contains alpha channel.
If the UIImage contains alpha channel, then the options are: If the UIImage contains alpha channel, then the options are:
- generate 32-bit textures: kCCTexture2DPixelFormat_RGBA8888 (default one) - generate 32-bit textures: kCCTexture2DPixelFormat_RGBA8888 (default one)
- generate 24-bit textures: kCCTexture2DPixelFormat_RGB888
- generate 16-bit textures: kCCTexture2DPixelFormat_RGBA4444 - generate 16-bit textures: kCCTexture2DPixelFormat_RGBA4444
- generate 16-bit textures: kCCTexture2DPixelFormat_RGB5A1 - generate 16-bit textures: kCCTexture2DPixelFormat_RGB5A1
- generate 16-bit textures: kCCTexture2DPixelFormat_RGB565 - generate 16-bit textures: kCCTexture2DPixelFormat_RGB565
@ -195,7 +196,7 @@ public:
How does it work ? How does it work ?
- If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture) - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture)
- If the image is an RGB (without Alpha) then an RGB565 texture will be used (16-bit texture) - If the image is an RGB (without Alpha) then an RGB565 or RGB888 texture will be used (16-bit texture)
@since v0.8 @since v0.8
*/ */

View File

@ -49,7 +49,7 @@ protected:
NSLock *m_pContextLock; NSLock *m_pContextLock;
private: private:
void addImageWithAsyncObject(CCAsyncObject* async); // @todo void addImageWithAsyncObject(CCAsyncObject* async);
public: public:
@ -74,15 +74,15 @@ public:
*/ */
CCTexture2D* addImage(const char* fileimage); CCTexture2D* addImage(const char* fileimage);
/** Returns a Texture2D object given a file image /* Returns a Texture2D object given a file image
* If the file image was not previously loaded, it will create a new CCTexture2D object and it will return it. * If the file image was not previously loaded, it will create a new CCTexture2D object and it will return it.
* Otherwise it will load a texture in a new thread, and when the image is loaded, the callback will be called with the Texture2D as a parameter. * Otherwise it will load a texture in a new thread, and when the image is loaded, the callback will be called with the Texture2D as a parameter.
* The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback. * The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback.
* Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif * Supported image extensions: .png, .jpg
* @since v0.8 * @since v0.8
*/ */
/// @todo selector
void addImageAsync(const char* filename, NSObject*target, fpAsyncCallback func); // @todo void addImageAsync(const char* filename, NSObject*target, fpAsyncCallback func);
#if _POWERVR_SUPPORT_ #if _POWERVR_SUPPORT_
/** Returns a Texture2D object given an PVRTC RAW filename /** Returns a Texture2D object given an PVRTC RAW filename
@ -102,14 +102,14 @@ public:
CCTexture2D* addPVRTCImage(const char* fileimage); CCTexture2D* addPVRTCImage(const char* fileimage);
#endif #endif
/** Returns a Texture2D object given an CGImageRef image /* Returns a Texture2D object given an CGImageRef image
* If the image was not previously loaded, it will create a new CCTexture2D object and it will return it. * If the image was not previously loaded, it will create a new CCTexture2D object and it will return it.
* Otherwise it will return a reference of a previously loaded image * Otherwise it will return a reference of a previously loaded image
* The "key" parameter will be used as the "key" for the cache. * The "key" parameter will be used as the "key" for the cache.
* If "key" is nil, then a new texture will be created each time. * If "key" is nil, then a new texture will be created each time.
* @since v0.8 * @since v0.8
*/ */
/// @todo CGImageRef CCTexture2D* addCGImage(CGImageRef image, string & key); // @todo CGImageRef CCTexture2D* addCGImage(CGImageRef image, string & key);
/** Returns a Texture2D object given an UIImage image /** Returns a Texture2D object given an UIImage image
* If the image was not previously loaded, it will create a new CCTexture2D object and it will return it. * If the image was not previously loaded, it will create a new CCTexture2D object and it will return it.
* Otherwise it will return a reference of a previously loaded image * Otherwise it will return a reference of a previously loaded image

View File

@ -78,9 +78,9 @@ namespace cocos2d {
void updateAtlasValues(); void updateAtlasValues();
protected: protected:
/// x,y to altas dicctionary // x,y to altas dicctionary
StringToIntegerDictionary *m_pPosToAtlasIndex; StringToIntegerDictionary *m_pPosToAtlasIndex;
/// numbers of tiles to render // numbers of tiles to render
int m_nItemsToRender; int m_nItemsToRender;
}; };

View File

@ -42,10 +42,10 @@ class CCNode;
*/ */
class CCX_DLL CCTransitionEaseScene// : public NSObject class CCX_DLL CCTransitionEaseScene// : public NSObject
{ {
public:
/** returns the Ease action that will be performed on a linear action. /** returns the Ease action that will be performed on a linear action.
@since v0.8.2 @since v0.8.2
*/ */
public:
virtual CCIntervalAction * easeActionWithAction(CCIntervalAction * action) = 0; virtual CCIntervalAction * easeActionWithAction(CCIntervalAction * action) = 0;
}; };
@ -404,7 +404,7 @@ public:
virtual ~CCFadeTransition(); virtual ~CCFadeTransition();
/** creates the transition with a duration and with an RGB color /** creates the transition with a duration and with an RGB color
* Example: [FadeTransition transitionWithDuration:2 scene:s withColor:ccc3(255,0,0)]; // red color * Example: FadeTransition::transitionWithDuration(2, scene, ccc3(255,0,0); // red color
*/ */
static CCFadeTransition* transitionWithDuration(ccTime duration,CCScene* scene, ccColor3B color = ccBLACK); static CCFadeTransition* transitionWithDuration(ccTime duration,CCScene* scene, ccColor3B color = ccBLACK);
/** initializes the transition with a duration and with an RGB color */ /** initializes the transition with a duration and with an RGB color */

View File

@ -42,13 +42,6 @@ enum {
kSceneRadial = 0xc001, kSceneRadial = 0xc001,
}; };
CCRadialCCWTransition::CCRadialCCWTransition()
{
}
CCRadialCCWTransition::~CCRadialCCWTransition()
{
}
void CCRadialCCWTransition::sceneOrder() void CCRadialCCWTransition::sceneOrder()
{ {
m_bIsInSceneOnTop = false; m_bIsInSceneOnTop = false;

View File

@ -34,7 +34,7 @@ THE SOFTWARE.
#include "CCXFileUtils.h" #include "CCXFileUtils.h"
#include "CCXUIImage.h" #include "CCXUIImage.h"
/// @todo EAGLContext static EAGLContext *auxEAGLcontext = NULL; // @todo EAGLContext static EAGLContext *auxEAGLcontext = NULL;
namespace cocos2d { namespace cocos2d {
class CCAsyncObject : NSObject class CCAsyncObject : NSObject
@ -82,7 +82,7 @@ CCTextureCache::~CCTextureCache()
CCX_SAFE_RELEASE(m_pTextures); CCX_SAFE_RELEASE(m_pTextures);
CCX_SAFE_DELETE(m_pDictLock); CCX_SAFE_DELETE(m_pDictLock);
CCX_SAFE_DELETE(m_pContextLock); CCX_SAFE_DELETE(m_pContextLock);
/// @todo release // @todo release
// [auxEAGLcontext release]; // [auxEAGLcontext release];
// auxEAGLcontext = nil; // auxEAGLcontext = nil;
} }
@ -102,9 +102,10 @@ char * CCTextureCache::description()
// TextureCache - Add Images // TextureCache - Add Images
/* @todo EAGLContext
void CCTextureCache::addImageWithAsyncObject(CCAsyncObject* async) void CCTextureCache::addImageWithAsyncObject(CCAsyncObject* async)
{ {
/** @todo EAGLContext
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
// textures will be created on the main OpenGL context // textures will be created on the main OpenGL context
@ -134,42 +135,42 @@ sharegroup:[[[[CCDirector sharedDirector] openGLView] context] sharegroup]];
} }
[contextLock unlock]; [contextLock unlock];
[autoreleasepool release];*/ [autoreleasepool release];
} }*/
/** @todo selector, NSThread*/ /* @todo selector, NSThread
void CCTextureCache::addImageAsync(const char* filename, NSObject *target, fpAsyncCallback func) void CCTextureCache::addImageAsync(const char* filename, NSObject *target, fpAsyncCallback func)
{ {
NSAssert(filename != NULL , "TextureCache: fileimage MUST not be nill"); NSAssert(filename != NULL , "TextureCache: fileimage MUST not be nill");
// optimization // optimization
// CCTexture2D * tex; CCTexture2D * tex;
//
// if ( (tex = m_pTextures->objectForKey(filename)) ) if ( (tex = m_pTextures->objectForKey(filename)) )
// { {
// target-> target->
// } }
//
// if( (tex=[textures objectForKey: filename] ) ) { if( (tex=[textures objectForKey: filename] ) ) {
// [target performSelector:selector withObject:tex]; [target performSelector:selector withObject:tex];
// return; return;
// } }
//
// // schedule the load // schedule the load
//
// CCAsyncObject *asyncObject = [[CCAsyncObject alloc] init]; CCAsyncObject *asyncObject = [[CCAsyncObject alloc] init];
// asyncObject.selector = selector; asyncObject.selector = selector;
// asyncObject.target = target; asyncObject.target = target;
// asyncObject.data = filename; asyncObject.data = filename;
//
// [NSThread detachNewThreadSelector:@selector(addImageWithAsyncObject:) toTarget:self withObject:asyncObject]; [NSThread detachNewThreadSelector:@selector(addImageWithAsyncObject:) toTarget:self withObject:asyncObject];
// [asyncObject release]; [asyncObject release];
} }*/
CCTexture2D * CCTextureCache::addImage(const char * path) CCTexture2D * CCTextureCache::addImage(const char * path)
{ {
@ -320,7 +321,7 @@ CCTexture2D * CCTextureCache::addPVRTCImage(const char* fileimage)
} }
#endif #endif
/** @todo CGImageRef /* @todo CGImageRef
-(CCTexture2D*) addCGImage: (CGImageRef) imageref forKey: (string & )key -(CCTexture2D*) addCGImage: (CGImageRef) imageref forKey: (string & )key
{ {
NSAssert(imageref != nil, @"TextureCache: image MUST not be nill"); NSAssert(imageref != nil, @"TextureCache: image MUST not be nill");