Projects > cpp > Issues > Feature #3324

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Add an API Texture2D* TextureCache::addImage(Image *image, cons char * key)

Feature #3324 [Closed]
birdflying1005 2013-11-30 05:04 . Updated over 4 years ago

I am using TextureCache::addImage, why not add an API

Texture2D* TextureCache::addImage(Image image, cons charkey) ?

birdflying1005 2013-11-30 05:48

I am sorry, I mean to add an API like :

Texture2D * TextureCache::addImage(const std::string &path, const std::string &key);

birdflying1005 2013-11-30 06:30

Texture2D * TextureCache::addImage(const std::string &path)

Currently, the implementation is to convert the path to the real path, and put the real path as the key to store image into map.

_textures.insert( std::make_pair(fullpath, texture) );

When I use TextureCache::getInstance()->getTextureForKey to get the image, I have to input the real path of the image as the key to query it. Complicated and unreasonable a bit.

Sean 2014-10-08 02:55

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to

Atom PDF

Start date:2013-11-30
Due date:
% Done:


Target version:-